What is a lattice?

9 min read

Chapter 4 ended with a set of linearly independent vectors and every point you could reach from them. If the coefficients are allowed to be any real numbers, those vectors reach every point in the space they span. Nothing is left out, and there are no gaps.

A lattice comes from making one change to that setup: the coefficients have to be integers. You can take three copies of a vector, or minus one copy, but not half a copy. That single restriction turns a continuous space into a set of separated points.

By the end of this chapter, you should understand what a lattice is, how a basis generates one, how to read L(B)={Bz:zZn}L(B) = \{Bz : z \in \mathbb{Z}^n\}, and why the basis vectors have to be linearly independent.

The integer grid

The simplest lattice is the one you have already drawn on graph paper: the points whose coordinates are whole numbers.

Z2={(x,y):x,yZ}\mathbb{Z}^2 = \{(x, y) : x, y \in \mathbb{Z}\}

Read Z\mathbb{Z} as "the integers", so ,2,1,0,1,2,\ldots, -2, -1, 0, 1, 2, \ldots including the negatives and zero. Read the superscript as the number of coordinates, so Z2\mathbb{Z}^2 is pairs of integers and Z3\mathbb{Z}^3 is triples. Read the whole line as "the set of all pairs (x,y)(x, y) where both xx and yy are integers".

Points like (0,0)(0,0), (3,2)(3,2) and (4,7)(-4,7) are in Z2\mathbb{Z}^2. Points like (0.5,1)(0.5, 1) are not.

b₁b₂
The lattice Z^2. Every dot is a point with whole-number coordinates, and the two arrows are the basis vectors b_1 = (1, 0) and b_2 = (0, 1).

That picture is a lattice, but the dots are not what defines it. What defines a lattice is how the points are generated.

Integer combinations of basis vectors

Take the two vectors drawn in the diagram:

b1=(1,0),b2=(0,1)b_1 = (1, 0), \quad b_2 = (0, 1)

A linear combination of these is z1b1+z2b2z_1 b_1 + z_2 b_2, exactly as in chapter 4. The new rule is that z1z_1 and z2z_2 must be integers. We call this an integer combination.

Two examples:

3b1+2b2=3(1,0)+2(0,1)=(3,0)+(0,2)=(3,2)3 b_1 + 2 b_2 = 3(1,0) + 2(0,1) = (3,0) + (0,2) = (3,2) 1b1+4b2=1(1,0)+4(0,1)=(1,0)+(0,4)=(1,4)-1 b_1 + 4 b_2 = -1(1,0) + 4(0,1) = (-1,0) + (0,4) = (-1,4)

The coefficients say how many copies of each basis vector to use, and a negative coefficient means the vector is used in the opposite direction. Every pair of integers z1,z2z_1, z_2 gives a point of Z2\mathbb{Z}^2, and every point of Z2\mathbb{Z}^2 comes from exactly one such pair. So the two vectors b1b_1 and b2b_2 generate the whole infinite grid.

The point set is infinite, but the description is two vectors.

Integers are the whole difference

Drop the word "integer" and the object changes completely. With real coefficients you can pick 0.50.5 and 0.250.25:

0.5b1+0.25b2=(0.5,0.25)0.5 b_1 + 0.25 b_2 = (0.5, 0.25)

That point sits inside one of the squares of the grid rather than on a corner of it. Keep going with other fractions and you fill in every square, which gives the whole plane rather than a set of dots.

integer coefficientsseparated points\text{integer coefficients} \rightarrow \text{separated points} real coefficientsthe whole plane\text{real coefficients} \rightarrow \text{the whole plane}

The gaps are the useful part. Because the points are separated, questions like "which lattice point is nearest to this target?" have a definite answer, and answering them can be hard. In a continuous space the answer is always the target itself, and there is no problem to solve.

A lattice that is not the integer grid

Lattices do not have to be square, and their points do not have to be all the whole-number coordinates. Take a different pair of basis vectors:

b1=(2,0),b2=(1,1)b_1 = (2, 0), \quad b_2 = (1, 1)

Then work out a few integer combinations:

0b1+0b2=(0,0)0 b_1 + 0 b_2 = (0,0) 1b1+0b2=(2,0)1 b_1 + 0 b_2 = (2,0) 1b1+1b2=(2,0)+(1,1)=(3,1)1 b_1 + 1 b_2 = (2,0) + (1,1) = (3,1) 2b1+3b2=(4,0)+(3,3)=(7,3)2 b_1 + 3 b_2 = (4,0) + (3,3) = (7,3)
b₁b₂b_1 + b_2
The lattice generated by b_1 = (2, 0) and b_2 = (1, 1). The dots are still evenly spaced and still repeat, but the pattern is slanted and half the whole-number points are missing.

The general point here is z1(2,0)+z2(1,1)=(2z1+z2,  z2)z_1(2,0) + z_2(1,1) = (2z_1 + z_2,\; z_2). The first coordinate minus the second is 2z12z_1, which is always even, so this lattice contains exactly the whole-number points whose two coordinates are both even or both odd. The point (3,1)(3,1) is in it and (3,2)(3,2) is not.

So this is a different lattice from Z2\mathbb{Z}^2, sitting inside it, generated by a different basis. Both are lattices for the same reason: each is the full set of integer combinations of two independent vectors.

Lattice points can be added and subtracted

One property follows straight from the definition and gets used constantly later. If uu and vv are both lattice points, then u+vu + v and uvu - v are lattice points too.

The reason is that adding two integer combinations just adds their coefficients, and integers are closed under addition and subtraction. In the slanted lattice above, (2,0)(2,0) and (3,1)(3,1) are lattice points, and so are (5,1)(5,1) and (1,1)(-1,-1). The origin is always a lattice point, obtained by taking every coefficient to be zero.

This is what makes a lattice a repeating pattern rather than an arbitrary scatter of dots. The view from any lattice point looks the same as the view from the origin, because you can shift the whole lattice by any lattice point and land back on itself.

The definition in nn dimensions

Nothing above depended on there being two dimensions. In nn dimensions we start from nn basis vectors b1,b2,,bnb_1, b_2, \ldots, b_n, and a lattice point is any integer combination of them:

z1b1+z2b2++znbnz_1 b_1 + z_2 b_2 + \cdots + z_n b_n

Written as a set, the lattice LL generated by those vectors is:

L={i=1nzibi  :  ziZ}L = \left\{ \sum_{i=1}^{n} z_i b_i \;:\; z_i \in \mathbb{Z} \right\}

Read i=1nzibi\sum_{i=1}^{n} z_i b_i as "add up z1b1z_1 b_1 through to znbnz_n b_n", and read ziZz_i \in \mathbb{Z} as "each coefficient ziz_i is an integer". The braces and the colon are the same set notation used for Z2\mathbb{Z}^2 above. The part before the colon says what is in the set, and the part after it gives the condition on the coefficients.

The same definition as a matrix

Chapter 3 showed that BzBz is a linear combination of the columns of BB with coefficients from zz. That is exactly the sum above, so the whole definition collapses into one matrix product.

Put the basis vectors in as columns:

B=[b1b2bn]B = [\, b_1 \mid b_2 \mid \cdots \mid b_n \,]

The vertical bars are only there to show the vectors sit side by side as columns. Stack the coefficients into a vector z=(z1,z2,,zn)z = (z_1, z_2, \ldots, z_n), and then:

Bz=z1b1+z2b2++znbnBz = z_1 b_1 + z_2 b_2 + \cdots + z_n b_n

So the lattice generated by BB is written:

L(B)={Bz:zZn}L(B) = \{ Bz : z \in \mathbb{Z}^n \}

Read this as "L(B)L(B) is the set of every point BzBz, as zz runs over all integer vectors with nn entries". In code it is an ordinary matrix-vector product, with the single restriction that the vector being multiplied has integer entries.

Take care with the two decorations on Z\mathbb{Z}. A superscript counts coordinates, so Zn\mathbb{Z}^n is integer vectors of length nn. A subscript is the modulus from chapter 6, so Zq\mathbb{Z}_q is the integers modulo qq. They are unrelated, and both appear once we reach q-ary lattices.

The basis vectors must be independent

The basis has to be linearly independent, for the reason chapter 4 gave. Take a pair that is not:

b1=(1,0),b2=(2,0)b_1 = (1, 0), \quad b_2 = (2, 0)

Every integer combination of these is:

z1(1,0)+z2(2,0)=(z1+2z2,  0)z_1(1,0) + z_2(2,0) = (z_1 + 2 z_2,\; 0)

The second coordinate is always zero, so every point lands on the x-axis. The result is still a set of separated points, but it is a one-dimensional lattice sitting inside two-dimensional space, not a grid filling the plane. From chapter 5, the matrix with these columns has determinant 1002=01 \cdot 0 - 0 \cdot 2 = 0, which is the algebraic version of the same failure.

When this course says an nn-dimensional lattice, it means one generated by nn independent vectors in nn-dimensional space, so detB0\det B \neq 0. That is called a full-rank lattice, and it is the only case we will need.

Notation

SymbolMeaningExample
Z\mathbb{Z}The integers,2,1,0,1,2,\ldots, -2, -1, 0, 1, 2, \ldots
Zn\mathbb{Z}^nInteger vectors with nn entries(3,2)Z2(3, 2) \in \mathbb{Z}^2
bib_iA basis vectorb1=(1,0)b_1 = (1, 0)
zzA vector of integer coefficientsz=(3,2)z = (3, 2)
BBThe matrix whose columns are the basis vectorsB=[b1b2]B = [\, b_1 \mid b_2 \,]
L(B)L(B)The lattice generated by BBevery BzBz with zZnz \in \mathbb{Z}^n

What to remember

  • A lattice is the set of all integer combinations of a set of linearly independent vectors.
  • In nn dimensions, L(B)={Bz:zZn}L(B) = \{Bz : z \in \mathbb{Z}^n\}, where the columns of BB are the basis vectors.
  • Integer coefficients are what make the points separated. Real coefficients would fill the space the vectors span.
  • Sums and differences of lattice points are lattice points, and the origin is always a lattice point.
  • A basis is a finite description of an infinite set of points.
  • A basis must be linearly independent, equivalently detB0\det B \neq 0. Otherwise the lattice collapses into fewer dimensions.

Checkpoint questions

  1. What does Z2\mathbb{Z}^2 mean, and which of (2,5)(2,5) and (2,0.5)(2, 0.5) is in it?
  2. What is 3b1+2b23b_1 + 2b_2 when b1=(2,0)b_1 = (2,0) and b2=(1,1)b_2 = (1,1)?
  3. Why do integer coefficients give separated points while real coefficients do not?
  4. How would you read L(B)={Bz:zZn}L(B) = \{Bz : z \in \mathbb{Z}^n\} out loud?
  5. If uu and vv are lattice points, why is uvu - v also a lattice point?
  6. What goes wrong if the basis vectors are linearly dependent?
  7. What is the difference between Zn\mathbb{Z}^n and Zq\mathbb{Z}_q?