I was trying to prove that $\sqrt{6}$ irrational as:
Let $$\sqrt{6}=\dfrac ab$$
$$\implies a^2=6b^2$$
$$6|a^2 \implies 6|a$$.
I should not be able to do the step because 6 is not a prime number, hence it does not satisfies the Euclid's lemma. But somehow "6 divides a" seems to be valid. If $6|a^2$ then $a^2$ must have both 3 and 2 as its factors, and this is only possible when $a$ itself has 3 and 2 as its factors.
I also noted that $k|a^2 \nRightarrow k|a $ only when $k$ is a complete square, e.g. $4|2^2$ but $4 \nmid 2$.
Question
Am I correct in saying, "6 divides $a^2 \implies $6 divides $a$"?
Is this some theorem, if yes what is it called?
$3$ divides $a^2$ $\implies$ 3 divides $a$.
$2$ divides $a^2$ $\implies$ 2 divides $a$.
$2\cdot 3$ divides $a$.