Let $R$ be a commutative ring with identity and $a_1, a_2, \dots,a_n \in R - \{0\}$. Then to find the gcd and lcm of $a_1, a_2, \dots,a_n$ and they exist in $R$ when $R$ is a UFD.
We can express $a_1, a_2, \dots,a_n$ uniquely as finite product of irreducible elements as:
$a_1 \sim p_1^{r_1}p_2^{r_2} \dots p_n^{r_n} $, $a_2 \sim p_1^{s_1}p_2^{s_2} \dots p_n^{s_n}$ , $\dots,$ $a_n \sim p_1^{t_1}p_2^{t_2} \dots p_n^{t_n}$
Now, we define:
$\gcd (a_1, a_2, \dots,a_n ) = p_1^{c_1}p_2^{c_2} \dots p_n^{c_n}$ where $c_i = \min\{r_i,s_i,...,t_i\}$ and,
$lcm(a_1, a_2, \dots,a_n ) = p_1^{d_1}p_2^{d_2} \dots p_n^{d_n}$ where $d_i = \max\{r_i,s_i,...,t_i\}$
I can intuitively define them but how can I prove that they exist in $R$?
Please Help!