Eq or eq of mod eq
ArkLib.Lattices.CyclotomicModulus.eq_or_eq_of_mod_eq
Plain-language statement
At most two packed indices share a residue class mod d/2k. Given a residue r with j ≡ r (mod d/2k = 2^{α-κ-1}), the index j : Fin (d/2^κ) is either the first-half witness (value r) or the second-half witness (value d/2k + r). Combined with packExp_mod_eq, this pins down exactly which (at most two) packed summands can contribute to a give...
Exact Lean statement
theorem eq_or_eq_of_mod_eq (α κ : ℕ) (hk : 2 * 2 ^ κ ∣ 2 ^ α) {r : ℕ}
(j : Fin (2 ^ α / 2 ^ κ)) (heq : (j : ℕ) % 2 ^ (α - κ - 1) = r) :
(j : ℕ) = r ∨ (j : ℕ) = 2 ^ (α - κ - 1) + rFormal artifact
Lean source
theorem eq_or_eq_of_mod_eq (α κ : ℕ) (hk : 2 * 2 ^ κ ∣ 2 ^ α) {r : ℕ} (j : Fin (2 ^ α / 2 ^ κ)) (heq : (j : ℕ) % 2 ^ (α - κ - 1) = r) : (j : ℕ) = r ∨ (j : ℕ) = 2 ^ (α - κ - 1) + r := by have hκ : κ + 1 ≤ α := succ_le_of_two_mul_two_pow_dvd hk have hN : 2 ^ α / 2 ^ κ = 2 * 2 ^ (α - κ - 1) := by have hfac : (2 : ℕ) ^ κ * (2 * 2 ^ (α - κ - 1)) = 2 ^ α := by rw [← Nat.mul_assoc, show (2 : ℕ) ^ κ * 2 = 2 ^ (κ + 1) from by rw [pow_succ], ← pow_add] congr 1; omega rw [← hfac, Nat.mul_div_cancel_left _ (by positivity : 0 < 2 ^ κ)] have hjlt : (j : ℕ) < 2 * 2 ^ (α - κ - 1) := hN ▸ j.isLt rcases lt_or_ge (j : ℕ) (2 ^ (α - κ - 1)) with hjl | hjg · left; rw [Nat.mod_eq_of_lt hjl] at heq; omega · right have hjm : (j : ℕ) % 2 ^ (α - κ - 1) = (j : ℕ) - 2 ^ (α - κ - 1) := by rw [Nat.mod_eq_sub_mod hjg, Nat.mod_eq_of_lt (by omega)] rw [hjm] at heq; omega- Project
- ArkLib
- License
- Apache-2.0
- Commit
- fad5cbf80877
- Source
- ArkLib/Data/Lattices/CyclotomicRing/Subfield/Packing.lean:107-122
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.