| | @@ -1,3 +1,4 @@ |
| 1 | +import ErdosSwarm.Erdos530PrimeField |
| 1 | 2 | import Mathlib.Algebra.Module.Presentation.Basic |
| 2 | 3 | import Mathlib.LinearAlgebra.FiniteDimensional.Basic |
| 3 | 4 | import Mathlib.SetTheory.Cardinal.Finite |
| | @@ -12,9 +13,10 @@ of the October 2026 sidon-palomar report. The span is formed directly over `F`. |
| 12 | 13 | |
| 13 | 14 | Lean checks the construction, its universal property and the count `classCount F B` of distinct |
| 14 | 15 | symbols. This count bounds the number of distinct labels of any sum-preserving map into an |
| 15 | | −`F`-vector space. Applying inequality (8) with `h ≤ classCount F B` is a follow-up task. The |
| 16 | | −asymptotic consequences of (8) are proved on paper. The implication from popular differences |
| 17 | | −to a fixed gain in task t-6d127193c0 remains open. |
| 16 | +`F`-vector space. For a finite field of odd characteristic, inequality (8) is Lean-checked |
| 17 | +for every `h ≤ classCount F B`, including its real form for a restriction `B ⊆ A` at an odd |
| 18 | +prime. The asymptotic threshold `ρ > 1/2` and gain `c₀(ε - 2ε²)` at `p ~ √(3N/4)` have paper |
| 19 | +proofs. The implication from popular differences to a fixed gain in t-6d127193c0 remains open. |
| 18 | 20 | -/ |
| 19 | 21 | |
| 20 | 22 | namespace ErdosSwarm.Erdos530SymbolSpace |
| | @@ -79,6 +81,17 @@ theorem existsUnique_lift (f : B → V) (hf : PreservesSums B f) : |
| 79 | 81 | intro L hL |
| 80 | 82 | exact Module.Relations.Quotient.linearMap_ext fun b => (hL b).trans (hs b).symm |
| 81 | 83 | |
| 84 | +/-- If two symbols coincide in the relation space of a restriction `C ⊆ B`, their images |
| 85 | +coincide in the relation space of `B`. -/ |
| 86 | +theorem symbol_eq_of_subset (F : Type*) [Field F] {α : Type*} [AddCommMonoid α] |
| 87 | + {C B : Finset α} (hCB : C ⊆ B) (c c' : C) (h : symbol F C c = symbol F C c') : |
| 88 | + symbol F B ⟨c, hCB c.2⟩ = symbol F B ⟨c', hCB c'.2⟩ := by |
| 89 | + let i (a : C) : B := ⟨a, hCB a.property⟩ |
| 90 | + have hf : PreservesSums C (fun a => symbol F B (i a)) := fun a b c d hsum => |
| 91 | + symbol_preservesSums F B (i a) (i b) (i c) (i d) hsum |
| 92 | + obtain ⟨L, hL, _⟩ := existsUnique_lift F C _ hf |
| 93 | + simpa only [hL] using congrArg L h |
| 94 | + |
| 82 | 95 | /-- The number of distinct symbols, denoted `d_p(B)` over the field of order `p`. -/ |
| 83 | 96 | noncomputable def classCount : ℕ := by |
| 84 | 97 | classical |
| | @@ -114,4 +127,54 @@ theorem classCount_eq_card_of_injective (f : B → V) (hf : PreservesSums B f) |
| 114 | 127 | apply le_antisymm (classCount_le_card F B) |
| 115 | 128 | simpa [card_image_of_injective _ hinj] using card_image_le_classCount F B f hf |
| 116 | 129 | |
| 130 | +/-- Inequality (8), cleared of denominators, for any `h ≤ d_F(B)` over a finite field |
| 131 | +of odd characteristic. Extend the canonical symbol map by zero off `B` to apply the |
| 132 | +finite-field projection bound. -/ |
| 133 | +theorem exists_sidon_subset_of_classCount {F : Type*} [Field F] [Fintype F] [DecidableEq F] |
| 134 | + (h2 : (2 : F) ≠ 0) {α : Type*} [AddCommMonoid α] (B : Finset α) |
| 135 | + (h : ℕ) (hh : h ≤ classCount F B) : |
| 136 | + ∃ S ⊆ B, IsSidon (S : Set α) ∧ |
| 137 | + (Fintype.card F) ^ 2 * h ≤ (Fintype.card F) ^ 3 * S.card + h.choose 2 := by |
| 138 | + classical |
| 139 | + let f (a : α) : SymbolSpace F B := if ha : a ∈ B then symbol F B ⟨a, ha⟩ else 0 |
| 140 | + apply Erdos530PrimeField.exists_sidon_subset_of_modular_classes h2 B f ?_ h (hh.trans ?_) |
| 141 | + · intro a ha b hb c hc d hd hsum |
| 142 | + simpa only [f, dif_pos ha, dif_pos hb, dif_pos hc, dif_pos hd] using |
| 143 | + symbol_preservesSums F B ⟨a, ha⟩ ⟨b, hb⟩ ⟨c, hc⟩ ⟨d, hd⟩ hsum |
| 144 | + · unfold classCount |
| 145 | + apply card_le_card |
| 146 | + intro y hy |
| 147 | + obtain ⟨b, _, rfl⟩ := mem_image.mp hy |
| 148 | + exact mem_image.mpr ⟨b, b.property, dif_pos b.property⟩ |
| 149 | + |
| 150 | +/-- Inequality (8) for a restriction `B ⊆ A` of a finite real set and every `h ≤ d_p(B)` |
| 151 | +at an odd prime `p`. The asymptotic threshold and gain have paper proofs. The structural |
| 152 | +implication of t-6d127193c0 remains open. -/ |
| 153 | +theorem exists_sidon_subset_real_of_classCount {p : ℕ} [Fact p.Prime] (hp : p ≠ 2) |
| 154 | + (A B : Finset ℝ) (hBA : B ⊆ A) (h : ℕ) (hh : h ≤ classCount (ZMod p) B) : |
| 155 | + ∃ S ⊆ A, IsSidon (S : Set ℝ) ∧ |
| 156 | + ((h : ℝ) - (h.choose 2 : ℝ) / (p : ℝ) ^ 2) / p ≤ S.card := by |
| 157 | + obtain ⟨S, hSB, hSidon, hcard⟩ := |
| 158 | + exists_sidon_subset_of_classCount (Erdos530PrimeField.two_ne_zero_zmod hp) B h hh |
| 159 | + rw [ZMod.card] at hcard |
| 160 | + refine ⟨S, hSB.trans hBA, hSidon, ?_⟩ |
| 161 | + have hp0 : (0 : ℝ) < p := by exact_mod_cast (Fact.out : p.Prime).pos |
| 162 | + have hreal : (p : ℝ) ^ 2 * h ≤ (p : ℝ) ^ 3 * S.card + h.choose 2 := by exact_mod_cast hcard |
| 163 | + field_simp |
| 164 | + linarith only [hreal] |
| 165 | + |
| 166 | +-- Four of the nine classes in the plane over F₃ give 36 ≤ 27|S| + 6. |
| 167 | +example : ∃ S ⊆ (Finset.univ : Finset (ZMod 3 × ZMod 3)), |
| 168 | + IsSidon (S : Set (ZMod 3 × ZMod 3)) ∧ 2 ≤ S.card := by |
| 169 | + let B := (Finset.univ : Finset (ZMod 3 × ZMod 3)) |
| 170 | + have hB : classCount (ZMod 3) B = 9 := by |
| 171 | + rw [classCount_eq_card_of_injective (ZMod 3) B Subtype.val |
| 172 | + (fun _ _ _ _ h => h) Subtype.val_injective] |
| 173 | + simp [B, Fintype.card_prod, ZMod.card] |
| 174 | + obtain ⟨S, hSB, hS, hcard⟩ := |
| 175 | + exists_sidon_subset_of_classCount (F := ZMod 3) (by decide) B 4 (by omega) |
| 176 | + refine ⟨S, hSB, hS, ?_⟩ |
| 177 | + norm_num [ZMod.card, Nat.choose] at hcard |
| 178 | + omega |
| 179 | + |
| 117 | 180 | end ErdosSwarm.Erdos530SymbolSpace |