LCM from Prime Decomposition/Proof 2

Proof
Let $m \divides r$.

Then:


 * $r$ is of the form $p_1^{h_1} p_2^{h_2} \ldots p_r^{h_r}, \forall i: 1 \le i \le r, 0 \le k_i \le h_i$
 * $n \divides l \iff \forall i: 1 \le i \le r, 0 \le l_i \le h_i$

So:
 * $m \divides r \land n \divides r \iff \forall i: 1 \le i \le r, 0 \le \max \set {k_i, l_i} \le h_i$

For $r$ to be at its smallest, we want the smallest possible exponent for each of these primes.

So for each $i \in \closedint 1 r$, $h_i$ needs to equal $\max \set {k_i, l_i}$.

Hence the result:


 * $\lcm \set {m, n} = p_1^{\max \set {k_1, l_1} } p_2^{\max \set {k_2, l_2} } \ldots p_r^{\max \set {k_r, l_r} }$