Metamath Proof Explorer


Theorem lcmfunnnd

Description: Useful equation to calculate the least common multiple of 1 to n. (Contributed by metakunt, 29-Apr-2024)

Ref Expression
Hypothesis lcmfunnnd.1 φ N
Assertion lcmfunnnd φ lcm _ 1 N = lcm _ 1 N 1 lcm N

Proof

Step Hyp Ref Expression
1 lcmfunnnd.1 φ N
2 1 nncnd φ N
3 1cnd φ 1
4 2 3 npcand φ N - 1 + 1 = N
5 4 oveq2d φ 1 N - 1 + 1 = 1 N
6 nnm1nn0 N N 1 0
7 1 6 syl φ N 1 0
8 nn0uz 0 = 0
9 8 eleq2i N 1 0 N 1 0
10 7 9 sylib φ N 1 0
11 1m1e0 1 1 = 0
12 11 fveq2i 1 1 = 0
13 12 eleq2i N 1 1 1 N 1 0
14 13 a1i φ N 1 1 1 N 1 0
15 10 14 mpbird φ N 1 1 1
16 1z 1
17 fzsuc2 1 N 1 1 1 1 N - 1 + 1 = 1 N 1 N - 1 + 1
18 16 17 mpan N 1 1 1 1 N - 1 + 1 = 1 N 1 N - 1 + 1
19 15 18 syl φ 1 N - 1 + 1 = 1 N 1 N - 1 + 1
20 5 19 eqtr3d φ 1 N = 1 N 1 N - 1 + 1
21 4 sneqd φ N - 1 + 1 = N
22 21 uneq2d φ 1 N 1 N - 1 + 1 = 1 N 1 N
23 20 22 eqtrd φ 1 N = 1 N 1 N
24 23 fveq2d φ lcm _ 1 N = lcm _ 1 N 1 N
25 fzssz 1 N 1
26 25 a1i φ 1 N 1
27 fzfi 1 N 1 Fin
28 27 a1i φ 1 N 1 Fin
29 nnz N N
30 1 29 syl φ N
31 26 28 30 3jca φ 1 N 1 1 N 1 Fin N
32 lcmfunsn 1 N 1 1 N 1 Fin N lcm _ 1 N 1 N = lcm _ 1 N 1 lcm N
33 31 32 syl φ lcm _ 1 N 1 N = lcm _ 1 N 1 lcm N
34 24 33 eqtrd φ lcm _ 1 N = lcm _ 1 N 1 lcm N