Mathematical Background on Lattices - Introduction to Lattice-Based Cryptography

#cryptography #lattices

Table of Contents

This is the first post in the series: Introduction to Lattice-based Cryptography. We focus on lattices as an independent mathematical concept and its properties. However, we focus on aspects that would be useful in the study of Lattice-based Cryptography.

Throughout this series, we use 2-dimensions and 3-dimensions because they are easy to work with. In practice we use sufficiently higher dimensions.

The only prequisite to start this series is to understand the following:

  • R\mathbb{R} represents the set of all real numbers.
  • Z\mathbb{Z} represents the set of all integers.
  • Q\mathbb{Q} represents the set of all rational numbers.
  • Rn\mathbb{R}^n represents the set of all n-dimensional real vectors
  • Zn\mathbb{Z}^n represents the set of all n-dimensional integer vectors

What is a Lattice?

A Lattice LL is an infinite set of vectors v\mathbf{v} constructed based two condition: discreteness and additivity.

Formally, an nn-dimensional lattice LL is a discrete additive subgroup of Rn\mathbb{R}^n generated by a basis B=b1,b2,,bnB = {b_1, b_2, …, b_n} as an integer linear combination: L=L(B):=i=1nzibi:ziZL = L(B):= {\sum_{i = 1}^{n}z_ib_i: z_i \in \mathbb{Z}}

where ziz_i is an arbitrary integer Z\mathbb{Z}

  • discrete: This means that every vector point vL\mathbf{v} \in L has some “neighborhood” in which v\mathbf{v} is the only lattice point. Loosely speaking, this means that, for every point v\mathbf{v} there is “good space” around it. By using an integer linear combination and not just linear combination we have achieve reasonable discreteness between vector points. This is shown below using rationals Q\mathbb{Q} as a counter example.
  • additive subgroup: a lattice LL is an additive subgroup if it contains identity element 0Rn0 \in \mathbb{R}^n(the zero vector), and if for any v,wL\mathbf{v}, \mathbf{w} \in L, we have v,wL-\mathbf{v}, -\mathbf{w} \in L and v+wL\mathbf{v} + \mathbf{w} \in L

Below, we will see what a lattice is and what it is not.

  • The singleton set 0Rn{0} \in \mathbb{R}^n is a lattice LL(for any positive integer nn). That is, the zero vector in any dimension is a lattice.

png

png

  • The integers ZR\mathbb{Z} \in \mathbb{R} form a 1-dimensional lattice LL.

png

png

png

png

png

  • The integer grid ZnRn\mathbb{Z}^n \in \mathbb{R}^n is an n-dimensional lattice

png

png

  • The set xZn:i=1nxi2Z{x ∈ \mathbb{Z}^n : \sum_{i=1}^nx_i ∈ 2\mathbb{Z}} is a lattice; it is often called the “checkerboard” or “chessboard” lattice, especially in two dimensions. It contains all nn-vectors of integers x=(x1,x2,,xn)Zx = (x_1, x_2,…,x_n) \in \mathbb{Z} such that the sum of the components of xx, i.e i=1xi\sum_{i = 1}^{x_i}, is an even integer. That is, the sum of elements in the vector is an even integer.

    The opposite is not true. That is xZn:i=1nxi2Z+1{x ∈ \mathbb{Z}^n : \sum_{i=1}^nx_i ∈ 2\mathbb{Z} + 1} is not a lattice. Although it is discrete, it is not an additive subgroup of Rn\mathbb{R}^n mainly because it doesn’t contain the identity element 0Rn0 \in \mathbb{R}^n(the all-zeros vector) as shown in non-example diagram below. Recall, that a lattice LL is an additive subgroup if it contains identity element 0Rn0 \in \mathbb{R}^n, and if any v,wL\mathbf{v}, \mathbf{w} \in L, we have v,wL-\mathbf{v}, -\mathbf{w} \in L and v+wL\mathbf{v} + \mathbf{w} \in L.

    Example: (0,0),(1,1),(2,4),(3,5),(2,2)(0,0),(1,1),(2,4),(−3,5),(−2,−2)

    Non-example(opposite): (1,0),(2,3),(1,2)(1,0),(2,3),(−1,2)

  • Example 1: Just even integers

png

png

  • Example 2: random 2-tuples and 3-tuples with sum of even integer

png

png

  • Non-example: random 2-tuples and 3-tuples with sum of odd integer

png

png

  • The rationals QR\mathbb{Q} \subset \mathbb{R} do not form a lattice, because although they form a subgroup, it is not discrete: there exist rational numbers that are arbitrarily close to zero.

    For two arbitrary rational numbers r1r_1 and r2r_2, where r1<r2r_1 \lt r_2 there are inifinitely many rational numbers between them therefore making it impossible for either r1r_1 and r2r_2 to be discrete.

    For example, below is a graph of points in Q\mathbb{Q} between 1 and 2.

png

png

  • The odd integers 2Z+12\mathbb{Z} + 1 do not form a lattice, because although they are discrete, they do not form a subgroup of R\mathbb{R}.

    The odd integers 2Z+12\mathbb{Z} + 1 do not contain 0


Basis

A basis B=b1,b2,,bnRnB = {b_1, b_2, …, b_n} \subset \mathbb{R}^n of a lattice LL is a set of linearly independent vector whose integer linear combinations generate the lattice:L=L(B):=i=1nzibi:ziZL = L(B):= {\sum_{i = 1}^{n}z_ib_i: z_i \in \mathbb{Z}}

Recall two vectors b1b_1 and b2b_2 are said to be linearly independent if wib1b2w_i * b_1 \neq b_2 and wjb2b1w_j * b_2 \neq b_1 where wi,wjw_i, w_j is an arbitrary integers.

For example, b1=[1,2,3]b_1 = [1, 2, 3] and b2=[5,3,7]b_2 = [5, 3, 7] are linearly independent while b3=[1,2,3]b_3 = [1, 2, 3] and b4=[2,4,6]b_4 = [2, 4, 6] are not. Why? w1b3=b4w_1 * b_3 = b_4 and w2b4=b3w_2 * b_4 = b_3 where w1w_1 and w2w_2 are 22 and 12\dfrac{1}{2} respectively. But, we can’t find any wiw_i for which wib1=b2w_i * b_1 = b_2 and vice versa.

In general, the vectors B=b1,b2,,bnB = {b_1, b_2, …, b_n} are said to be linearly independent if for any vector bib_i in the set, it cannot be generated by the linear combination of one, some or all of the other vectors in the set. That is, c1b1+c2b2++cmbmbic_1b_1 + c_2b_2 + … + c_mb_m \neq b_i where mm is an arbitrary natural number.

We can also represent a basis BB as a matrix. This is an nnn*n matrix where the basis vectors are the ordered columns of the matrix. This is a non-singular matrix.

With this we can represent a lattice L=BZn=Bz:zZnL = B * \mathbb{Z}^n = {Bz: z \in \mathbb{Z}^n }

For example, given a basis B=b1,b2,b3B = {b_1, b_2, b_3} where b1=[1,0,0]b_1 = [1, 0, 0], b2=[0,1,0]b_2 = [0, 1, 0] and b3=[0,0,1]b_3 = [0, 0, 1] respectively, we have a matrix B=[100010001]B = \begin{bmatrix} 1 & 0 & 0\\[0.3em] 0 & 1 & 0\\[0.3em] 0 & 0 & 1 \end{bmatrix} and the finite set of integer vectors z=v1,v2,v3z = {v_1, v_2, v_3 } where v1=[1,2,5]v_1 = [1, 2, 5], v2=[5,7,9]v_2 = [-5, 7, 9] and v3=[9,3,7]v_3 = [-9, 3, 7] respectively, we can generate a lattice LL with three points [1,2,5][1, 2, 5], [5,7,9][-5, 7, 9] and [9,3,7][-9, 3, 7].

This way of representing the basis is instrumental in understanding the next topic: unimodular matrix

Unimodular Matrix

Bases B1B_1, B2B_2 generate the same lattice LL if and only if there exists a unimodular UZn×nU \in \mathbb{Z}^{n \times n} such that B1=B2UB_1 = B_2U.

An integer matrix is said to be unimodular if it determinant is ±1\pm1.

This property for two bases being able to generate the same lattice LL is what makes lattice-based cryptography possible. We will see why this is true later in this series.

We can efficiently test whether two given matrices B1B_1, B2B_2 generate the same lattice, by checking whether B11B2B_1^{-1}·B_2 is unimodular.


Norms

A norm or vector norm is a generalization of what we would normally call the length or magnitude of a vector.

Recall, v=v12+v22+v32+.+vn2||{\mathbf{v}}|| = \sqrt{v_1^2 + v_2^2 + v_3^2 + …. + v_n^2}, the magnitude or length or size of a vector v{\mathbf{v}}. This is a type of norm called the Euclidean norm v2||\mathbf{v}||_2.

Formally, a norm on a vector space VV over R\mathbb{R} or C\mathbb{C} is a function .:VR||.||:V \to \mathbb{R} that satisfies the properties for all vectors v\mathbf{v}, w\mathbf{w} \in VV and all scalars α\alpha:

  1. Non-negativity: v0||\mathbf{v}|| \geq 0, and v=0    v=0||\mathbf{v}|| = 0 \iff \mathbf{v} = 0

  2. Homogeneity: αv=αv||\alpha \mathbf{v}|| = |\mathbf{\alpha}|||\mathbf{v}||

  3. Triangle Inequality: v+wv+w||\mathbf{v} + \mathbf{w}|| \leq ||\mathbf{v}|| + ||\mathbf{w}||

For example, the Euclidean norm for the vector v=[3,4]\mathbf{v} = [3, 4] is v2=32+42=9+16=25=5||\mathbf{v}||_2 = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5.

The graphical representation is displayed below. The length of the arrow is 55.

This graph would help us understand the next topic: ii-th successive minimum

png

Other norms include the Manhattan Norm, Maximum Norm and p-norm. For now, we only care about Euclidean norms.


Successive Minimum

The Euclidean Norm v2||\mathbf{v}||_2 of any vector v\mathbf{v} in a lattice LL can be interpreted as the radius rr of a circle (or sphere in higher dimensions) where the origin (0,0)(0, 0) of the graph is the centre of the circle as shown in the diagram below.

png

Given a lattice LL and a norm(i.e. the Euclidean norm), the ii-th successive minimum λi(L)\lambda_i(L) is the smallest radius rr such that LL contains at least ii linearly independent lattice vectors of norm at most rr within a ball of radius rr centered at the origin.

In other words, what is the smallest radius rr such that we can find ii linearly independent vectors v1,v2,,vi\mathbf{v_1}, \mathbf{v_2}, …, \mathbf{v_i} inside the circle(or sphere) with radius rr? Recall, that we interpret the norm of a vector as a radius rr when the centre is at the origin (0,0)(0, 0).

For example, if we generate the vectors v1=[4,2]\mathbf{v_1} = [4, 2], v2=[5,5]\mathbf{v_2} = [-5, -5] and v3=[2,11]\mathbf{v_3} = [2, 11] given the basis points b1=[2,1]\mathbf{b_1} = [2, 1] and b2=[1,3]\mathbf{b_2} = [1, 3] creating a lattice LL, what is the 1st successive minimum λ1(L)\lambda_1(L)? Or, What is ii-th successive minimum when ii is 1?

We start by finding the norm of the vectors(including the basis vectors):

  • b12=22+12=4+1=5=2.24||\mathbf{b_1}||_2 = \sqrt{2^2 + 1^2} = \sqrt{4 + 1} = \sqrt{5} = 2.24
  • b22=12+32=1+9=10=3.16||\mathbf{b_2}||_2 = \sqrt{1^2 + 3^2} = \sqrt{1 + 9} = \sqrt{10} = 3.16
  • v12=42+22=16+4=20=4.47||\mathbf{v_1}||_2 = \sqrt{4^2 + 2^2} = \sqrt{16 + 4} = \sqrt{20} = 4.47
  • v22=52+52=25+25=50=7.07||\mathbf{v_2}||_2 = \sqrt{-5^2 + -5^2} = \sqrt{25 + 25} = \sqrt{50} = 7.07
  • v32=22+112=4+121=125=11.18||\mathbf{v_3}||_2 = \sqrt{2^2 + 11^2} = \sqrt{4 + 121} = \sqrt{125} = 11.18

The smallest norm is 2.242.24 and if we draw a circle using this norm as the radius, we find the linearly independent vector b1=[2,1]\mathbf{b_1} = [2, 1] within the circle. Therefore, 2.242.24 is the the 1st successive minimum.

Notice how it is the closest vector to the origin. It is called the smallest nonzero vector in the lattice. Take note of this, we discuss this later in the series.

png

Again, what is the 2nd successive minimum? We are looking for the smallest radius(i.e norm) that creates a circle containing two linearly independent vectors.

From the computed norms, we know that the second smallest vector is b2=[1,3]\mathbf{b_2} = [1, 3] with norm of 3.163.16. Drawing a circle using this norm as the radius, the circle contains b1\mathbf{b_1} and b2\mathbf{b_2}. Therefore, 3.163.16 is the 2nd successive minimum.

png

Thirdly, what is the 3rd successive minimum?

Probably 4.474.47, the third smallest norm. It turns out this is not the case. They are not linearly independent because v1\mathbf{v_1} was generated by b1b_1 and b2b_2 therefore there are only two linearly independent vectors(i.e b1\mathbf{b_1} and b2\mathbf{b_2}) in the circle with radius 4.474.47.

png

How about 7.077.07? The fourth smallest norm. This is still not the 3rd successive minimum for the same reason as before, v2\mathbf{v_2} was generated by b1\mathbf{b_1} and b2\mathbf{b_2} therefore the circle with radius 7.077.07 contains only two linearly independent vectors.

png

And, lastly, how about 11.1811.18? The largest norm. Is it the 3rd successive minimum? No, it’s not. For the same reason as before.

png

With this, it is safe to say the 3rd successive minimum and above does not exist because all other vectors were generated by the basis points b1\mathbf{b_1} and b2\mathbf{b_2}.

In general, the maximum ii in the ii-th successive minimum is the number of basis vectors.

It’s important to point out that a lattice LL might have multiple basis vectors and this is an instrumental property of lattices that makes certain types of lattice-based cryptography possible.


The goal of this material was to introduce these concepts independently; appreciating their beauty without drawing parallels to their applications in lattice-based cryptography; we will do that in the other posts in this series.

In the next post, we will be looking into Hard Problems in Lattice-Based Cryptography. See you there!