Proof that every group of order 4 is abelian I know there are questions on this already but I wanted to check if my attempt at proving it was valid, and I couldn't find anyone else presenting the same one in any other post. My attempt is as follows:

Since there must be a unique identity, and a unique inverse for each element, I believe that without loss of generality I can let the group be $G = \{e, a, a^{-1}, b\}$ where $e$ is the identity and $a,b$ are some other elements not equal to $e$.
Then by a previous result we know that the identity element is commutative and that an element and its inverse commute with each other. This tells us that $e.x=x.e$ for all $x$ in G, and that $a.a^{-1}=a^{-1}.a$. This leaves only $a.b$ and $a^{-1}.b$ to check.
One of $a$ or $a^{-1}$ must be an inverse for $b$ and since $a,a^{-1}$ are arbitrary, say it is $a$. Then we have $a.b=b.a$. If we multiply both sides of this equality by $a^{-1}$ on the left and right we are left with $b.a^{-1}=a^{-1}.b$ which is the final possibility. We have shown that all elements in $G$ commute with each other so $G$ is abelian.

I know this proof relies on some other results which of course must be proven too but I know how to proof these, so given these are previously proven is this proof valid?
 A: All elements in such a group have order $1,2$ or $4$.
If there's an element with order $4$, we have a cyclic group – which is abelian. Otherwise, all elements  $\ne e$ have order $2$, hence there are distinct elements $a,b,c$ such that
$\{e,a,b,c\}= G$.
Note that, by the cancellation law, $ab\ne a$ or $b$, and similarly $ab\ne e$. Henceforth, $c=ab$. But it's also $ba$ for the same reasons. So $ab=ba$, and the group is abelian.
Note: actually this group is isomorphic to Klein's Vierergruppe $\;\mathbf Z/2\mathbf Z\times\mathbf Z/2\mathbf Z$.
A: Let $G=\lbrace e,a,b,c\rbrace$ and $e$ is the identity element


*

*If $G$ has an element of order $4$, then $G$ is cyclic.

*If $G$ has no element of order $4$, then $a,b,c$ are all of order $2$. That means $a^2=b^2=c^2=e$. Now $ab$ must be $c$, otherwise $ab=a$ or $ab=b$ or $ab=e$ would give a condradiction. In the same manner you can prove $ba=c=ab$, $ca=b=ac$ and $cb=a=bc$.
In all cases, $G$ is abelian. One can further prove $G$ is isomorphic to $C_4$ or $C_2\times C_2$.
A: Without any appeal to orders of elements, Cauchy's Theorem of Lagrange's or type of group: assume that $G$ has $4$ elements and is not abelian. Then we can find two non-identity elements $a,b$ that do not commute, so $ab \neq ba$. Note that this implies $ab \notin \{e,a,b\}$. Because $G$ is closed under the group operation we must have $G=\{e,a,b,ab\}$. Now $ba$ belongs to this set. Since $a$ and $b$ do not commute $ba \notin \{e,a,b\}$. Hence we must have $ab=ba$, a contradiction. So $G$ is abelian after all.
