I want to understand the definition of surjective module in terms of splitting sequence. The definition says for a projective $R$-module $P$, the following short exact sequence $$0 \to A \xrightarrow{f} B \xrightarrow{g} P \to 0$$ splits, where $A,B$ are also $R$-modules.
I want to see why $B \cong A+P$ ?
The Wikipedia, says, then there is a section map $h:P \to B$ such that $gh=1_P$.
$(1)$ Why is so ?
This then says $B=\text{Im}(h)\oplus \text{ker}(g)$.
$(2)$ why is so ?
I am trying in the following way:
Since the given sequence is short exact sequence, the map $g$ is surjective. This means that $\text{Im}(g)=P$.
Now as $P$ is surjective module any module homomorphism factors through an epimorphism to $B$ i.e., for any $R$-module $C$ there exists an epimorphism (surjective module homomorphism) $i: C \twoheadrightarrow B$ and a module homomorphism $j: P \to C$ such that $$ij=g.$$ I can't go further. What is the section map $h$ here ?
Any explanation of above two questions ?