Show that $R$-module $P$ is projective, iff there exist a family $\{m_{\lambda}\}_{\lambda\in\Lambda}$ of elements of $P$ and homomorphisms $\{f_{\lambda}:P\rightarrow R \}_{\lambda\in\Lambda}$ such that $(f_\lambda(x))_{\lambda\in\Lambda}$ have only finitely many $f_\lambda (x)\not=0$ for each $\lambda \in \Lambda$ and for each $x\in P$ we have $x=\sum_{\lambda\in \Lambda}f_{\lambda}(x) m_{\lambda}$.
In the $(\rightarrow)$ way I don't know how to construct the functions nor choose element. But I think I should use that $P$ is the direct sum of a free $R$-module $L=P\oplus S$ for some $S$ and $L$. How can I continue from this?
In the $(\leftarrow)$ way I can construct a function $f:P\rightarrow R^{(\lambda)}$ such that $\pi_{\lambda}\circ f=f_{\lambda}$ using the universal property for products. Can I construct a exact sequence
$$0\longrightarrow P \overset{f}\longrightarrow R^{(\lambda)}\overset{g}\longrightarrow S\longrightarrow0$$
such that split? (I don't know if $f$ is injective)
Thanks for help!