Documentation

CslibFrontier.Foundations.Data.Code.ProximityGap.Curve.Internal

Shared Internal Helpers for Parameterized-Curve Proximity Gaps #

Algebraic, counting, and Hamming-distance helpers shared by at least two submodules under CslibFrontier.Foundations.Data.Code.ProximityGap.Curve (imported privately so downstream clients of the umbrella Curve module do not see these internal lemmas).

Main results #

theorem Cslib.Code.line_sum_fin2 {F : Type u_1} {ι : Type u_2} [Field F] (u₀ u₁ : ι → F) (z : F) :
∑ j : Fin 2, z ^ ↑j • ![u₀, u₁] j = u₀ + z • u₁
theorem Cslib.Code.subset_filter_affine_eq {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {ℓ : ℕ} {D' : Finset ι} {u₀ v₀ : ι → F} {u v : Fin ℓ → ι → F} (hagree : ∀ i ∈ D', u₀ i = v₀ i ∧ ∀ (j : Fin ℓ), u j i = v j i) (z : Fin ℓ → F) :
D' ⊆ {i : ι | (u₀ + ∑ j : Fin ℓ, z j • u j) i = (v₀ + ∑ j : Fin ℓ, z j • v j) i}
theorem Cslib.Code.subset_filter_line_eq {F : Type u_1} {ι : Type u_2} [Field F] [Fintype ι] [DecidableEq F] {D' : Finset ι} {u₀ v₀ u₁ v₁ : ι → F} (hagree : ∀ i ∈ D', u₀ i = v₀ i ∧ u₁ i = v₁ i) (z : F) :
D' ⊆ {i : ι | (u₀ + z • u₁) i = (v₀ + z • v₁) i}
theorem Cslib.Code.hammingDist_le_of_card_filter_eq {F : Type u_1} {ι : Type u_2} [Fintype ι] [DecidableEq F] {e : ℕ} {x y : ι → F} (hcard : Fintype.card ι - e ≤ {i : ι | x i = y i}.card) :
theorem Cslib.Code.card_filter_eq_of_hammingDist_le {F : Type u_1} {ι : Type u_2} [Fintype ι] [DecidableEq F] {e : ℕ} {x y : ι → F} (hdist : hammingDist x y ≤ e) :
Fintype.card ι - e ≤ {i : ι | x i = y i}.card
theorem Cslib.Code.hammingDist_le_of_ratWeightedAgree_ge {F : Type u_1} {ι : Type u_2} [Fintype ι] [DecidableEq F] {e : ℕ} {μ : ι → ℚ} (hμ_le : ∀ (i : ι), μ i ≤ 1) {θ : ℚ} (hθ : ↑(Fintype.card ι - e) - 1 < θ) {x c : ι → F} (hμ_ge : θ ≤ ∑ i : ι with x i = c i, μ i) :

Pointwise conversion from signed ℚ-weighted agreement (∀ i, μ i ≤ 1) above ((|ι| - e : ℕ) : ℚ) - 1 to unweighted Hamming distance at most e.

theorem Cslib.Code.nat_le_sum_iff_div {ι : Type u_1} {W : ι → ℕ} {M B : ℕ} (hM : 0 < M) (S : Finset ι) :
B ≤ ∑ i ∈ S, W i ↔ ↑B / ↑M ≤ ∑ i ∈ S, ↑(W i) / ↑M
theorem Cslib.Code.card_filter_coord_eq_zero {F : Type u_1} [Zero F] [Fintype F] [DecidableEq F] {ℓ : ℕ} (j₀ : Fin ℓ) :
{z : Fin ℓ → F | z j₀ = 0}.card = Fintype.card F ^ (ℓ - 1)

Counting lemma: in Fin ℓ → F with 1 ≤ ℓ, the hyperplane {z | z j₀ = 0} has cardinality |F| ^ (ℓ - 1).

theorem Cslib.Code.card_sub_sub_ceilDiv_sub_one_lt {n B M : ℕ} (hM : 0 < M) :
↑(n - (n - (B + M - 1) / M)) - 1 < ↑B / ↑M

Integer-to-rational weight threshold: with t = ⌈B / M⌉ = (B + M - 1) / M, the unique-decoding agreement count n - (n - t) satisfies n - (n - t) - 1 < B / M.

theorem Cslib.Code.curve_dichotomy_of_ca {F : Type u_1} {ι : Type u_2} [Field F] [Fintype F] {d : ℕ} {C : Submodule F (ι → F)} {u : Fin (d + 1) → ι → F} (Close : (ι → F) → (ι → F) → Prop) (Good : Finset ι → Prop) {B : ℕ} (hgood : ∀ {D' : Finset ι}, Good D' → ∀ {v : Fin (d + 1) → ι → F}, (∀ i ∈ D', ∀ (j : Fin (d + 1)), u j i = v j i) → ∀ (z : F), Close (∑ j : Fin (d + 1), z ^ ↑j • u j) (∑ j : Fin (d + 1), z ^ ↑j • v j)) [DecidablePred fun (z : F) => ∃ c ∈ C, Close (∑ j : Fin (d + 1), z ^ ↑j • u j) c] (hca : ∀ (S : Finset F), B < S.card → (∀ z ∈ S, ∃ c ∈ C, Close (∑ j : Fin (d + 1), z ^ ↑j • u j) c) → ∃ (D' : Finset ι), Good D' ∧ ∃ (v : Fin (d + 1) → ι → F), (∀ (j : Fin (d + 1)), v j ∈ C) ∧ ∀ i ∈ D', ∀ (j : Fin (d + 1)), u j i = v j i) :
(∀ (z : F), ∃ c ∈ C, Close (∑ j : Fin (d + 1), z ^ ↑j • u j) c) ∨ {z : F | ∃ c ∈ C, Close (∑ j : Fin (d + 1), z ^ ↑j • u j) c}.card ≤ B
theorem Cslib.Code.lt_card_field_of_density_threshold {F : Type u_1} [Fintype F] {K ℓ : ℕ} {T : Finset (Fin ℓ → F)} (hT : K * Fintype.card F ^ ℓ < Fintype.card F * T.card) :

Internal helper: the exact affine density threshold K * |F| ^ ℓ < |F| * #T for T ⊆ (Fin ℓ → F) forces K < |F|.