Smallest direct summand containing a submodule Let $R$ be a commutative domain (I am particularly interested in the case $R=\mathbb{Z}[t]$), let $H$ be a finitely generated free $R$-module, and let $J \subset H$ be a submodule. Is $J$ always contained in a direct summand of $H$ of the same rank? (i.e. can one define "the smallest direct summand of $H$ containing $J$"?).
For PIDs, the answer is "yes". Write $\pi \colon H \to H/J$ for the projection, $T \subset H/J$ for the torsion submodule of $H/J$ and $p \colon H/J \to (H/J)/T$ for the projection, and consider the short exact sequence $$0 \to \pi^{-1}(T) \to H \stackrel{p \circ \pi}{\to} (H/J)/T \to 0.$$
Observe that $(H/J)/T$ is torsion-free. Since $R$ is a PID, $(H/J)/T$ is therefore free and so the above sequence splits. Now $\pi^{-1}(T)$ is a summand of $H$ containing $J$, as required. The rank requirement follows promptly from a dimension count: $$\operatorname{rk}(\pi^{-1}(T))=\operatorname{rk}(H)-\operatorname{rk}((H/J)/T)=\operatorname{rk}(H)-\operatorname{rk}((H/J))=\operatorname{rk}(J).$$
I suspect the answer to the question is "no", but are there conditions on $J$ so that the answer becomes "yes"? (Other than requiring that $H/J$ split as free plus torsion)?
Edit: added the rank condition to make the question non-trivial. Here the rank of $X$ is defined as the dimension of $X \otimes_R Q$, where $Q$ is the field of fractions of $R$.
 A: Well, if such a direct summand exists, then it must be $$K=\{x\in H:cx\in J\text{ for some nonzero }c\in R\}.$$  Indeed, any direct summand of $H$ containing $J$ must contain this $K$, since otherwise the quotient would have torsion.  Conversely, if a submodule of $H$ contains $J$ but is not contained in $K$, then it has higher rank than $J$, since it contains some element which is linearly independent from $J$.
So, such a direct summand exists iff this $K$ is a direct summand of $H$.  I don't think there's really any simpler characterization than this in general.  Note that $H/K$ is torsion-free and is exactly the quotient of $H/J$ by its torsion submodule.  Moreover, $K$ is a direct summand of $H$ iff $H/K$ is projective (projectivity implies the short exact sequence splits; conversely, if $K$ is a direct summand, then so is $H/K$ and hence $H/K$ is projective since it's a direct summand of a free module).  So, in terms of $J$, you could say that such a direct summand exists iff the quotient of $H/J$ by its torsion submodule is projective.
Note that this condition does not always hold.  Indeed, if $M$ is any finitely generated torsion-free $R$-module, then you can write it as a quotient of some finitely generated free module $H$.  Let $J$ be the kernel of the quotient map $H\to M$.  Then $K=J$ for this $J$ (since $H/J\cong M$ is already torsion-free).  So, any example of a non-projective finitely generated torsion-free module gives an example of a $J$ for which a direct summand of the same rank does not exist.  For instance, over $R=\mathbb{Z}[t]$, you could take $M$ to be the ideal $(2,t)\subset R$.  (So then $J$ is the submodule of relations for any presentation of this ideal; explicitly, taking $2$ and $t$ as the generators, you could have $H=R^2$ and $J$ the submodule generated by the element $(t,-2)\in R^2$.)
