Let $A$ be a local ring with maximal ideal $\mathfrak{m}$ and let $k = A/\mathfrak{m}$ be the residue field. Let $M$ be a finitely generated $A$-module; so $M/\mathfrak{m}M$ is a finite dimensional $k$-vector space. From Atiyah and MacDonald Proposition 2.8, we know that if $x_1, \ldots, x_n \in M$ are such that their images in $M/\mathfrak{m}M$ form a (vector space) basis of $M/\mathfrak{m}M$, then the $x_i$ generate $M$. I would like to know if there is a sort of converse to this statement. More precisely:
With notation as above, suppose the elements $y_1, \ldots, y_n \in M$ form a generating set for $M$. Then how can one transform the set $\{y_i\}$ such that the images of the $y_i$ in $M/\mathfrak{m}M$ form a basis for $M/\mathfrak{m}M$ as a $k$-vector space?
Obviously the condition we need on the set $\{y_i\}$ is that their images in $M/\mathfrak{m}M$ are linearly independent and span $M/\mathfrak{m}M$. My question is really about what transformation (in the algorithmic sense) one needs to perform on $\{y_i\}$ such that this condition will hold.
My intuition is that one would need to apply some kind of 'saturation' to the generating set $\{y_i\}$ and then reduce the saturation, since the main obstacle is that we may have $\overline{y}_i = \overline{y}_j$ for some $i \neq j$ (where $\overline{y}_i$ denotes the image of $y_i$ in $M/\mathfrak{m}M$) which could lead to a loss of a basis element in $M/\mathfrak{m}M$.
In case the statement above is too general to be solvable, please consider the special case (which is in fact my real problem) where $A = \mathbb{Z}_p$ (the $p$-adic integers), so $\mathfrak{m} = (p)$ and $k = \mathbb{F}_p$, and $M$ is a submodule of $\mathbb{Z}_p^n$ (so $M$ is finitely generated and free) given as a set of basis elements. I want to find a basis for the reduction of $M$ modulo $(p)$ as an $\mathbb{F}_p$-vector space.