Short exact sequence of modules generated by a set 
Let $0 \to A \stackrel{i}{\to} B \stackrel{p}{\to} C \to 0$ be a short exact sequence of $R$-modules.
Suppose that $A = \langle X \rangle$ and $C = \langle Y \rangle$
For each $y \in C$, choose $y' \in B$ such that $p(y')=y$. Prove that $$B = \langle i(x) \cup \{ y':y \in Y \} \rangle$$

I just can't seem to figure out how to get this to work - I don't think it should be hard!
Let $a \in A$, then $a = \sum r_i x_i$. Similarly $c = \sum r'_i y_i = \sum r'_i p(y'_i)$.
Obivously I should use exactness: $\operatorname{img} i = \operatorname{ker} p$
$b \in \operatorname{img} i \implies b = \sum r_i i(x_i)$
The $p(b) = 0$ gives that $pi(x_i)=0$ - but that is just clear from the definitions!
I am thinking that to be in the kernel of $p$, we must have $p(y'_i)=0$
Any hints to point me in the right direction?
 A: Let $b\in B$, write $p(b) = \sum_k r_k y_k$ (a minor remark: it is a bad idea to use the same letter for indices in a sum and for a homomorphism, like you did in your post). Now, wouldn't you just love to be able to claim that $b = \sum_k r_k y'_k$. Of course that's not true, but what do you know about the difference $b - \sum_k r_k y'_k$? You should be able to take it from here.
A: You don't want to start with $a\in A$; rather, you should start with $b\in B$ (and try to show that $b$ can be expressed using the $\iota(x)$ and the $y'$). 
To that end, note that you can certainly use the $y'$ to construct an element $b'$ of $B$ that has the same image under $p$ as $b$; this because the images of the $y'$ generate $C$. 
But if $b$ and $b'$ have the same image under $p$, then $b-b'\in \mathrm{ker}(p) = \mathrm{Im}(\iota)$; so you can express $b-b'$ in terms of $\iota(X)$. 
So: $b-b'$ can be expressed in terms of $\iota(X)$, and $b'$ can be expressed in terms of the $y'$. That means that $b$ can be expressed in terms of $\iota(X)$ and the $y'$, which proves that $B$ is contained in the submodule generated by the given set.
