Every positive integer has a unique prime factorization. For sake of notation let $P_n$ be the set of prime factors of $n$ and let $a_{n,p}$ be the power so that $p^{a_{n,p}}\mid n$ but $p^{a_{n,p}+1}\not \mid n$. (If $p\not \mid n$ [or in other words if $p\not\in P_n$; we will assume $a_{n,p} = 0$). By our notation $n = \prod\limits_{p\in P_n} p^{a_{n,p}}$.
Therefore if $d=\gcd(m,n)$ then $P_d=P_m\cap P_n$ and $a_{p,d} = \min(a_{p,m},a_{p,n})$ and $d = \prod\limits_{p\in P_m\cap P_n} p^{\min(a_{m,p},a_{n,p})}$. And if $e=\operatorname{lcm}(m,n)$ then $P_d=P_m\cup P_n$ and $a_{p,d} = \max(a_{p,m},a_{p,n})$ and $d = \prod\limits_{p\in P_m\cup P_n} p^{\max(a_{m,p},a_{n,p})}$.
If our original set of integers are $\{n_k\}$ let consider what selecting $n_i$ and $n_j$ and replacing them with "new" $n_i = \gcd(n_i, n_j)$ and "new" $n_j= \operatorname{lcm}(n_i,n_j)$ means. It means replacing $P_{n_i}$ with "new $P_{n_i} = P_{n_i}\cap P_{n_j}$ and replacing $P_{n_j}$ with "new" $P_{n_j}=P_{n_i}\cap P_{n_j}$, and replacing each $a_{n_i,p}$ with "new" $a_{n_i,p}=\min(a_{n_i,p},a_{n_j,p})$ and replacing each $a_{n_j,p}$ with "new" $a_{n_j,p}= \max(a_{n_i,p},a_{n_j,p})$.
Each combination is going to result in greatest common divisor whose set of prime factors will be an intersection of existing finite sets and whose powers will be a minimum of powers and in a least common multiple whose set of prime factors will be a union of existing finite sets and whose powers will by maximum of existing powers.
After all possible combinations we will result in multiple interations of two numbers: $N$ whose prime factors are $P_N = \cap P_{n_k}$ and whose powers are $\min(a_{n_k, p})$ for each $p\in \cap P_{n_k}$ so $N = \prod\limits_{p\in \cap P_{n_k}}p^{\min(a_{n_k},p} = \gcd(n_k)$; and $M$ whose prime factors are $P_M = \cup P_{n_k}$ and whose powers are $\max(a_{n_k, p})$ for each $p\in \cap P_{n_k}$ so $M = \prod\limits_{p\in \cup P_{n_k}}p^{\max(a_{n_k},p} = \operatorname{lcm}(n_k)$