Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definition 3.1 in Mathlib terms — dist⁡p(tx,Λ)\operatorname{dist}_p(t_x,\Lambda)distp​(tx​,Λ) is Mathlib's infimum distance in ℓpM\ell_p^MℓpM​

Proved
LatticePrepro.LatticeFamily.latticeDist_eq_infDist

by WizardOfMenlo · Nov 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

coding-theorycvp-ncp-preprocessinghardness-of-approximationlatticespreprocessing

Let (Λ,(tx)x∈X)(\Lambda,(t_x)_{x\in X})(Λ,(tx​)x∈X​) be a lattice family with Λ⊆ZM\Lambda\subseteq\mathbb Z^MΛ⊆ZM, let ppp be a norm exponent (a real p≥1p\ge1p≥1 or p=∞p=\inftyp=∞), and let xxx be an instance. Write ℓpM\ell_p^MℓpM​ for RM\mathbb R^MRM with the ℓp\ell_pℓp​ norm, as Mathlib's PiLp p (fun _ : M => ℝ), and ΛR⊆RM\Lambda_{\mathbb R}\subseteq\mathbb R^MΛR​⊆RM for the image of Λ\LambdaΛ under the cast ZM→RM\mathbb Z^M\to\mathbb R^MZM→RM. Then

dist⁡p(tx,Λ)=infDist⁡ℓpM(tx,ΛR)=inf⁡u∈ΛR∥tx−u∥ℓpM.\operatorname{dist}_p(t_x,\Lambda)=\operatorname{infDist}_{\ell_p^M}\bigl(t_x,\Lambda_{\mathbb R}\bigr)=\inf_{u\in\Lambda_{\mathbb R}}\|t_x-u\|_{\ell_p^M}.distp​(tx​,Λ)=infDistℓpM​​(tx​,ΛR​)=u∈ΛR​inf​∥tx​−u∥ℓpM​​.

The left side is the project's lattice distance (latticeDist, the infimum of ∥tx−v∥p\|t_x-v\|_p∥tx​−v∥p​ over v∈Λv\in\Lambdav∈Λ, computed with the project's own ℓp\ell_pℓp​ norm (∑i∣vi∣p)1/p\bigl(\sum_i|v_i|^p\bigr)^{1/p}(∑i​∣vi​∣p)1/p or sup⁡i∣vi∣\sup_i|v_i|supi​∣vi​∣). The right side is Mathlib's Metric.infDist from the point txt_xtx​ to the set ΛR\Lambda_{\mathbb R}ΛR​, both viewed in the normed space ℓpM\ell_p^MℓpM​.

This certifies that the distance in the final lattice theorems (Theorem 5.1) and in the search test (Lemma 5.2) is the standard distance of Definition 3.1, dist⁡p(t,L)=min⁡v∈L∥t−v∥p\operatorname{dist}_p(t,\mathcal L)=\min_{v\in\mathcal L}\|t-v\|_pdistp​(t,L)=minv∈L​∥t−v∥p​, expressed with Mathlib's infimum distance in the ℓp\ell_pℓp​ space.

Formalization Note. The exponent enters Mathlib through PNorm.toENNReal (p↦pp\mapsto pp↦p, ∞↦⊤\infty\mapsto\top∞↦⊤), and vectors are moved into PiLp with WithLp.toLp. ΛR\Lambda_{\mathbb R}ΛR​ is LatticeFamily.realLattice, and the target is cast with LatticeFamily.toReal.

Preamble
import Mathlib
import Definitions.Def_LatticePrepro_Basic_Blocks
import Definitions.Def_LatticePrepro_Reduction_LinearSystem
import Definitions.Def_LatticePrepro_Conversions_Codes
import Definitions.Def_LatticePrepro_Conversions_ConstructionA
import Definitions.Def_LatticePrepro_Conversions_Hadamard
import Definitions.Def_LatticePrepro_Conversions_Lattices
import Definitions.Def_LatticePrepro_Lattices_Distance
import Definitions.Def_LatticePrepro_Lattices_Mathlib

open LatticePrepro
open scoped ENNReal
open WithLp
open LatticePrepro.LatticeFamily
variable {X : Type} (Λ : LatticeFamily X)
Formal statement
theorem LatticePrepro.LatticeFamily.latticeDist_eq_infDist (pn : PNorm) (x : X) :
    Λ.latticeDist pn x =
      Metric.infDist (toLp pn.toENNReal (toReal (Λ.target x)) : PiLp pn.toENNReal fun _ => ℝ)
        (toLp pn.toENNReal '' (Λ.realLattice : Set (Λ.M → ℝ))) := by sorry
Source
G. Fenzi, G. Weissenberg, Nearly Optimal Hardness for CVP and NCP with Preprocessing (STOC 2027 submission #847; IACR ePrint 2026/2634, https://eprint.iacr.org/2026/2634), Definition 3.1 (\label{def:code-lattice-distances}); Lean: LatticePrepro/Lattices/Mathlib.lean, LatticePrepro.LatticeFamily.latticeDist_eq_infDist
Human review
  • Endorsed by Shuze Chen · Nov 15, 2026

    Confirmed by the moderator at approval.

  • Endorsed by WizardOfMenlo · Nov 15, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me