Rel Close To Code iff rel Close To Codeword of min Dist
Code.relCloseToCode_iff_relCloseToCodeword_of_minDist
Plain-language statement
Relative distance version of closeToCode_iff_closeToCodeword_of_minDist. If the distance to a code is at most δ, then there exists a codeword within distance δ. NOTE: can we make this shorter using relDistFromCode_eq_distFromCode_div?
Exact Lean statement
lemma relCloseToCode_iff_relCloseToCodeword_of_minDist [Nonempty ι] [DecidableEq F]
{C : Set (ι → F)} (u : ι → F) (δ : ℝ≥0) :
δᵣ(u, C) ≤ δ ↔ ∃ v ∈ C, δᵣ(u, v) ≤ δFormal artifact
Lean source
lemma relCloseToCode_iff_relCloseToCodeword_of_minDist [Nonempty ι] [DecidableEq F] {C : Set (ι → F)} (u : ι → F) (δ : ℝ≥0) : δᵣ(u, C) ≤ δ ↔ ∃ v ∈ C, δᵣ(u, v) ≤ δ := by constructor · -- Direction 1: (→) -- Assume: δᵣ(u, C) ≤ ↑δ -- Goal: ∃ v ∈ C, δᵣ(u, v) ≤ δ intro h_dist_le_e -- We need to handle two cases: the code C being empty or non-empty. by_cases hC_empty : C = ∅ · -- Case 1: C is empty -- The goal is `∃ v ∈ ∅, ...`, which is `False`. -- We must show the assumption `h_dist_le_e` is also `False`. rw [hC_empty] at h_dist_le_e rw [relDistFromCode_of_empty] at h_dist_le_e -- h_dist_le_e is now `⊤ ≤ ↑e`. -- Since `e : ℕ`, `↑e` is finite (i.e., `↑e ≠ ⊤`). have h_e_ne_top : (δ : ENNReal) ≠ ⊤ := ENNReal.coe_ne_top (r := δ) -- `⊤ ≤ ↑e` is only true if `↑e = ⊤`, so this is a contradiction. simp only [top_le_iff, ENNReal.coe_ne_top] at h_dist_le_e · -- Case 2: C is non-empty have hC_nonempty : Set.Nonempty C := Set.nonempty_iff_ne_empty.mpr hC_empty have hC_nonempty_instance : Nonempty C := Set.Nonempty.to_subtype hC_nonempty let v := pickRelClosestCodeword_of_Nonempty_Code C u use v; constructor · simp only [Subtype.coe_prop] · rw [relDistFromPickRelClosestCodeword_of_Nonempty_Code] at h_dist_le_e rw [←ENNReal.coe_le_coe] exact h_dist_le_e · -- Direction 2: (←) -- Assume: `∃ v ∈ C, δᵣ(u, v) ≤ e` -- Goal: `δᵣ(u, C) ≤ ↑e` intro h_exists -- Unpack the assumption rcases h_exists with ⟨v, hv_mem, h_dist_le_e⟩ -- Goal is `sInf {d | ∃ w ∈ C, ↑(δᵣ(u, w)) ≤ d} ≤ ↑e` -- We can use the lemma `ENat.sInf_le` (or `sInf_le` for complete linear orders) -- which says `sInf S ≤ x` if `x ∈ S`. have h_sInf_le: δᵣ(u, C) ≤ δᵣ(u, v) := by apply sInf_le simp only [Set.mem_setOf_eq] use v calc δᵣ(u, C) ≤ δᵣ(u, v) := h_sInf_le _ ≤ δ := by exact ENNReal.coe_le_coe.mpr h_dist_le_e- Project
- ArkLib
- License
- Apache-2.0
- Commit
- fad5cbf80877
- Source
- ArkLib/Data/CodingTheory/Basic/RelativeDistance.lean:263-306
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Affine gaps lifted to interleaved codes
affine_gaps_lifted_to_interleaved_codes
Project documentation
This lemma proves the final algebraic step in the DG25 Theorem 3.1 proof. It shows that if R > e + 1, then e * (R / (R - 1)) < e + 1. The intuition is that the fraction R / (R - 1) is always greater than 1, but as R gets larger, it gets closer to 1. The hypothesis R > e + 1 provides a strong enough bound to ensure the product e * (fraction) do...
Source project: ArkLib
Person-level attribution pending.
Gadget Decompose coeff
ArkLib.Lattices.Ajtai.gadgetDecompose_coeff
Plain-language statement
The k-th coefficient (k < deg φ) of a gadget-decomposition block is exactly the corresponding digit of the corresponding input coefficient.
Source project: ArkLib
Person-level attribution pending.
Gadget Decompose lawful
ArkLib.Lattices.Ajtai.gadgetDecompose_lawful
Plain-language statement
The base-b gadget decomposition is a lawful gadget decomposition.
Source project: ArkLib
Person-level attribution pending.