Integer determinant and sublattice index (source code)

= Integer determinant and sublattice index
{title2=$[\mathbb Z^n:A\mathbb Z^n]=|\det A|$}

For a square <integer matrix> $A$ with nonzero <determinant>, the image $A\mathbb Z^n$ is a <subgroup> of the <integer lattice>. Its <index of a subgroup> is
$$
[\mathbb Z^n:A\mathbb Z^n]=|\det A|.
$$
In particular, $A=\operatorname{diag}(2,1)$ gives all points with even first coordinate. The quotient has two <cosets>, represented by $(0,0)$ and $(1,0)$, and the fundamental cell has area two. A <determinant> of two therefore counts how much integer information is missing from the image.

\Image[/integer-determinant-sublattice-and-rational-counterexample.png]
{title=An integer determinant counts missing cosets; area alone cannot preserve integer coordinates}
{description=Left: $\operatorname{diag}(2,1)\mathbb Z^2$ misses odd first coordinates and has index two. Right: $\operatorname{diag}(2,1/2)$ has determinant one but maps $(0,1)$ to $(0,1/2)$, so it does not preserve the original integer lattice. Empty gray circles show reference integer points; blue filled points show the image.}

The integrality hypothesis is essential. The rational <matrix> $R=\operatorname{diag}(2,1/2)$ has <determinant> one but sends $(0,1)$ to $(0,1/2)$. Its generated <Euclidean lattice> has the same <covolume> as $\mathbb Z^2$ without being the same <integer lattice>. The <unimodular matrix> criterion combines an arithmetic condition with a geometric one.

A short proof of the index formula uses <Smith normal form>. Write $PAQ=\operatorname{diag}(d_1,\ldots,d_n)$, with $P,Q$ <unimodular matrices> and positive <integers> $d_i$. They preserve the relevant integer structure, so the quotient has the same size as $\prod_i\mathbb Z/d_i\mathbb Z$, namely $\prod_i d_i=|\det A|$. No assumption that the <matrix> is orthogonal or its basis vectors are short is needed.