I would like to verify if my proof is rigorous enough and is logically correct.
THE PROOF-
Let$\ z$ be an element of $G.$
This means $z$ can be expressed as $a^{n_1} b^{m_1} a^{n_2} b^{m_2} \cdots a^{n_p} b^{m_p}$. Since $ab=ba$ we can shift each $a$ towards the left until it reaches $a^{n_1}$. This would give us $a^{n_1+n_2\cdots n_p} b^{m_1+m_2 \cdots m_p}$.
Let $x,y∈G$ where $x=a^{n_1+n_2\cdots n_p} b^{m_1+m_2\cdots m_p}$ and $y=a^{r_1+r_2\cdots r_q} b^{s_1+s_2\cdots s_q}$
Then $$xy=a^{n_1+n_2\cdots n_p} b^{m_1+m_2\cdots m_p} a^{r_1+r_2\cdots r_q} b^{s_1+s_2\cdots s_q}$$
Now we can repeat the process of moving every $a$ towards the left to get
$$xy=a^{n_1+n_2\cdots n_p+r_1+r_2\cdots r_q} b^{m_1+m_2\cdots m_p+s_1+s_2\cdots s_q}$$
$yx$ would similarly be equal to $a^{r_1+r_2\cdots r_q+n_1+n_2\cdots n_p} b^{s_1+s_2\cdots s_q+m_1+m_2\cdots m_p}$ which is equal to $a^{n_1+n_2\cdots n_p+r_1+r_2\cdots r_q} b^{m_1+m_2\cdots m_p+s_1+s_2\cdots s_q}$
Since $xy=yx$, $G$ is abelian.
It's fine, except for two details: