Let $\phi:G \to H$ be a surjective homomorphism of finite abelian groups, and
let $g_1, \ldots, g_n$ be an irredundant set of generators (from now on, a basis) for $G$. be a basis for $G$, meaning a set of elements with the property that $\langle g_1 \rangle \oplus \ldots \oplus \langle g_n \rangle=G$ (note they have to be in direct sum).
To any basis $h_1, \ldots, h_k$ for $H$, we can associate a matrix $a$ with entries in $\mathbb{Z}$ representing $\phi$, defined by $\phi(g_i)= \sum_{j=1}^k a_{i j} h_j$.
I would like to prove the following statement. Up to permuting the $g_i$'s, we can find a basis for $H$ (see above) such that the left lower triangle of the associated matrix $a$ is made of ones on the diagonal and zeroes elsewhere. (In the previous sentence, I am assuming that the length of the basis for $H$ must satisfy $k \leq n$). More precisely, such that $a_{n-k+ i, i}=1$ and $a_{n-k+j,i}=0$ for $j>i$.
Do you know of a good reference for this kind of elementary problems? Namely, linear algebra among finite, or finitely generated, abelian groups?