I'm really having trouble bringing my idea to a more formal language. I want to prove this statment:
Let $R$ be a Unique Factorization Domain. Then any set of elements $\{a_0,a_1,...,a_n\} \in R$ has a greatest common divisor.
My idea of the proof:
Assume all of the elements of the set are nonzero.
For every element in the set, it can be expressed as the product of units in $R$ multiplied by other irreducible elements in $R$, since $R$ is a UFD. So, grabbing the irreducible factors common to all elements in the set, the multiplicand of those factors is the greatest common divisor.
If any of the elements of the set are 0, then the greatest common divisor of that set is 0.
Now, how do I state this more formally?
My attempt:
Let $\{a_0,a_1,...,a_n\} \in R$. Then $ \forall i \in [0,n], \exists d \text{ such that } d|a_i,$, since $R$ is a UFD (all elements in $\{a_0,a_1,...,a_n\}$ may be written as the product of irreducible elements). Let $d$ be the multiplicand of all of the irreducible factors $r$ such that $\forall i \in [0,n], r|a_i$.
We will now proceed with proof by contradiction to show that if $\forall i \in [0,n], \exists b \text{ such that } b|a_i$, it follows that $b|d$. Assume that $b$ does not divide $d$. Then $b$ contains factors that $d$ does not. But $d$ is the product of all factors common to all elements in $\{a_0,a_1,...,a_n\}$. This is a contradiction, therefore our assumption was wrong. Therefore, $d$ is the greatest common divisor.
Does this proof suffice? Have I made any errors?