Let $G$ be generated by elements $a$ and $b$ where $a^n=1$ for some $n\geq 3$, $b^2=1$ and $bab^{-1}=a^{-1}$. There is a surjective homomorphism $D_{2n}\rightarrow G$, and if $G$ has order $2n$, then $G\cong D_{2n}$.
I studied the proof in here.
Since the relations of generators $a,b$ satisfy the defining relations of $G$ there is an epimorphism from $D_{2n}$ to $G$. (This can be done using theorem of free groups).
Also, it shows that $|G|\leq2n$.
My question is : Since there is an epimorphism from $D_{2n}$ to $G$, can we straight away say that $|G|\geq 2n$ and therefore $|G|=2n$?
Also if $|a|=n$ and $|b|=2$, does the argument above valid?