Concerning the proof Euclid lemma on prime numbers Euclid's Lemma: Let $p$ be a prime number, and let $a,b\in \mathbb{Z}$. Then
$$p\mid ab\implies p\mid a\vee p\mid b$$
I know that there are proofs available in the websites. I'd like to get some feedbacks what you think about the proof i made here.
Proof: If $a,b=0$, the implication is clear. Now suppose $a,b\neq 0$. Suppose $p\mid ab$. We know that $(a,p)\mid a$ and $(a,p)\mid p$, which implies that $(a,p)\mid p$ (by Specialization). But
$$(a,p)\mid p\iff (a,p)=1 \vee (a,p)=p.$$
Checking the cases $(a,p)=1$ and $(a,p)=p$, we see that
$$(a,p)=1\implies p\mid b\implies p\mid b\vee p\mid a$$
where the first implication is used by the Bezout's lemma, and 
$$(a,p)=p\iff p\mid a\wedge p\mid p\implies p\mid a\implies p\mid a\vee p\mid b.$$
Altogether,
$$(a,p)=1 \vee (a,p)=p\implies p\mid a\vee p\mid b.$$
QED. Is this a valid proof? If there are mistakes in some directions, please let me know.
 A: In terms of logic, your proof is technically correct. It's essentially equivalent to the "standard" proof using Bezout's lemma.
However, from a mathematical writing standpoint, the way you presented this proof is less than ideal. Whenever writing proofs, you should be asking yourself: What ideas are important?
The important idea behind Euclid's lemma is the following step:

$p\not\mid a \implies p|b$

As you pointed out in the comments, this can be proven using Bezout's Lemma. It's a nice little gem of number theory.
What is not important for the proof of Euclid's lemma is the mundane "logic" steps. The first few sentences in your proof are needlessly wordy. It would suffice to say:

By definition of the gcd, $(a,p) | p$. Since $p$ is prime and the gcd is positive, there are two cases: $(a,p) = 1$ and $(a,p) = p$.

Here, we're emphasizing the important part of this step: The fact that because $p$ is prime, $(a,p)$ can only be equal to $1$ or $p$.
Next, in your proof you look at the two cases $(a,p) = 1$ and $(a,p) = p$. Once again, you skipped the justifications involving number theory and kept fiddling around with logical symbols instead. The important part of these cases is that $(a,p) = 1$ implies $p | b$ and $(a,p) = p$ implies $p | a$. So, let's write that:

If $(a,p) = p$, then by definition of the gcd, $p | a$.
If $(a,p) = 1$, then by Bezout's Lemma there exist integers $x,y$ such that $ax + py = 1$. Multiplying by $b$, we have $abx + pyb = b$. Since $p | ab$, there exists an integer $k$ such that $ab = pk$. So $p(k + yb) = b$. Thus $p | b$.

Note the parts that I skipped: Using the commutative and associative properties to write $(ax)b = a(xb) = a(bx) = (ab)x$, using the distributive property to immediately conclude $pkx + pyb = p(kx+yb)$, using closure of the integers to assert that $k + yb$ is an integer. These steps are technically parts of the proof, but I skipped them because they're not important to the number theory. We know how to manipulate the integers using the commutative, associative, and distributive properties. So we can skip these steps, just like we skip the excessive "logic" steps.
Finally, you can conclude that your initial assumption $p | ab$ (with $p$ prime) implies $p|a$ or $p|b$:

Therefore, $p | a$ or $p | b$.


Note that my "rewritten" bits of your proof are essentially the same as what you wrote in your post and in the comments. Like I said, your proof was technically correct. It just emphasized the unimportant facts (e.g. logical manipulations) instead of the important facts (e.g. precisely citing relevant results in number theory).
The point of writing mathematical proofs is not verifying the result. A well-written proof should also convey why it should make sense for the result to be true.
That's why it's ok to leave off details such as

$p|a \implies (p|a \vee p|b)$

but why it's not ok to leave off justifications for

$(a,p) = 1 \implies p | b$.

The first statement is "obviously" true by logic. When doing math that isn't logic, it's ok to assume basic logic facts. But the second statement is not at all obvious (in the context of elementary number theory). In fact, it's 90% of what you're trying to prove! So you should explicitly prove this step, and emphasize that it is important.
