Documentation

CslibFrontier.Foundations.Data.Code.ProximityGap.Curve.JohnsonHelpers

Internal Helpers for Johnson-Bound Curve and Affine Proximity Gaps #

Siegel error-bound substitution, johnsonCurveBound scaling, and rational-to-integer weight clearing helpers shared privately by at least two submodules (JohnsonCurve, JohnsonAffine, and Dichotomy).

Main results #

theorem Cslib.Code.johnsonCurveBound_mul_cast_le {n m d D r M : ℕ} (hn : 1 ≤ n) (hM : 0 < M) {U : ℝ} (hU : ↑(ProximityGap.johnsonCurveBound n m d D r n) ≤ U) :
↑(ProximityGap.johnsonCurveBound n m d D r (M * n)) ≤ ↑M * U

Internal helper: linear weight scaling of johnsonCurveBound over ℝ.

theorem Cslib.Code.sum_le_mul_card_of_le {ι : Type u_1} [Fintype ι] {W : ι → ℕ} {M : ℕ} (hW : ∀ (i : ι), W i ≤ M) (S : Finset ι) :
∑ i ∈ S, W i ≤ M * Fintype.card ι

Internal helper: integer weights bounded by M sum to at most M * |ι| over any subset.

theorem Cslib.Code.rat_weights_to_nat {ι : Type u_1} [Fintype ι] {M : ℕ} (hM : 0 < M) {μ : ι → ℚ} (hμ_le : ∀ (i : ι), μ i ≤ 1) (hμ_den : ∀ (i : ι), ∃ (a : ℕ), μ i = ↑a / ↑M) (θ : ℚ) :
∃ (W : ι → ℕ), (∀ (i : ι), 0 ≤ μ i) ∧ (∀ (i : ι), W i ≤ M) ∧ ∑ i : ι, W i ≤ M * Fintype.card ι ∧ (∀ (S : Finset ι), θ ≤ ∑ i ∈ S, μ i ↔ ⌈θ * ↑M⌉₊ ≤ ∑ i ∈ S, W i) ∧ θ ≤ ↑((⌈θ * ↑M⌉₊ + M - 1) / M)

Internal helper: clears common denominator M > 0 from rational weights μ : ι → ℚ with μ i = a_i / M ≤ 1, producing integer weights W : ι → ℕ and threshold B_W = ⌈θ * M⌉₊ with exact subset equivalence θ ≤ ∑_{i ∈ S} μ i ↔ B_W ≤ ∑_{i ∈ S} W i and θ ≤ (B_W + M - 1) / M.

theorem Cslib.Code.siegel_eta_bound_le {n k m q : ℕ} {c η : ℝ} (hk : 1 ≤ k) (hkn : k ≤ n) (hq : 0 < q) (hc : 0 ≤ c) (hη : 0 < η) (hpow : (↑m + 1) ^ 6 ≤ 64 / η ^ 6) :
1800 * c * (↑m + 1) ^ 6 * ↑n ^ 2 / (↑k / ↑n * ↑q) ≤ 115200 * c * ↑n ^ 2 / (↑k / ↑n * η ^ 6 * ↑q)

Internal helper: substitutes (m + 1) ^ 6 ≤ 64 / η ^ 6 into the explicit Siegel error bound 1800 * c * (m + 1) ^ 6 * n ^ 2 / (ρ * q) (1800 * 64 = 115200).

theorem Cslib.Code.rat_weights_johnson_nat {ι : Type u_1} [Fintype ι] {k m D M : ℕ} (hM : 0 < M) {μ : ι → ℚ} (hμ_le : ∀ (i : ι), μ i ≤ 1) (hμ_den : ∀ (i : ι), ∃ (a : ℕ), μ i = ↑a / ↑M) {θ : ℚ} (hk_le : ↑k ≤ θ) (hroot : ↑D < ↑m * θ) :
∃ (W : ι → ℕ), (∀ (i : ι), W i ≤ M) ∧ ∑ i : ι, W i ≤ M * Fintype.card ι ∧ k ≤ (⌈θ * ↑M⌉₊ + M - 1) / M ∧ D < m * ((⌈θ * ↑M⌉₊ + M - 1) / M) ∧ ∀ (S : Finset ι), θ ≤ ∑ i ∈ S, μ i ↔ ⌈θ * ↑M⌉₊ ≤ ∑ i ∈ S, W i
theorem Cslib.Code.ceilDiv_radius_le {n M : ℕ} {θ : ℚ} {R : ℝ} (hM : 0 < M) (hn : 1 ≤ n) (hθ_le_t : θ ≤ ↑((⌈θ * ↑M⌉₊ + M - 1) / M)) (hθ_le_n : ↑θ ≤ ↑n) (hθ : 1 - ↑θ / ↑n ≤ R) :
↑(n - (⌈θ * ↑M⌉₊ + M - 1) / M) / ↑n ≤ R

Internal helper: a threshold θ ≤ n converted to integer weights with denominator M (B_W = ⌈θ * M⌉₊, t = ⌈B_W / M⌉) gives a relative radius (n - t) / n no larger than any bound R on 1 - θ / n.

theorem Cslib.Code.sum_le_card_of_le_one {ι : Type u_1} [Fintype ι] {μ : ι → ℚ} (hμ_le : ∀ (i : ι), μ i ≤ 1) (S : Finset ι) :
∑ i ∈ S, μ i ≤ ↑(Fintype.card ι)

Internal helper: weights bounded by 1 sum to at most |ι| over any finite subset.