# Proof of Smith Normal Form as a Generalization of Rank-Nullity Theorem

For any matrix $$A$$ with entries in a PID, there exist invertible matrices $$P$$ and $$Q$$ such that $$B = PAQ$$, where $$B$$ is in Smith normal form. This theorem is usually proved by using elementary row/column operations. However, in the case where the entries of $$A$$ are in a field, there is a short proof which is basically just the rank-nullity theorem [interpret $$A$$ as a linear map from $$\mathbb{F}^m$$ to $$\mathbb{F}^n$$, choose a basis $$\{v_{1}, \ldots , v_{k}\}$$ for the kernel of $$A$$ and extend it to a basis for $$\mathbb{F}^m$$, and finally use $$\{A(v_{1}), \ldots , A(v_{k})\}$$ as a basis for $$\mathbb{F}^n$$ (extending it as necessary)]. Of course, the rank-nullity theorem does not hold over rings, but is there some way to generalize the ideas of this proof for any PID, perhaps by passing to its field of fractions?