MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  prmgapprmo Structured version   Visualization version   GIF version

Theorem prmgapprmo 16990
Description: Alternate proof of prmgap 16987: in contrast to prmgap 16987, where the gap starts at n! , the factorial of n, the gap starts at n#, the primorial of n. (Contributed by AV, 15-Aug-2020.) (Revised by AV, 29-Aug-2020.) (Proof modification is discouraged.) (New usage is discouraged.)
Assertion
Ref Expression
prmgapprmo 𝑛 ∈ ℕ ∃𝑝 ∈ ℙ ∃𝑞 ∈ ℙ (𝑛 ≤ (𝑞𝑝) ∧ ∀𝑧 ∈ ((𝑝 + 1)..^𝑞)𝑧 ∉ ℙ)
Distinct variable group:   𝑛,𝑝,𝑞,𝑧

Proof of Theorem prmgapprmo
Dummy variables 𝑖 𝑗 𝑘 𝑚 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 id 22 . . 3 (𝑛 ∈ ℕ → 𝑛 ∈ ℕ)
2 eqid 2733 . . . . . 6 (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)) = (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
3 fzfid 13933 . . . . . . 7 (𝑗 ∈ ℕ → (1...𝑗) ∈ Fin)
4 eqidd 2734 . . . . . . . . 9 ((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
5 eleq1 2822 . . . . . . . . . . 11 (𝑚 = 𝑘 → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
6 id 22 . . . . . . . . . . 11 (𝑚 = 𝑘𝑚 = 𝑘)
75, 6ifbieq1d 4550 . . . . . . . . . 10 (𝑚 = 𝑘 → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
87adantl 483 . . . . . . . . 9 (((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
9 elfznn 13525 . . . . . . . . . 10 (𝑘 ∈ (1...𝑗) → 𝑘 ∈ ℕ)
109adantl 483 . . . . . . . . 9 ((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) → 𝑘 ∈ ℕ)
11 1nn 12218 . . . . . . . . . . . 12 1 ∈ ℕ
1211a1i 11 . . . . . . . . . . 11 (𝑘 ∈ (1...𝑗) → 1 ∈ ℕ)
139, 12ifcld 4572 . . . . . . . . . 10 (𝑘 ∈ (1...𝑗) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
1413adantl 483 . . . . . . . . 9 ((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
154, 8, 10, 14fvmptd 7000 . . . . . . . 8 ((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
1615, 14eqeltrd 2834 . . . . . . 7 ((𝑗 ∈ ℕ ∧ 𝑘 ∈ (1...𝑗)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∈ ℕ)
173, 16fprodnncl 15894 . . . . . 6 (𝑗 ∈ ℕ → ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∈ ℕ)
182, 17fmpti 7106 . . . . 5 (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)):ℕ⟶ℕ
19 nnex 12213 . . . . . 6 ℕ ∈ V
2019, 19elmap 8860 . . . . 5 ((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)) ∈ (ℕ ↑m ℕ) ↔ (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)):ℕ⟶ℕ)
2118, 20mpbir 230 . . . 4 (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)) ∈ (ℕ ↑m ℕ)
2221a1i 11 . . 3 (𝑛 ∈ ℕ → (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)) ∈ (ℕ ↑m ℕ))
23 prmgapprmolem 16989 . . . . 5 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → 1 < (((#p𝑛) + 𝑖) gcd 𝑖))
24 eqidd 2734 . . . . . . . . . . . 12 ((((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) ∧ 𝑘 ∈ (1...𝑗)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
257adantl 483 . . . . . . . . . . . 12 (((((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) ∧ 𝑘 ∈ (1...𝑗)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
269adantl 483 . . . . . . . . . . . 12 ((((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) ∧ 𝑘 ∈ (1...𝑗)) → 𝑘 ∈ ℕ)
27 elfzelz 13496 . . . . . . . . . . . . . 14 (𝑘 ∈ (1...𝑗) → 𝑘 ∈ ℤ)
28 1zzd 12588 . . . . . . . . . . . . . 14 (𝑘 ∈ (1...𝑗) → 1 ∈ ℤ)
2927, 28ifcld 4572 . . . . . . . . . . . . 13 (𝑘 ∈ (1...𝑗) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
3029adantl 483 . . . . . . . . . . . 12 ((((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) ∧ 𝑘 ∈ (1...𝑗)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
3124, 25, 26, 30fvmptd 7000 . . . . . . . . . . 11 ((((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) ∧ 𝑘 ∈ (1...𝑗)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
3231prodeq2dv 15862 . . . . . . . . . 10 (((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 ∈ ℕ) → ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = ∏𝑘 ∈ (1...𝑗)if(𝑘 ∈ ℙ, 𝑘, 1))
3332mpteq2dva 5246 . . . . . . . . 9 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)) = (𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)if(𝑘 ∈ ℙ, 𝑘, 1)))
34 oveq2 7411 . . . . . . . . . . 11 (𝑗 = 𝑛 → (1...𝑗) = (1...𝑛))
3534prodeq1d 15860 . . . . . . . . . 10 (𝑗 = 𝑛 → ∏𝑘 ∈ (1...𝑗)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1))
3635adantl 483 . . . . . . . . 9 (((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑗 = 𝑛) → ∏𝑘 ∈ (1...𝑗)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1))
37 simpl 484 . . . . . . . . 9 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → 𝑛 ∈ ℕ)
38 fzfid 13933 . . . . . . . . . 10 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → (1...𝑛) ∈ Fin)
39 elfznn 13525 . . . . . . . . . . . 12 (𝑘 ∈ (1...𝑛) → 𝑘 ∈ ℕ)
4011a1i 11 . . . . . . . . . . . 12 (𝑘 ∈ (1...𝑛) → 1 ∈ ℕ)
4139, 40ifcld 4572 . . . . . . . . . . 11 (𝑘 ∈ (1...𝑛) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
4241adantl 483 . . . . . . . . . 10 (((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) ∧ 𝑘 ∈ (1...𝑛)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
4338, 42fprodnncl 15894 . . . . . . . . 9 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
4433, 36, 37, 43fvmptd 7000 . . . . . . . 8 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → ((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) = ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1))
45 nnnn0 12474 . . . . . . . . . . 11 (𝑛 ∈ ℕ → 𝑛 ∈ ℕ0)
46 prmoval 16961 . . . . . . . . . . 11 (𝑛 ∈ ℕ0 → (#p𝑛) = ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1))
4745, 46syl 17 . . . . . . . . . 10 (𝑛 ∈ ℕ → (#p𝑛) = ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1))
4847eqcomd 2739 . . . . . . . . 9 (𝑛 ∈ ℕ → ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1) = (#p𝑛))
4948adantr 482 . . . . . . . 8 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → ∏𝑘 ∈ (1...𝑛)if(𝑘 ∈ ℙ, 𝑘, 1) = (#p𝑛))
5044, 49eqtrd 2773 . . . . . . 7 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → ((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) = (#p𝑛))
5150oveq1d 7418 . . . . . 6 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → (((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) + 𝑖) = ((#p𝑛) + 𝑖))
5251oveq1d 7418 . . . . 5 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → ((((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) + 𝑖) gcd 𝑖) = (((#p𝑛) + 𝑖) gcd 𝑖))
5323, 52breqtrrd 5174 . . . 4 ((𝑛 ∈ ℕ ∧ 𝑖 ∈ (2...𝑛)) → 1 < ((((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) + 𝑖) gcd 𝑖))
5453ralrimiva 3147 . . 3 (𝑛 ∈ ℕ → ∀𝑖 ∈ (2...𝑛)1 < ((((𝑗 ∈ ℕ ↦ ∏𝑘 ∈ (1...𝑗)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))‘𝑛) + 𝑖) gcd 𝑖))
551, 22, 54prmgaplem8 16986 . 2 (𝑛 ∈ ℕ → ∃𝑝 ∈ ℙ ∃𝑞 ∈ ℙ (𝑛 ≤ (𝑞𝑝) ∧ ∀𝑧 ∈ ((𝑝 + 1)..^𝑞)𝑧 ∉ ℙ))
5655rgen 3064 1 𝑛 ∈ ℕ ∃𝑝 ∈ ℙ ∃𝑞 ∈ ℙ (𝑛 ≤ (𝑞𝑝) ∧ ∀𝑧 ∈ ((𝑝 + 1)..^𝑞)𝑧 ∉ ℙ)
Colors of variables: wff setvar class
Syntax hints:  wa 397   = wceq 1542  wcel 2107  wnel 3047  wral 3062  wrex 3071  ifcif 4526   class class class wbr 5146  cmpt 5229  wf 6535  cfv 6539  (class class class)co 7403  m cmap 8815  1c1 11106   + caddc 11108   < clt 11243  cle 11244  cmin 11439  cn 12207  2c2 12262  0cn0 12467  cz 12553  ...cfz 13479  ..^cfzo 13622  cprod 15844   gcd cgcd 16430  cprime 16603  #pcprmo 16959
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2704  ax-rep 5283  ax-sep 5297  ax-nul 5304  ax-pow 5361  ax-pr 5425  ax-un 7719  ax-inf2 9631  ax-cnex 11161  ax-resscn 11162  ax-1cn 11163  ax-icn 11164  ax-addcl 11165  ax-addrcl 11166  ax-mulcl 11167  ax-mulrcl 11168  ax-mulcom 11169  ax-addass 11170  ax-mulass 11171  ax-distr 11172  ax-i2m1 11173  ax-1ne0 11174  ax-1rid 11175  ax-rnegex 11176  ax-rrecex 11177  ax-cnre 11178  ax-pre-lttri 11179  ax-pre-lttrn 11180  ax-pre-ltadd 11181  ax-pre-mulgt0 11182  ax-pre-sup 11183
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2535  df-eu 2564  df-clab 2711  df-cleq 2725  df-clel 2811  df-nfc 2886  df-ne 2942  df-nel 3048  df-ral 3063  df-rex 3072  df-rmo 3377  df-reu 3378  df-rab 3434  df-v 3477  df-sbc 3776  df-csb 3892  df-dif 3949  df-un 3951  df-in 3953  df-ss 3963  df-pss 3965  df-nul 4321  df-if 4527  df-pw 4602  df-sn 4627  df-pr 4629  df-op 4633  df-uni 4907  df-int 4949  df-iun 4997  df-br 5147  df-opab 5209  df-mpt 5230  df-tr 5264  df-id 5572  df-eprel 5578  df-po 5586  df-so 5587  df-fr 5629  df-se 5630  df-we 5631  df-xp 5680  df-rel 5681  df-cnv 5682  df-co 5683  df-dm 5684  df-rn 5685  df-res 5686  df-ima 5687  df-pred 6296  df-ord 6363  df-on 6364  df-lim 6365  df-suc 6366  df-iota 6491  df-fun 6541  df-fn 6542  df-f 6543  df-f1 6544  df-fo 6545  df-f1o 6546  df-fv 6547  df-isom 6548  df-riota 7359  df-ov 7406  df-oprab 7407  df-mpo 7408  df-om 7850  df-1st 7969  df-2nd 7970  df-frecs 8260  df-wrecs 8291  df-recs 8365  df-rdg 8404  df-1o 8460  df-2o 8461  df-er 8698  df-map 8817  df-en 8935  df-dom 8936  df-sdom 8937  df-fin 8938  df-sup 9432  df-inf 9433  df-oi 9500  df-card 9929  df-pnf 11245  df-mnf 11246  df-xr 11247  df-ltxr 11248  df-le 11249  df-sub 11441  df-neg 11442  df-div 11867  df-nn 12208  df-2 12270  df-3 12271  df-n0 12468  df-z 12554  df-uz 12818  df-rp 12970  df-fz 13480  df-fzo 13623  df-seq 13962  df-exp 14023  df-fac 14229  df-hash 14286  df-cj 15041  df-re 15042  df-im 15043  df-sqrt 15177  df-abs 15178  df-clim 15427  df-prod 15845  df-dvds 16193  df-gcd 16431  df-prm 16604  df-prmo 16960
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator