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 #
Cslib.Code.line_sum_fin2: expands a degree-1 curve asu₀ + z • u₁.Cslib.Code.hammingDist_le_of_ratWeightedAgree_ge: links weighted agreement to Hamming distance.Cslib.Code.curve_dichotomy_of_ca: converts correlated agreement into a curve dichotomy.Cslib.Code.lt_card_field_of_density_threshold: extracts the field-size lower bound from a strict affine density hypothesis.
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) :
hammingDist x y ≤ e
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) :
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) :
hammingDist x c ≤ e
Pointwise conversion from signed ℚ-weighted agreement (∀ i, μ i ≤ 1) above
((|ι| - e : ℕ) : ℚ) - 1 to unweighted Hamming distance at most e.
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) :
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) :
K < Fintype.card F
Internal helper: the exact affine density threshold K * |F| ^ ℓ < |F| * #T for
T ⊆ (Fin ℓ → F) forces K < |F|.