Row Hermite normal form in rank two (source code)

= Row Hermite normal form in rank two
{title2=$\begin{pmatrix}a&b\\0&d\end{pmatrix},\quad a,d>0,\ 0\leq b<d$}

For a <finite-index subgroup> $L\leq\mathbb Z^2$, its projection to the first coordinate is $a\mathbb Z$ and its intersection with the second axis is $\{0\}\times d\mathbb Z$, with $a,d>0$. Choose $(a,b)\in L$, reducing $b$ modulo $d$. Together with $(0,d)$ it is a <basis> of this <row lattice>: subtracting a multiple of $(a,b)$ from any vector leaves a vector on the second axis. These parameters are unique, and reduction of the two coordinates shows $[\mathbb Z^2:L]=ad$. Consequently an integral <matrix> of positive <determinant> $n$ has a unique representative of this form under left multiplication by $SL_2(\mathbb Z)$, with $ad=n$. This proves the lattice facts underlying <determinant-n matrix representatives for Hecke operators>.