Metamath Proof Explorer


Theorem prmgaplcm

Description: Alternate proof of prmgap : in contrast to prmgap , where the gap starts at n! , the factorial of n, the gap starts at the least common multiple of all positive integers less than or equal to n. (Contributed by AV, 13-Aug-2020) (Revised by AV, 27-Aug-2020) (Proof modification is discouraged.) (New usage is discouraged.)

Ref Expression
Assertion prmgaplcm n p q n q p z p + 1 ..^ q z

Proof

Step Hyp Ref Expression
1 id n n
2 fzssz 1 x
3 2 a1i x 1 x
4 fzfi 1 x Fin
5 4 a1i x 1 x Fin
6 0nelfz1 0 1 x
7 6 a1i x 0 1 x
8 lcmfn0cl 1 x 1 x Fin 0 1 x lcm _ 1 x
9 3 5 7 8 syl3anc x lcm _ 1 x
10 9 adantl n x lcm _ 1 x
11 eqid x lcm _ 1 x = x lcm _ 1 x
12 10 11 fmptd n x lcm _ 1 x :
13 nnex V
14 13 13 pm3.2i V V
15 elmapg V V x lcm _ 1 x x lcm _ 1 x :
16 14 15 mp1i n x lcm _ 1 x x lcm _ 1 x :
17 12 16 mpbird n x lcm _ 1 x
18 prmgaplcmlem2 n i 2 n 1 < lcm _ 1 n + i gcd i
19 eqidd n i 2 n x lcm _ 1 x = x lcm _ 1 x
20 oveq2 x = n 1 x = 1 n
21 20 fveq2d x = n lcm _ 1 x = lcm _ 1 n
22 21 adantl n i 2 n x = n lcm _ 1 x = lcm _ 1 n
23 simpl n i 2 n n
24 fzssz 1 n
25 fzfi 1 n Fin
26 24 25 pm3.2i 1 n 1 n Fin
27 lcmfcl 1 n 1 n Fin lcm _ 1 n 0
28 26 27 mp1i n i 2 n lcm _ 1 n 0
29 19 22 23 28 fvmptd n i 2 n x lcm _ 1 x n = lcm _ 1 n
30 29 oveq1d n i 2 n x lcm _ 1 x n + i = lcm _ 1 n + i
31 30 oveq1d n i 2 n x lcm _ 1 x n + i gcd i = lcm _ 1 n + i gcd i
32 18 31 breqtrrd n i 2 n 1 < x lcm _ 1 x n + i gcd i
33 32 ralrimiva n i 2 n 1 < x lcm _ 1 x n + i gcd i
34 1 17 33 prmgaplem8 n p q n q p z p + 1 ..^ q z
35 34 rgen n p q n q p z p + 1 ..^ q z