A retraction preserving lattices defined by bases
Let $\mathcal O$ be a discrete valuation domain with fraction field $K$. Let $V,V'$ be finite-dimensional $K$-vector spaces with chosen bases $(b_i)_{i\in I}$ and $(b'_j)_{j\in J}$ indexed by finite sets. Put $$L=\sum_{i\in I}\mathcal O b_i,\qquad L'=\sum_{j\in J}\mathcal O b'_j.$$ Let $\iota:V\to V'$ be $K$-linear and suppose $$\iota(v)\in L'\quad\Longleftrightarrow\quad v\in L\qquad(v\in V).$$ There is a $K$-linear map $r:V'\to V$ such that $$r\iota=\operatorname{id}_V,\qquad r(L')\subseteq L.$$