2.1 Integer Length and Integer Distance

We consider the lattice nn\mathbb{Z}^{n}\subset\mathbb{R}^{n}. A line is integer if it contains at least two integer points. In other words, this means that the integer segments contained in this line form a full-rank lattice. An integer segment is a segment with endpoints in n\mathbb{Z}^{n}.

Definition 2.1.1.

The integer length l(AB)\operatorname{l\ell}(AB) of a segment ABAB is the number of lattice points that the closure of this segment contains, minus one.

Definition 2.1.2.

The integer distance ld(a,b)\operatorname{ld}(a,b) between two points a,bna,b\in\mathbb{Z}^{n} is the integer length of the line segment between these points.

Example 2.1.3.

Consider the segment ABAB with endpoints A=(0,0)A=(0,0) and B=(3,12)B=(3,12).

Figure 1:

In Figure 1, we see that the segment contains lattice points (0,0)(0,0), (1,4)(1,4), (2,8)(2,8) and (3,12)(3,12). Hence, the integer length is given by

l(AB)=41=3.\operatorname{l\ell}(AB)=4-1=3.
Theorem 2.1.4.

The integer length of segment with endpoints A=(xa,ya)A=(x_{a},y_{a}) and B=(xb,yb)B=(x_{b},y_{b}) is given by

l(AB)=gcd(xbxa,ybya).\operatorname{l\ell}(AB)=\gcd(x_{b}-x_{a},y_{b}-y_{a}).
Proof.

First, we will show that l(AB)gcd(xbxa,ybya)\operatorname{l\ell}(AB)\geq\gcd(x_{b}-x_{a},y_{b}-y_{a}).

Let dd be a positive integer such that d|(xbxa)d|(x_{b}-x_{a}) and d|(ybya)d|(y_{b}-y_{a}). Then for integers 0md0\leq m\leq d we have that the segment ABAB contains the point of the form:

(xa+mxbxad,ya+mybyad).\left(x_{a}+m\cdot\frac{x_{b}-x_{a}}{d},y_{a}+m\cdot\frac{y_{b}-y_{a}}{d}% \right).

Thus l(AB)(d+1)1=d.\operatorname{l\ell}(AB)\geq(d+1)-1=d. To establish the best lower bound on l(AB)\operatorname{l\ell}(AB), we choose d=gcd(xbxa,ybya)d=\gcd(x_{b}-x_{a},y_{b}-y_{a}). This gives the inequality

l(AB)gcd(xbxa,ybya).\operatorname{l\ell}(AB)\geq\gcd(x_{b}-x_{a},y_{b}-y_{a}).

Next, we will show that l(AB)gcd(xbxa,ybya).\operatorname{l\ell}(AB)\leq\gcd(x_{b}-x_{a},y_{b}-y_{a}).

From the definition, we have l(AB)+1\operatorname{l\ell}(AB)+1 equally spaced lattice points in the closed segment ABAB. The complement of lattice points over this segment thus separates ABAB into l(AB)\operatorname{l\ell}(AB) connected components.

Hence l(AB)|xbxa\operatorname{l\ell}(AB)|x_{b}-x_{a} and l(AB)|ybya\operatorname{l\ell}(AB)|y_{b}-y_{a}. Hence l(AB)|gcd(xbxa,ybya)\operatorname{l\ell}(AB)|\gcd(x_{b}-x_{a},y_{b}-y_{a}). Since a|ba|b only if aba\leq b we get that l(AB)gcd(xbxa,ybya)\operatorname{l\ell}(AB)\leq\gcd(x_{b}-x_{a},y_{b}-y_{a}).

Combining both halves of the proof, we find that:

gcd(xbxa,ybya)l(AB)gcd(xbxa,ybya);\gcd(x_{b}-x_{a},y_{b}-y_{a})\leq\operatorname{l\ell}(AB)\leq\gcd(x_{b}-x_{a},% y_{b}-y_{a});

hence

l(AB)=gcd(xbxa,ybya).\operatorname{l\ell}(AB)=\gcd(x_{b}-x_{a},y_{b}-y_{a}).\qed
Remark 2.1.5.

The above proof generalises to higher-dimensional cases. Let ABAB be a line sector with end points A=(a1,a2,,an)A=(a_{1},a_{2},\ldots,a_{n}) and B=(b1,b2,,bn)B=(b_{1},b_{2},\ldots,b_{n}). Then l(AB)=gcd(a1b1,a2b2,,anbn)\operatorname{l\ell}(AB)=\gcd(a_{1}-b_{1},a_{2}-b_{2},\ldots,a_{n}-b_{n}).

Example 2.1.6.

Consider the segment between points A=(1,3)A=(1,-3) and B=(5,9)B=(5,9).

Figure 2: The segment ABAB. Integer points that lie on this segment are circled.
The segment

Similarly to Example 2.1.3, we see from Figure 2 that the segment passes through lattice points (1,3)(1,-3), (2,0)(2,0), (3,3)(3,3), (4,6)(4,6) and (5,9)(5,9). From Definition 2.1.1, this gives that

l(AB)=4.\operatorname{l\ell}(AB)=4.

On the other hand, using Theorem 2.1.4, we have that

l(AB)=gcd(15,9+3)=gcd(4,12)=4.\operatorname{l\ell}(AB)=\gcd(1-5,9+3)=\gcd(4,12)=4.
Definition 2.1.7.

Let a1,,ana_{1},\ldots,a_{n} be real, linearly-independent nn-dimensional vectors. A lattice with basis a1,,ana_{1},\ldots,a_{n} is the set of points xx such that there exist integers u1,,unu_{1},\ldots,u_{n} that satisfy:

x=u1a1+u2a2+unan.x=u_{1}a_{1}+u_{2}a_{2}+\ldots u_{n}a_{n}.
Definition 2.1.8.

Let LL be a lattice generated by basis l1,l2,,lnl_{1},l_{2},\ldots,l_{n} and BB be a sublattice generated by basis b1,b2,,bnb_{1},b_{2},\ldots,b_{n}, and let LL be a sublattice of BB. Then the index of LL is given

|det(l1,l2,,ln)|det|(b1,b2,,bn)|.\frac{|\det(l_{1},l_{2},\ldots,l_{n})|}{\det|(b_{1},b_{2},\ldots,b_{n})|}.
Remark 2.1.9.

For sublattices of 2\mathbb{Z}^{2}, notice that

|det(b1,b2,,bn)|=|det(10),(01)|=1.\big{|}\det(b_{1},b_{2},\ldots,b_{n})\big{|}=\Bigg{|}\det\left(\begin{matrix}1% \\ 0\end{matrix}\right),\left(\begin{matrix}0\\ 1\end{matrix}\right)\Bigg{|}=1.

Hence, the index of a sublattice of 2\mathbb{Z}^{2} is given by the determinant of its basis.

Definition 2.1.10.

Let LL be an integer line and pp be an integer point. Then the integer distance ld(p,L)\operatorname{ld}(p,L) between pp and LL is, for all points VV that lie on LL, the index of the sublattice generated by vectors pVpV.

Remark 2.1.11.

Let LL be an integer line, and pp and integer point, with vectors (x,y)(x,y), (a,b)(a,b) such that the point p+(x,y)p+(x,y) is on the line LL and (a,b)(a,b) is an integer unit vector along the line L. Then the integer distance ld(p,L)\operatorname{ld}(p,L) is given

ld(p,L)=xayb\operatorname{ld}(p,L)=\begin{Vmatrix}x&a\\ y&b\end{Vmatrix}
Proposition 2.1.12.

Consider point pp and line LL. Then ld(p,L)\operatorname{ld}(p,L) is one more than the number of integer lines parallel to LL between (but not including) LL and the parallel line containing pp.