Integral domain is ufd iff atomic and gcd domain an Integral domain D is a UFD if and only if D is atomic and gcd domain.
I know that a UFD is Atomic, but i don't know how to prove it is a gcd domain.
the other side of the proof: I do understand that Atomic isnt necessary a UFD, but I cant find the reason that gcd + atomic makes it a UFD

To prove a UFD is a gcd domain, show that if
$$
a = \epsilon p_{1}^{e_{1}} \cdots p_{k}^{e_{k}},
\quad
b = \eta p_{1}^{f_{1}} \cdots p_{k}^{f_{k}},
$$
with $\epsilon, \eta$ units, the $p_{i}$ pairwise non-associated irreducibles, and $e_{i}, f_{i} \ge 0$, then a gcd of $a, b$ is given by
$$
p_{1}^{\min(e_{1}, f_{1})} \cdots p_{k}^{\min(e_{k}, f_{k})}.
$$
In a gcd domain, you can prove that an irreducible is a prime. This yields uniqueness of a decomposition into the product of irreducibles.
