| | @@ -0,0 +1,213 @@ |
| 1 | +import ErdosSwarm.Erdos530Monochromatic |
| 2 | +import ErdosSwarm.Erdos530Projection |
| 3 | +import Mathlib.LinearAlgebra.AffineSpace.AffineSubspace.Basic |
| 4 | + |
| 5 | +/-! |
| 6 | +# Conditional collisions under a uniform linear projection for Erdős problem 530 |
| 7 | + |
| 8 | +For maps vanishing on a subspace, evaluation at a vector outside it is uniform in the target. |
| 9 | +This extends the pair count in Proposition 7.2 of the October 2026 sidon-palomar report. |
| 10 | +For a target plane over a field of order `p`, a collinear triple collides with probability |
| 11 | +`1 / p²` and a noncollinear triple with probability `1 / p⁴`. A point outside the affine span |
| 12 | +of a colliding set joins its fibre with conditional probability `1 / p²`. |
| 13 | + |
| 14 | +These counts give the individual terms in equations (3) and (4) of |
| 15 | +`experiments/erdos530/lower-middle-energy2/box-occupancy/NOTES.md`. The sums of moments and |
| 16 | +the resulting Sidon bounds are proved on paper there. |
| 17 | +-/ |
| 18 | + |
| 19 | +namespace ErdosSwarm.Erdos530ConditionalProjection |
| 20 | + |
| 21 | +open Finset Erdos530Monochromatic |
| 22 | +open scoped Classical |
| 23 | + |
| 24 | +variable {F V W : Type*} [Field F] [AddCommGroup V] [Module F V] |
| 25 | + [AddCommGroup W] [Module F W] [DecidableEq W] [Fintype W] [Fintype (V →ₗ[F] W)] |
| 26 | + |
| 27 | +/-- Evaluation at a vector outside `S` is uniform among maps killing `S`. -/ |
| 28 | +theorem card_eval_of_notMem (S : Submodule F V) {v : V} (hv : v ∉ S) (w : W) |
| 29 | + [DecidablePred fun L : V →ₗ[F] W => S ≤ L.ker] : |
| 30 | + Fintype.card W * (univ.filter fun L : V →ₗ[F] W => S ≤ L.ker ∧ L v = w).card = |
| 31 | + (univ.filter fun L : V →ₗ[F] W => S ≤ L.ker).card := by |
| 32 | + let K := univ.filter fun L : V →ₗ[F] W => S ≤ L.ker |
| 33 | + have hv' : S.mkQ v ≠ 0 := fun h => hv ((Submodule.Quotient.mk_eq_zero S).mp h) |
| 34 | + obtain ⟨φ, hφ⟩ := Module.Projective.exists_dual_eq_one F hv' |
| 35 | + -- A functional on V/S with value one at v supplies translations between any two fibres. |
| 36 | + let shift (u : W) := (φ.comp S.mkQ).smulRight u |
| 37 | + have hkill (u : W) {x : V} (hx : x ∈ S) : shift u x = 0 := by |
| 38 | + change φ (S.mkQ x) • u = 0 |
| 39 | + rw [show S.mkQ x = 0 from (Submodule.Quotient.mk_eq_zero S).mpr hx, map_zero, zero_smul] |
| 40 | + have heval (u : W) : shift u v = u := by |
| 41 | + change φ (S.mkQ v) • u = u |
| 42 | + rw [hφ, one_smul] |
| 43 | + have hle (u u' : W) : |
| 44 | + (K.filter fun L => L v = u).card ≤ (K.filter fun L => L v = u').card := by |
| 45 | + apply card_le_card_of_injOn (fun L => L + shift (u' - u)) |
| 46 | + · intro L hL |
| 47 | + obtain ⟨hK, hLv⟩ := mem_filter.mp hL |
| 48 | + have hker : S ≤ L.ker := (mem_filter.mp hK).2 |
| 49 | + refine mem_filter.mpr ⟨mem_filter.mpr ⟨mem_univ _, ?_⟩, ?_⟩ |
| 50 | + · intro x hx |
| 51 | + change L x + shift (u' - u) x = 0 |
| 52 | + rw [show L x = 0 from hker hx, hkill _ hx, add_zero] |
| 53 | + · change L v + shift (u' - u) v = u' |
| 54 | + rw [hLv, heval, add_sub_cancel] |
| 55 | + · exact fun _ _ _ _ h => add_right_cancel h |
| 56 | + calc |
| 57 | + _ = ∑ _ : W, (K.filter fun L => L v = w).card := by simp [K, filter_filter] |
| 58 | + _ = ∑ u : W, (K.filter fun L => L v = u).card := |
| 59 | + sum_congr rfl fun u _ => le_antisymm (hle w u) (hle u w) |
| 60 | + _ = K.card := (card_eq_sum_card_fiberwise (fun L _ => mem_univ (L v))).symm |
| 61 | + |
| 62 | +omit [Fintype W] in |
| 63 | +/-- Inside `S`, imposing the value zero leaves every map killing `S`. -/ |
| 64 | +theorem filter_eval_of_mem (S : Submodule F V) {v : V} (hv : v ∈ S) |
| 65 | + [DecidablePred fun L : V →ₗ[F] W => S ≤ L.ker] : |
| 66 | + (univ.filter fun L : V →ₗ[F] W => S ≤ L.ker ∧ L v = 0) = |
| 67 | + (univ.filter fun L : V →ₗ[F] W => S ≤ L.ker) := by |
| 68 | + exact filter_congr fun L _ => ⟨And.left, fun h => ⟨h, h hv⟩⟩ |
| 69 | + |
| 70 | +omit [DecidableEq W] [Fintype W] [Fintype (V →ₗ[F] W)] in |
| 71 | +private theorem map_sub_eq_zero_iff (L : V →ₗ[F] W) (a b : V) : |
| 72 | + L (b - a) = 0 ↔ L a = L b := by rw [map_sub, sub_eq_zero, eq_comm] |
| 73 | + |
| 74 | +/-- The count of pair collisions is the unconditioned evaluation count. -/ |
| 75 | +theorem card_pair_collision {a b : V} (hab : a ≠ b) : |
| 76 | + Fintype.card W * (univ.filter fun L : V →ₗ[F] W => L a = L b).card = |
| 77 | + Fintype.card (V →ₗ[F] W) := by |
| 78 | + have hv : b - a ∉ (⊥ : Submodule F V) := by simpa using sub_ne_zero.mpr hab.symm |
| 79 | + simpa only [bot_le, true_and, map_sub_eq_zero_iff, filter_true, card_univ] using |
| 80 | + (card_eval_of_notMem (⊥ : Submodule F V) hv (0 : W)) |
| 81 | + |
| 82 | +/-- A triple on the line through two distinct points collides as often as those two points. -/ |
| 83 | +theorem card_triple_collision_of_mem {a b c : V} (hab : a ≠ b) |
| 84 | + (hc : c - a ∈ Submodule.span F {b - a}) : |
| 85 | + Fintype.card W * |
| 86 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c).card = |
| 87 | + Fintype.card (V →ₗ[F] W) := by |
| 88 | + have h := filter_eval_of_mem (W := W) _ hc |
| 89 | + simp only [Submodule.span_singleton_le_iff_mem, LinearMap.mem_ker, map_sub_eq_zero_iff] at h |
| 90 | + rw [h, card_pair_collision hab] |
| 91 | + |
| 92 | +/-- An off-line third point costs a second factor of the target cardinality. -/ |
| 93 | +theorem card_triple_collision_of_notMem {a b c : V} (hab : a ≠ b) |
| 94 | + (hc : c - a ∉ Submodule.span F {b - a}) : |
| 95 | + Fintype.card W ^ 2 * |
| 96 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c).card = |
| 97 | + Fintype.card (V →ₗ[F] W) := by |
| 98 | + have h := card_eval_of_notMem _ hc (0 : W) |
| 99 | + simp only [Submodule.span_singleton_le_iff_mem, LinearMap.mem_ker, map_sub_eq_zero_iff] at h |
| 100 | + rw [sq, Nat.mul_assoc, h, card_pair_collision hab] |
| 101 | + |
| 102 | +omit [DecidableEq W] [Fintype W] [Fintype (V →ₗ[F] W)] in |
| 103 | +private theorem triple_span_le_ker (L : V →ₗ[F] W) (a b c : V) : |
| 104 | + Submodule.span F {b - a, c - a} ≤ L.ker ↔ L a = L b ∧ L a = L c := by |
| 105 | + simp only [Submodule.span_le, Set.insert_subset_iff, Set.singleton_subset_iff, SetLike.mem_coe, |
| 106 | + LinearMap.mem_ker, map_sub_eq_zero_iff] |
| 107 | + |
| 108 | +omit [Fintype W] in |
| 109 | +/-- Given a triple collision, every point in its affine span has the same image. -/ |
| 110 | +theorem filter_fourth_point_of_mem {a b c d : V} |
| 111 | + (hd : d - a ∈ Submodule.span F {b - a, c - a}) : |
| 112 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c ∧ L a = L d) = |
| 113 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c) := by |
| 114 | + simpa only [triple_span_le_ker, map_sub_eq_zero_iff, and_assoc] using |
| 115 | + (filter_eval_of_mem (W := W) _ hd) |
| 116 | + |
| 117 | +/-- Given a triple collision, a fourth point outside its affine span joins the fibre with |
| 118 | +probability exactly `1 / Fintype.card W`, expressed as a count without division. -/ |
| 119 | +theorem card_fourth_point_of_notMem {a b c d : V} |
| 120 | + (hd : d - a ∉ Submodule.span F {b - a, c - a}) : |
| 121 | + Fintype.card W * |
| 122 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c ∧ L a = L d).card = |
| 123 | + (univ.filter fun L : V →ₗ[F] W => L a = L b ∧ L a = L c).card := by |
| 124 | + simpa only [triple_span_le_ker, map_sub_eq_zero_iff, and_assoc] using |
| 125 | + (card_eval_of_notMem _ hd (0 : W)) |
| 126 | + |
| 127 | +omit [Fintype W] [Fintype (V →ₗ[F] W)] in |
| 128 | +/-- A nonempty finite set has a single image exactly when the map kills its direction space. -/ |
| 129 | +theorem vectorSpan_le_ker_iff_card_image_eq_one {T : Finset V} (hT : T.Nonempty) |
| 130 | + (L : V →ₗ[F] W) : vectorSpan F (T : Set V) ≤ L.ker ↔ (T.image L).card = 1 := by |
| 131 | + obtain ⟨a, ha⟩ := hT |
| 132 | + rw [vectorSpan_eq_span_vsub_set_right F (show a ∈ (T : Set V) from ha), Submodule.span_le] |
| 133 | + change (fun x => x - a) '' (T : Set V) ⊆ L.ker ↔ _ |
| 134 | + rw [Set.image_subset_iff] |
| 135 | + constructor |
| 136 | + · intro h |
| 137 | + have hconst (x : V) (hx : x ∈ T) : L x = L a := |
| 138 | + sub_eq_zero.mp ((map_sub L x a).symm.trans (h hx)) |
| 139 | + rw [T.image_congr hconst, image_const ⟨a, ha⟩, card_singleton] |
| 140 | + · intro h x hx |
| 141 | + change L (x - a) = 0 |
| 142 | + rw [map_sub, sub_eq_zero] |
| 143 | + exact card_le_one_iff.mp h.le (mem_image_of_mem L hx) (mem_image_of_mem L ha) |
| 144 | + |
| 145 | +variable [DecidableEq V] |
| 146 | + |
| 147 | +omit [Fintype W] in |
| 148 | +/-- Inserting a point of the affine span keeps exactly the same monochromatic maps. -/ |
| 149 | +theorem filter_insert_collision_of_mem {T : Finset V} (hT : T.Nonempty) {x : V} |
| 150 | + (hx : x ∈ affineSpan F (T : Set V)) : |
| 151 | + (univ.filter fun L : V →ₗ[F] W => ((insert x T).image L).card = 1) = |
| 152 | + (univ.filter fun L : V →ₗ[F] W => (T.image L).card = 1) := by |
| 153 | + apply filter_congr |
| 154 | + intro L _ |
| 155 | + simp only [← vectorSpan_le_ker_iff_card_image_eq_one (insert_nonempty x T), |
| 156 | + ← vectorSpan_le_ker_iff_card_image_eq_one hT, ← direction_affineSpan, coe_insert, |
| 157 | + affineSpan_insert_eq_affineSpan F hx] |
| 158 | + |
| 159 | +/-- In the monochromatic-subset formulation, extending a nonempty collision to a point |
| 160 | +outside its affine span costs precisely one factor of the target cardinality. -/ |
| 161 | +theorem card_insert_collision_of_notMem {T : Finset V} (hT : T.Nonempty) {x : V} |
| 162 | + (hx : x ∉ affineSpan F (T : Set V)) : |
| 163 | + Fintype.card W * |
| 164 | + (univ.filter fun L : V →ₗ[F] W => ((insert x T).image L).card = 1).card = |
| 165 | + (univ.filter fun L : V →ₗ[F] W => (T.image L).card = 1).card := by |
| 166 | + obtain ⟨a, ha⟩ := hT |
| 167 | + have hv : x - a ∉ vectorSpan F (T : Set V) := by |
| 168 | + rw [← direction_affineSpan] |
| 169 | + exact fun h => hx ((AffineSubspace.vsub_right_mem_direction_iff_mem |
| 170 | + (mem_affineSpan F (show a ∈ (T : Set V) from ha)) x).mp h) |
| 171 | + have extend (L : V →ₗ[F] W) : |
| 172 | + (T.image L).card = 1 ∧ L x = L a ↔ ((insert x T).image L).card = 1 := by |
| 173 | + rw [image_insert] |
| 174 | + constructor |
| 175 | + · rintro ⟨h, heq⟩ |
| 176 | + rwa [heq, insert_eq_of_mem (mem_image_of_mem L ha)] |
| 177 | + · intro h |
| 178 | + have heq := card_le_one_iff.mp h.le (mem_insert_self _ _) |
| 179 | + (mem_insert_of_mem (mem_image_of_mem L ha)) |
| 180 | + rw [heq, insert_eq_of_mem (mem_image_of_mem L ha)] at h |
| 181 | + exact ⟨h, heq⟩ |
| 182 | + simpa only [vectorSpan_le_ker_iff_card_image_eq_one ⟨a, ha⟩, map_sub, sub_eq_zero, extend] |
| 183 | + using (card_eval_of_notMem _ hv (0 : W)) |
| 184 | + |
| 185 | +omit [Fintype W] [Fintype (V →ₗ[F] W)] in |
| 186 | +private theorem insert_mem_monoSubsets_iff (A T : Finset V) (hTA : T ⊆ A) {x : V} |
| 187 | + (hxA : x ∈ A) (hxT : x ∉ T) (L : V →ₗ[F] W) : |
| 188 | + insert x T ∈ monoSubsets A L (T.card + 1) ↔ ((insert x T).image L).card = 1 := by |
| 189 | + simp only [mem_monoSubsets, insert_subset_iff.mpr ⟨hxA, hTA⟩, card_insert_of_notMem hxT, |
| 190 | + true_and, eq_self] |
| 191 | + |
| 192 | +omit [Fintype W] in |
| 193 | +/-- A fresh point inside the affine span preserves the maps counted by the marked-subset |
| 194 | +identity, with the subset size increased by one. -/ |
| 195 | +theorem filter_mono_insert_of_mem (A T : Finset V) (hT : T.Nonempty) (hTA : T ⊆ A) {x : V} |
| 196 | + (hxA : x ∈ A) (hx : x ∈ affineSpan F (T : Set V)) (hxT : x ∉ T) : |
| 197 | + (univ.filter fun L : V →ₗ[F] W => insert x T ∈ monoSubsets A L (T.card + 1)) = |
| 198 | + (univ.filter fun L : V →ₗ[F] W => T ∈ monoSubsets A L T.card) := by |
| 199 | + simpa only [insert_mem_monoSubsets_iff A T hTA hxA hxT, mem_monoSubsets, hTA, |
| 200 | + eq_self, true_and] using (filter_insert_collision_of_mem (W := W) hT hx) |
| 201 | + |
| 202 | +/-- For a point outside the affine span, the marked-subset count drops by a factor of |
| 203 | +the target cardinality. -/ |
| 204 | +theorem card_mono_insert_of_notMem (A T : Finset V) (hT : T.Nonempty) (hTA : T ⊆ A) {x : V} |
| 205 | + (hxA : x ∈ A) (hx : x ∉ affineSpan F (T : Set V)) : |
| 206 | + Fintype.card W * |
| 207 | + (univ.filter fun L : V →ₗ[F] W => insert x T ∈ monoSubsets A L (T.card + 1)).card = |
| 208 | + (univ.filter fun L : V →ₗ[F] W => T ∈ monoSubsets A L T.card).card := by |
| 209 | + have hxT : x ∉ T := fun h => hx (mem_affineSpan F h) |
| 210 | + simpa only [insert_mem_monoSubsets_iff A T hTA hxA hxT, mem_monoSubsets, hTA, |
| 211 | + eq_self, true_and] using (card_insert_collision_of_notMem (W := W) hT hx) |
| 212 | + |
| 213 | +end ErdosSwarm.Erdos530ConditionalProjection |