|
| 1 | +/- |
| 2 | +Copyright (c) 2026 ArkLib Contributors. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: ArkLib Contributors |
| 5 | +-/ |
| 6 | +import ArkLib.Data.CodingTheory.ProximityGap.CS25SecondMomentUpper |
| 7 | +import ArkLib.Data.CodingTheory.ProximityGap.CS25SecondMomentHighDist |
| 8 | + |
| 9 | +/-! |
| 10 | +# CS25 covered fraction for general linear codes (#82) |
| 11 | +
|
| 12 | +Combining the CS25 Paley-Zygmund inequality `(|𝒞|·V)² ≤ |close|·E[N²]` with the general |
| 13 | +second-moment upper bound `E[N²] ≤ |𝒞|·|near|·V` (`sum_closeCount_sq_le`, `ballInterCount_zero_eq`) |
| 14 | +yields the **covered-fraction lower bound for any linear code** |
| 15 | +
|
| 16 | + `|𝒞| · |B(0,r)| ≤ |{w : Δ₀(w,𝒞) ≤ r}| · |{v∈𝒞 : Δ₀(0,v) ≤ 2r}|`, |
| 17 | +
|
| 18 | +i.e. `|close| ≥ |𝒞|·V / |near|`. In the high-distance regime `|near| = 1` and this recovers the |
| 19 | +exact bound `|close| ≥ |𝒞|·V`; in general the near-codeword count `|near| = ∑_{d≤2r} A_d` (bounded by |
| 20 | +the MDS weight enumerator `card_evalWeight_le`) controls the variance loss in the CS25 `ε_ca` |
| 21 | +covered-fraction argument. |
| 22 | +-/ |
| 23 | + |
| 24 | +namespace ArkLib.CS25 |
| 25 | + |
| 26 | +open scoped BigOperators |
| 27 | + |
| 28 | +variable {ι : Type*} [Fintype ι] [DecidableEq ι] |
| 29 | +variable {F : Type*} [Fintype F] [DecidableEq F] [AddCommGroup F] |
| 30 | + |
| 31 | +/-- **Covered fraction × near-codeword count (general linear code).** `|𝒞|·V ≤ |close|·|near|`, |
| 32 | +where `V = |B(0,r)|`, `close = {w : Δ₀(w,𝒞) ≤ r}`, `near = {v∈𝒞 : Δ₀(0,v) ≤ 2r}` (provided |
| 33 | +`|𝒞|·V > 0`). Paley-Zygmund combined with the general second-moment upper bound. -/ |
| 34 | +theorem card_close_mul_near_ge (𝒞 : Finset (ι → F)) (r : ℕ) |
| 35 | + (hsub : ∀ a ∈ 𝒞, ∀ b ∈ 𝒞, a - b ∈ 𝒞) |
| 36 | + (hadd : ∀ a ∈ 𝒞, ∀ b ∈ 𝒞, a + b ∈ 𝒞) |
| 37 | + (hpos : 0 < 𝒞.card * (Finset.univ.filter (fun w : ι → F => hammingDist w 0 ≤ r)).card) : |
| 38 | + 𝒞.card * (Finset.univ.filter (fun w : ι → F => hammingDist w 0 ≤ r)).card |
| 39 | + ≤ (Finset.univ.filter (fun w : ι → F => closeCount 𝒞 r w ≠ 0)).card |
| 40 | + * (𝒞.filter (fun v => hammingDist (0 : ι → F) v ≤ 2 * r)).card := by |
| 41 | + have hpz := sq_card_mul_volume_le_card_close_mul_sum_sq 𝒞 r |
| 42 | + have hub := sum_closeCount_sq_le 𝒞 r hsub hadd |
| 43 | + set V := (Finset.univ.filter (fun w : ι → F => hammingDist w 0 ≤ r)).card with hV |
| 44 | + set C := (Finset.univ.filter (fun w : ι → F => closeCount 𝒞 r w ≠ 0)).card with hC |
| 45 | + set N := (𝒞.filter (fun v => hammingDist (0 : ι → F) v ≤ 2 * r)).card with hN |
| 46 | + have key : (𝒞.card * V) ^ 2 ≤ (C * N) * (𝒞.card * V) := by |
| 47 | + calc (𝒞.card * V) ^ 2 ≤ C * (∑ w : ι → F, (closeCount 𝒞 r w) ^ 2) := hpz |
| 48 | + _ ≤ C * (𝒞.card * (N * ballInterCount r (0 : ι → F))) := |
| 49 | + Nat.mul_le_mul (Nat.le_refl C) hub |
| 50 | + _ = C * (𝒞.card * (N * V)) := by rw [ballInterCount_zero_eq] |
| 51 | + _ = (C * N) * (𝒞.card * V) := by ring |
| 52 | + rw [sq] at key |
| 53 | + exact Nat.le_of_mul_le_mul_right key hpos |
| 54 | + |
| 55 | +end ArkLib.CS25 |
| 56 | + |
| 57 | +-- Axiom audit. |
| 58 | +#print axioms ArkLib.CS25.card_close_mul_near_ge |
0 commit comments