$G \twoheadrightarrow H \Rightarrow$ rank$(G) \geq$ rank$(H)$ Define the rank of a group $G$ as the minimal size of a subset $S$ such that $S$ generates $G$. I want to prove that, given $G$ and $H$ two groups, if there exists a surjective homomorphism $f$ between $G$ and $H$ then rank$(G)$ $\geq$ rank$(H)$.
I thought of this: let $S$ be a minimal generating set of $G$. Let us consider $f(S)$. Then clearly $\vert S \vert \geq \vert f(S) \vert$. It would then suffice to prove that $f(S)$ generates $H$. However, I see no good reason for this... Does anyone see a way to prove it?

It is true that $H$ is generated by $f(S)$.
Let $h\in H$. Then there exists some $g\in G$ such that $h = f(g)$, because $f$ is a surjection. Now write $g = s_1 s_2 \dots s_\ell$ with $s_i \in S\cup S^{-1}$. Now apply $f$ to both sides of the equation and we find that
$$ h = f(g) = f(s_1 \dots s_\ell) = f(s_1)f(s_2) \dots f(s_\ell),$$
because $f$ is a homomorphism. Also note that $f(x^{-1})=f(x)^{-1}$, therefore indeed $h$ is generated by $f(S)$.
Note that $|S| \geq |f(S)|$, because $f$ is a surjection, but they might not be equal.
