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 ∉ ℙ