Module 01: Lattice Foundations & Geometry of Numbers

If vector spaces, modules, projections, or determinants feel rusty, start with Module 00: Algebra Prerequisites first!

1. The Bridge from Algebra & Elliptic Curves

In your algebra course, you worked extensively with vector spaces over a field (e.g., Rn\mathbb{R}^n or Fpn\mathbb{F}_p^n) and modules over a ring. In elliptic-curve cryptography (Plonk, IPA), you work inside a cyclic group G\mathbb{G} of prime order pp, which behaves algebraically like a 1-dimensional Fp\mathbb{F}_p-vector space (via the exponent map x↦xGx \mapsto xG).

A lattice is what happens when you replace the field scalars R\mathbb{R} in Rn\mathbb{R}^n with the integers Z\mathbb{Z}:

  • Instead of taking arbitrary real linear combinations of basis vectors, you only take integer linear combinations.
  • In algebra terms: a lattice is a discrete free Z\mathbb{Z}-submodule of Rn\mathbb{R}^n.

Why does restricting scalars from R\mathbb{R} (or Fp\mathbb{F}_p) to Z\mathbb{Z} change everything? Because Z\mathbb{Z} is not a field—almost no nonzero integer has an integer inverse! As a result:

  1. A lattice has infinitely many bases, and most of them are geometrically awful (long, nearly parallel vectors), whereas a few bases are "good" (short, nearly orthogonal).
  2. You have a meaningful notion of distance and norm (Euclidean ℓ2\ell_2 norm, max ℓ∞\ell_\infty norm), which does not exist in Fp\mathbb{F}_p!
  3. Finding a short nonzero vector or the closest lattice vector given a "bad" basis is computationally hard—even for quantum computers.

2. Core Definitions

2.1 Lattice and Basis

Let b1,…,bk∈Rn\mathbf{b}_1, \dots, \mathbf{b}_k \in \mathbb{R}^n be kk linearly independent vectors over R\mathbb{R} (k≤nk \le n). Put them as columns of a matrix B∈Rn×kB \in \mathbb{R}^{n \times k}.

The lattice generated by BB is: L(B)={∑i=1kzibi:zi∈Z}=BZk={Bz:z∈Zk}.\mathcal{L}(B) = \left\{ \sum_{i=1}^k z_i \mathbf{b}_i : z_i \in \mathbb{Z} \right\} = B \mathbb{Z}^k = \{ B\mathbf{z} : \mathbf{z} \in \mathbb{Z}^k \}.

  • nn is the ambient dimension, and kk is the rank of the lattice.
  • When k=nk = n, we call L\mathcal{L} a full-rank lattice (almost all lattices in cryptography are full-rank, or integer lattices L⊆Zn\mathcal{L} \subseteq \mathbb{Z}^n).

Concrete 2D Example: Let B=(1001)B = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}. Then L(B)=Z2\mathcal{L}(B) = \mathbb{Z}^2, the standard integer grid. Now consider B′=(110001)B' = \begin{pmatrix} 1 & 100 \\ 0 & 1 \end{pmatrix} or B′′=(10110010099)B'' = \begin{pmatrix} 101 & 100 \\ 100 & 99 \end{pmatrix} (note det⁡(B′′)=101⋅99−1002=−1\det(B'') = 101 \cdot 99 - 100^2 = -1). Do BB, B′B', and B′′B'' generate the exact same lattice Z2\mathbb{Z}^2? Yes! Because every column of B′′B'' is an integer vector, and (B′′)−1=(−99100100−101)(B'')^{-1} = \begin{pmatrix} -99 & 100 \\ 100 & -101 \end{pmatrix} is also an integer matrix.

2.2 Equivalent Bases and Unimodular Matrices

When do two full-rank bases B1,B2∈Rn×nB_1, B_2 \in \mathbb{R}^{n \times n} generate the same lattice L(B1)=L(B2)\mathcal{L}(B_1) = \mathcal{L}(B_2)?

Theorem: L(B1)=L(B2)\mathcal{L}(B_1) = \mathcal{L}(B_2) if and only if there exists a unimodular matrix U∈GLn(Z)U \in GL_n(\mathbb{Z}) (meaning U∈Zn×nU \in \mathbb{Z}^{n \times n} and det⁡(U)=±1\det(U) = \pm 1) such that B2=B1U.B_2 = B_1 U.

Proof sketch:

  • (⇐)(\Leftarrow) If B2=B1UB_2 = B_1 U with U∈Zn×nU \in \mathbb{Z}^{n \times n}, then B2Zn⊆B1ZnB_2 \mathbb{Z}^n \subseteq B_1 \mathbb{Z}^n. Since det⁡(U)=±1\det(U) = \pm 1, by Cramer's rule U−1∈Zn×nU^{-1} \in \mathbb{Z}^{n \times n}, so B1=B2U−1B_1 = B_2 U^{-1} gives the reverse inclusion.
  • (⇒)(\Rightarrow) If L(B1)=L(B2)\mathcal{L}(B_1) = \mathcal{L}(B_2), every column of B2B_2 is in L(B1)\mathcal{L}(B_1) so B2=B1UB_2 = B_1 U for some U∈Zn×nU \in \mathbb{Z}^{n \times n}; symmetrically B1=B2VB_1 = B_2 V for V∈Zn×nV \in \mathbb{Z}^{n \times n}. Thus B1=B1UV  ⟹  UV=In  ⟹  det⁡(U)det⁡(V)=1  ⟹  det⁡(U)=±1B_1 = B_1 U V \implies U V = I_n \implies \det(U)\det(V) = 1 \implies \det(U) = \pm 1. ■\blacksquare

This theorem is the foundational secret-key / public-key metaphor of lattice crypto:

  • Public key / Hard instance: A skewed, long basis Bbad=BgoodUB_{\text{bad}} = B_{\text{good}} U.
  • Trapdoor: A short, nearly orthogonal basis BgoodB_{\text{good}}.

3. Geometry of Numbers: Volume, Norms, and Minkowski

3.1 Fundamental Parallelepiped and Determinant

Given a basis B=[b1,…,bn]B = [\mathbf{b}_1, \dots, \mathbf{b}_n] of a full-rank lattice L⊆Rn\mathcal{L} \subseteq \mathbb{R}^n, the fundamental parallelepiped is: P(B)={∑i=1ntibi:ti∈[0,1)}=B[0,1)n.\mathcal{P}(B) = \left\{ \sum_{i=1}^n t_i \mathbf{b}_i : t_i \in [0, 1) \right\} = B [0, 1)^n.

Every point x∈Rn\mathbf{x} \in \mathbb{R}^n can be written uniquely as x=v+p\mathbf{x} = \mathbf{v} + \mathbf{p} where v∈L\mathbf{v} \in \mathcal{L} and p∈P(B)\mathbf{p} \in \mathcal{P}(B) (just compute B−1xB^{-1}\mathbf{x}, take the floor of each coordinate for the lattice part, and the fractional part for P(B)\mathcal{P}(B)). So translates v+P(B)\mathbf{v} + \mathcal{P}(B) tile Rn\mathbb{R}^n without overlap!

The determinant (or covolume) of L\mathcal{L} is the volume of P(B)\mathcal{P}(B): det⁡(L)=∣det⁡(B)∣(or det⁡(BTB) for k<n).\det(\mathcal{L}) = |\det(B)| \quad (\text{or } \sqrt{\det(B^T B)} \text{ for } k < n).

Crucially, det⁡(L)\det(\mathcal{L}) is a lattice invariant—it does not depend on the choice of basis! Because for any B′=BUB' = BU with U∈GLn(Z)U \in GL_n(\mathbb{Z}): ∣det⁡(B′)∣=∣det⁡(B)⋅det⁡(U)∣=∣det⁡(B)∣⋅1=det⁡(L).|\det(B')| = |\det(B) \cdot \det(U)| = |\det(B)| \cdot 1 = \det(\mathcal{L}).

Intuitively, det⁡(L)\det(\mathcal{L}) measures sparsity: the average volume per lattice point is det⁡(L)\det(\mathcal{L}), so the density of lattice points in Rn\mathbb{R}^n is 1/det⁡(L)1/\det(\mathcal{L}).

3.2 Norms and Successive Minima

We primarily use two norms on Rn\mathbb{R}^n:

  • Euclidean (ℓ2\ell_2) norm: ∥x∥2=∑i=1nxi2\|\mathbf{x}\|_2 = \sqrt{\sum_{i=1}^n x_i^2} (when written ∥x∥\|\mathbf{x}\| without subscript, we usually mean ℓ2\ell_2).
  • Infinity (ℓ∞\ell_\infty) norm: ∥x∥∞=max⁡1≤i≤n∣xi∣\|\mathbf{x}\|_\infty = \max_{1 \le i \le n} |x_i|.
  • ℓ1\ell_1 norm: ∥x∥1=∑i=1n∣xi∣\|\mathbf{x}\|_1 = \sum_{i=1}^n |x_i|.

Recall the basic equivalence inequalities in Rn\mathbb{R}^n: ∥x∥∞≤∥x∥2≤n∥x∥∞,∥x∥2≤∥x∥1≤n∥x∥2.\|\mathbf{x}\|_\infty \le \|\mathbf{x}\|_2 \le \sqrt{n}\|\mathbf{x}\|_\infty, \qquad \|\mathbf{x}\|_2 \le \|\mathbf{x}\|_1 \le \sqrt{n}\|\mathbf{x}\|_2.

The minimum distance (or first successive minimum) of L\mathcal{L} is the length of the shortest nonzero vector in L\mathcal{L}: λ1(L)=min⁡v∈L∖{0}∥v∥2.\lambda_1(\mathcal{L}) = \min_{\mathbf{v} \in \mathcal{L} \setminus \{\mathbf{0}\}} \|\mathbf{v}\|_2.

More generally, the ii-th successive minimum λi(L)\lambda_i(\mathcal{L}) is the smallest radius rr such that L\mathcal{L} contains ii linearly independent vectors of norm ≤r\le r.

3.3 Minkowski's First Theorem

How short must the shortest vector in an nn-dimensional lattice be, given its determinant?

Minkowski's Convex Body Theorem: Let L⊂Rn\mathcal{L} \subset \mathbb{R}^n be a full-rank lattice, and let S⊂RnS \subset \mathbb{R}^n be a convex, centrally symmetric (x∈S  ⟹  −x∈Sx \in S \implies -x \in S) set with vol(S)>2ndet⁡(L)\text{vol}(S) > 2^n \det(\mathcal{L}). Then SS contains at least one nonzero lattice point v∈L∖{0}\mathbf{v} \in \mathcal{L} \setminus \{\mathbf{0}\}.

Proof (Blichfeldt's Pigeonhole Principle): Scale SS down by 1/21/2: consider S/2S/2. Its volume is vol(S/2)=2−nvol(S)>det⁡(L)\text{vol}(S/2) = 2^{-n} \text{vol}(S) > \det(\mathcal{L}). Chop S/2S/2 into pieces according to which fundamental parallelepiped v+P(B)\mathbf{v} + \mathcal{P}(B) each point falls into, and translate all those pieces back into P(B)\mathcal{P}(B). Since the total volume exceeds vol(P(B))=det⁡(L)\text{vol}(\mathcal{P}(B)) = \det(\mathcal{L}), two distinct points x,y∈S/2\mathbf{x}, \mathbf{y} \in S/2 must map to the same offset in P(B)\mathcal{P}(B), meaning x−y=v∈L∖{0}\mathbf{x} - \mathbf{y} = \mathbf{v} \in \mathcal{L} \setminus \{\mathbf{0}\}. Since SS is centrally symmetric and convex, 2x∈S2\mathbf{x} \in S and −2y∈S-2\mathbf{y} \in S, so their midpoint 12(2x+(−2y))=x−y=v\frac{1}{2}(2\mathbf{x} + (-2\mathbf{y})) = \mathbf{x} - \mathbf{y} = \mathbf{v} lies in SS! ■\blacksquare

Applying Minkowski's theorem to the cube S=[−r,r]nS = [-r, r]^n (volume (2r)n(2r)^n) gives the clean ℓ∞\ell_\infty bound: λ1(∞)(L)≤det⁡(L)1/n.\lambda_1^{(\infty)}(\mathcal{L}) \le \det(\mathcal{L})^{1/n}. Applying it to the ℓ2\ell_2 ball of radius rr (whose volume is roughly (2πen)n/2rn\left(\frac{2\pi e}{n}\right)^{n/2} r^n by Stirling's approximation) yields Minkowski's First Theorem: λ1(L)≤n⋅det⁡(L)1/n(and asymptotically ≤2nπedet⁡(L)1/n).\lambda_1(\mathcal{L}) \le \sqrt{n} \cdot \det(\mathcal{L})^{1/n} \quad (\text{and asymptotically } \le \sqrt{\tfrac{2n}{\pi e}} \det(\mathcal{L})^{1/n}).

Gaussian Heuristic: For a "typical" random lattice of rank nn, Minkowski gives an upper bound, and the Gaussian Heuristic predicts that λ1(L)\lambda_1(\mathcal{L}) is actually very close to: GH(L)≈n2πe⋅det⁡(L)1/n.\text{GH}(\mathcal{L}) \approx \sqrt{\frac{n}{2\pi e}} \cdot \det(\mathcal{L})^{1/n}. This heuristic is used constantly in lattice cryptanalysis to estimate how short a vector exists (and whether a planted secret vector is abnormally short compared to random lattice vectors!).


4. Dual Lattices

Remember inner product spaces from linear algebra? For a full-rank lattice L⊂Rn\mathcal{L} \subset \mathbb{R}^n, its dual lattice L∗\mathcal{L}^* is: L∗={w∈Rn:⟨w,v⟩∈Z for all v∈L}.\mathcal{L}^* = \{ \mathbf{w} \in \mathbb{R}^n : \langle \mathbf{w}, \mathbf{v} \rangle \in \mathbb{Z} \text{ for all } \mathbf{v} \in \mathcal{L} \}.

  • If BB is a basis of L\mathcal{L}, then B∗=(B−1)T=B−TB^* = (B^{-1})^T = B^{-T} is a basis of L∗\mathcal{L}^*, because (B−T)TB=B−1B=In(B^{-T})^T B = B^{-1} B = I_n.
  • Immediately: (L∗)∗=L(\mathcal{L}^*)^* = \mathcal{L}, and det⁡(L∗)=1det⁡(L)\det(\mathcal{L}^*) = \frac{1}{\det(\mathcal{L})}.
  • Transference Theorem (Banaszczyk): Short vectors in L\mathcal{L} correspond to "sparse directions" in L∗\mathcal{L}^*, specifically: 1≤λ1(L)⋅λn(L∗)≤n.1 \le \lambda_1(\mathcal{L}) \cdot \lambda_n(\mathcal{L}^*) \le n. In cryptography, SIS and LWE are dual to each other via this exact dual-lattice relation! (More in Module 02.)

5. Gram-Schmidt Orthogonalization, Babai, and LLL

How do we actually measure how "good" a basis B=[b1,…,bn]B = [\mathbf{b}_1, \dots, \mathbf{b}_n] is, and how do we improve a bad basis?

5.1 Gram-Schmidt Orthogonalization (GSO)

Recall GSO from linear algebra (without normalizing vectors to unit length!): b~1=b1,b~i=bi−∑j=1i−1μi,jb~j,where μi,j=⟨bi,b~j⟩⟨b~j,b~j⟩.\tilde{\mathbf{b}}_1 = \mathbf{b}_1, \qquad \tilde{\mathbf{b}}_i = \mathbf{b}_i - \sum_{j=1}^{i-1} \mu_{i,j} \tilde{\mathbf{b}}_j, \quad \text{where } \mu_{i,j} = \frac{\langle \mathbf{b}_i, \tilde{\mathbf{b}}_j \rangle}{\langle \tilde{\mathbf{b}}_j, \tilde{\mathbf{b}}_j \rangle}.

Notice two critical facts:

  1. The GSO vectors b~i\tilde{\mathbf{b}}_i are not usually in the lattice L\mathcal{L} (because μi,j∈R\mu_{i,j} \in \mathbb{R} are not integers!).
  2. However, the product of their lengths gives the exact determinant: det⁡(L)=∏i=1n∥b~i∥2.\det(\mathcal{L}) = \prod_{i=1}^n \|\tilde{\mathbf{b}}_i\|_2.
  3. Every nonzero lattice vector v=∑i=1kzibi\mathbf{v} = \sum_{i=1}^k z_i \mathbf{b}_i (with zk≠0z_k \neq 0) satisfies ∥v∥2≥∣zk∣∥b~k∥2≥∥b~k∥2\|\mathbf{v}\|_2 \ge |z_k| \|\tilde{\mathbf{b}}_k\|_2 \ge \|\tilde{\mathbf{b}}_k\|_2. Thus: λ1(L)≥min⁡1≤i≤n∥b~i∥2.\lambda_1(\mathcal{L}) \ge \min_{1 \le i \le n} \|\tilde{\mathbf{b}}_i\|_2.

If a basis has big ∥bi∥\|\mathbf{b}_i\| while det⁡(L)\det(\mathcal{L}) is fixed, the GSO norms ∥b~i∥\|\tilde{\mathbf{b}}_i\| must decay rapidly—that's the signature of a skewed "bad" basis.

5.2 Babai's Nearest Plane Algorithm (Solving Approximate CVP with a Good Basis)

Suppose someone gives you a target vector t∈Rn\mathbf{t} \in \mathbb{R}^n and asks for a lattice vector v∈L(B)\mathbf{v} \in \mathcal{L}(B) close to t\mathbf{t} (the Closest Vector Problem, CVP).

Babai's Nearest Plane Algorithm walks backwards from i=ni = n down to 11:

  1. Set w=t\mathbf{w} = \mathbf{t}.
  2. For i=n,n−1,…,1i = n, n-1, \dots, 1:
    • Compute the projection coefficient along b~i\tilde{\mathbf{b}}_i: ci=⌊⟨w,b~i⟩⟨b~i,b~i⟩⌉c_i = \left\lfloor \frac{\langle \mathbf{w}, \tilde{\mathbf{b}}_i \rangle}{\langle \tilde{\mathbf{b}}_i, \tilde{\mathbf{b}}_i \rangle} \right\rceil (round to nearest integer).
    • Update w←w−cibi\mathbf{w} \leftarrow \mathbf{w} - c_i \mathbf{b}_i.
  3. Return v=t−w=∑i=1ncibi∈L(B)\mathbf{v} = \mathbf{t} - \mathbf{w} = \sum_{i=1}^n c_i \mathbf{b}_i \in \mathcal{L}(B).

How close is v\mathbf{v} to t\mathbf{t}? At each step ii, the residual along b~i\tilde{\mathbf{b}}_i is at most 12∥b~i∥\frac{1}{2} \|\tilde{\mathbf{b}}_i\|, and since the b~i\tilde{\mathbf{b}}_i are pairwise orthogonal, Pythagoras gives: ∥t−v∥22≤14∑i=1n∥b~i∥22.\|\mathbf{t} - \mathbf{v}\|_2^2 \le \frac{1}{4} \sum_{i=1}^n \|\tilde{\mathbf{b}}_i\|_2^2. If you have a good basis (short b~i\tilde{\mathbf{b}}_i and small ∥bi∥\|\mathbf{b}_i\|), Babai's algorithm recovers nearby lattice points accurately! With a bad basis, ∥b~n∥\|\tilde{\mathbf{b}}_n\| can be tiny and ∥b~1∥\|\tilde{\mathbf{b}}_1\| huge, making Babai fail completely.

5.3 LLL Basis Reduction (Lenstra–Lenstra–Lovász, 1982)

Can we turn any bad basis BB into a reasonably good basis in polynomial time? Yes—in low dimensions! The LLL algorithm finds an LLL-reduced basis in polynomial time in nn.

A basis B=[b1,…,bn]B = [\mathbf{b}_1, \dots, \mathbf{b}_n] is δ\delta-LLL-reduced (typically δ=3/4\delta = 3/4) if:

  1. Size-reduced: ∣μi,j∣≤12|\mu_{i,j}| \le \frac{1}{2} for all 1≤j<i≤n1 \le j < i \le n (no vector has a large component along an earlier GSO vector; enforced by subtracting ⌊μi,j⌉bj\lfloor \mu_{i,j} \rceil \mathbf{b}_j).
  2. Lovász condition: For all 1≤i<n1 \le i < n: δ∥b~i∥22≤∥b~i+1+μi+1,ib~i∥22=∥b~i+1∥22+μi+1,i2∥b~i∥22.\delta \|\tilde{\mathbf{b}}_i\|_2^2 \le \|\tilde{\mathbf{b}}_{i+1} + \mu_{i+1, i} \tilde{\mathbf{b}}_i\|_2^2 = \|\tilde{\mathbf{b}}_{i+1}\|_2^2 + \mu_{i+1,i}^2 \|\tilde{\mathbf{b}}_i\|_2^2. If this fails, swap bi\mathbf{b}_i and bi+1\mathbf{b}_{i+1} and repeat!

What does LLL guarantee? For δ=3/4\delta = 3/4: ∥b1∥2≤2(n−1)/2λ1(L),∥b1∥2≤2(n−1)/4det⁡(L)1/n.\|\mathbf{b}_1\|_2 \le 2^{(n-1)/2} \lambda_1(\mathcal{L}), \qquad \|\mathbf{b}_1\|_2 \le 2^{(n-1)/4} \det(\mathcal{L})^{1/n}.

Notice the punchline:

  • In small dimensions (n=2,10,50n = 2, 10, 50), 2(n−1)/22^{(n-1)/2} is manageable (in fact LLL works even better in practice, roughly ≈1.02ndet⁡(L)1/n\approx 1.02^n \det(\mathcal{L})^{1/n}).
  • In cryptographic dimensions (n=512,1024,2048n = 512, 1024, 2048), an exponential approximation factor like 1.02n1.02^n (or BKZ\text{BKZ} block-reduction's δ0n\delta_0^n) is far too weak to find vectors of norm ≈poly(n)\approx \text{poly}(n)! That exponential gap between polynomial-time basis reduction and Minkowski's bound is the exact reason lattice cryptography is secure.

6. Why This Matters for Proof Systems

Keep these takeaways from Module 01 in your toolkit:

  • Unlike Fp\mathbb{F}_p, vectors in lattice schemes live in Zn\mathbb{Z}^n (or Zqn\mathbb{Z}_q^n lifted to [−q/2,q/2)[-q/2, q/2)) and carry size (norm).
  • A commitment or trapdoor is fundamentally about short vectors in a lattice.
  • Attacks on lattice proof systems (like finding a commitment collision) reduce to running lattice basis reduction (LLL / BKZ) to find a short vector in some lattice. Security parameters are chosen precisely so that BKZ's best achievable root Hermite factor δ0n\delta_0^n stays strictly larger than the norm bound β\beta enforced by the proof system!

Exercises

  1. Unimodular Check: Let B1=(3512)B_1 = \begin{pmatrix} 3 & 5 \\ 1 & 2 \end{pmatrix} and B2=(1201)B_2 = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}. Do B1B_1 and B2B_2 generate the same lattice in Z2\mathbb{Z}^2? Prove it by computing U=B2−1B1U = B_2^{-1} B_1.
  2. Determinant & Minkowski: Consider the 2D lattice generated by B=(17501)B = \begin{pmatrix} 17 & 5 \\ 0 & 1 \end{pmatrix} (note: this is the qq-ary lattice of solutions to x1≡5x2(mod17)x_1 \equiv 5 x_2 \pmod{17}, foreshadowing Module 02!).
    • Compute det⁡(L(B))\det(\mathcal{L}(B)).
    • What does Minkowski's ℓ∞\ell_\infty bound guarantee for λ1(∞)(L)\lambda_1^{(\infty)}(\mathcal{L})?
    • Find a shorter nonzero vector in L(B)\mathcal{L}(B) by eye (hint: subtract a multiple of (17,0)T(17, 0)^T from a multiple of (5,1)T(5, 1)^T).
  3. Dual Lattice: Compute a basis for the dual lattice L∗\mathcal{L}^* of L(B)\mathcal{L}(B) from Exercise 2, and verify ⟨v,w⟩∈Z\langle \mathbf{v}, \mathbf{w} \rangle \in \mathbb{Z} for your basis vectors.
  4. Hands-on Lab (Rust + Arkworks): Run cargo run --bin lab01_lll_and_babai inside labs/ (lab01_lll_and_babai.rs) to see how LLL transforms a horrible skewed basis into a nearly orthogonal one, rescues Babai's algorithm, and breaks a toy qq-ary SIS instance over Arkworks F97.

(Solutions in exercise-solutions.md.)

results matching ""

    No results matching ""