= Solution
Over a <principal ideal domain> $D$, an $m$-by-$n$ <matrix> is in <Smith normal form> if all entries off the main diagonal vanish and its nonzero diagonal entries $d_1,\ldots,d_r$ occur first and satisfy
$$
\boxed{d_1\mid d_2\mid\cdots\mid d_r}.
$$
All remaining diagonal entries are zero. The zero <matrix> is allowed, with $r=0$. For an arbitrary <matrix> $M$, the <Smith normal form> theorem gives <invertible matrices> $P\in\operatorname{GL}_m(D)$ and $Q\in\operatorname{GL}_n(D)$ with
$$
PMQ=\operatorname{diag}(d_1,\ldots,d_r,0,\ldots,0),
$$
where the right side is interpreted as a rectangular diagonal <matrix> when necessary. The $d_j$ are determined up to multiplication by <units>. Positivity can be required over $\mathbb Z$, but is not a condition over the <Gaussian integers>.
Back to article page