Suppose there's a projective $R$-module $P$ (non-free). We know that there is another $R$-module $M$ such that $P\oplus M$ is free over $R$. Is there a way to write down such an $M$ in terms of $P$?


If this is not always tractable, is it possible in certain specialized circumstances? The setting that comes to mind is where $P$ is a non-principal ideal of the ring of integers of a number field (as Wikipedia says this is an instance of $P$ being projective but not free).


Thanks!


(This was originally [posted on math.stackexchange](https://math.stackexchange.com/questions/3724148/second-summand-to-make-projective-module-free) but I realized that here might be the better place to ask, apologies if not.)



Second summand to make projective module free
If you want something completely general, LSpice's comment is the answer.


For the special case of an ideal $P$ in the ring $R$ of integers of a number field (or more generally if $R$ is a Dedekind domain) you can take $M=\{x\in K|xI\subset R\}$, where $K$ is the fraction field of $R$. The keyword to Google is *fractional ideal*.


