I'm currently showing a few things about $\mathbb{N}$ in the proof assistant Coq, with the goal to take these proofs and turn them into deductions in the first-order theory of PA.
One of the open goals right now is the implication "irreducible $\Rightarrow$ prime". Looking for proofs on this site and elsewhere on the web, I have so far only found proofs using the $\operatorname{gcd}$ plus Bézout's Lemma or ideals, everything taking place in $\mathbb{Z}$. The fact that they are shown for $\mathbb{Z}$ is not per se a problem, since it should be possible to show something like this: $$ PA \vdash \forall x y ~ \exists ab ~~a x = by \, + \, \operatorname{gcd}(x,y) ~\lor ~ ay = bx \, + \, \operatorname{gcd}(x,y) $$ which would be a translation of Bézout into PA. One could then continue from there.
However I feel that PA should be strong enough to circumvent the necessity to define and develop results about the $\operatorname{gcd}$ just to prove this implication. Since my attempts so far have not been fruitful, any hint for a different approach would be very welcome.
Bonus points if the proof is in Heyting Artihmetic instead of PA.