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

Theorem prmodvdslcmf 16776
Description: The primorial of a nonnegative integer divides the least common multiple of all positive integers less than or equal to the integer. (Contributed by AV, 19-Aug-2020.) (Revised by AV, 29-Aug-2020.)
Assertion
Ref Expression
prmodvdslcmf (𝑁 ∈ ℕ0 → (#p𝑁) ∥ (lcm‘(1...𝑁)))

Proof of Theorem prmodvdslcmf
Dummy variables 𝑘 𝑚 𝑥 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 prmoval 16762 . . 3 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1))
2 eqidd 2734 . . . . . 6 (𝑘 ∈ (1...𝑁) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
3 simpr 484 . . . . . . . 8 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
43eleq1d 2818 . . . . . . 7 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
54, 3ifbieq1d 4486 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
6 elfznn 13313 . . . . . 6 (𝑘 ∈ (1...𝑁) → 𝑘 ∈ ℕ)
7 1nn 12012 . . . . . . . 8 1 ∈ ℕ
87a1i 11 . . . . . . 7 (𝑘 ∈ (1...𝑁) → 1 ∈ ℕ)
96, 8ifcld 4508 . . . . . 6 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
102, 5, 6, 9fvmptd 6902 . . . . 5 (𝑘 ∈ (1...𝑁) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
1110eqcomd 2739 . . . 4 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) = ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
1211prodeq2i 15657 . . 3 𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)
131, 12eqtrdi 2789 . 2 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
14 fzfid 13721 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ∈ Fin)
15 fz1ssnn 13315 . . . 4 (1...𝑁) ⊆ ℕ
1614, 15jctil 519 . . 3 (𝑁 ∈ ℕ0 → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
17 fzssz 13286 . . . . 5 (1...𝑁) ⊆ ℤ
1817a1i 11 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ⊆ ℤ)
19 0nelfz1 13303 . . . . 5 0 ∉ (1...𝑁)
2019a1i 11 . . . 4 (𝑁 ∈ ℕ0 → 0 ∉ (1...𝑁))
21 lcmfn0cl 16359 . . . 4 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin ∧ 0 ∉ (1...𝑁)) → (lcm‘(1...𝑁)) ∈ ℕ)
2218, 14, 20, 21syl3anc 1369 . . 3 (𝑁 ∈ ℕ0 → (lcm‘(1...𝑁)) ∈ ℕ)
23 id 22 . . . . . 6 (𝑚 ∈ ℕ → 𝑚 ∈ ℕ)
247a1i 11 . . . . . 6 (𝑚 ∈ ℕ → 1 ∈ ℕ)
2523, 24ifcld 4508 . . . . 5 (𝑚 ∈ ℕ → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2625adantl 481 . . . 4 ((𝑁 ∈ ℕ0𝑚 ∈ ℕ) → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2726fmpttd 7009 . . 3 (𝑁 ∈ ℕ0 → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)):ℕ⟶ℕ)
28 simpr 484 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ (1...𝑁))
2928adantr 480 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘 ∈ (1...𝑁))
30 eldifi 4064 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑥 ∈ (1...𝑁))
3130adantl 481 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑥 ∈ (1...𝑁))
32 eldif 3899 . . . . . . . 8 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) ↔ (𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}))
33 velsn 4580 . . . . . . . . . . 11 (𝑥 ∈ {𝑘} ↔ 𝑥 = 𝑘)
3433biimpri 227 . . . . . . . . . 10 (𝑥 = 𝑘𝑥 ∈ {𝑘})
3534equcoms 2019 . . . . . . . . 9 (𝑘 = 𝑥𝑥 ∈ {𝑘})
3635necon3bi 2965 . . . . . . . 8 𝑥 ∈ {𝑘} → 𝑘𝑥)
3732, 36simplbiim 504 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑘𝑥)
3837adantl 481 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘𝑥)
39 eqid 2733 . . . . . . 7 (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))
4039fvprmselgcd1 16774 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑥 ∈ (1...𝑁) ∧ 𝑘𝑥) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4129, 31, 38, 40syl3anc 1369 . . . . 5 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4241ralrimiva 3137 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4342ralrimiva 3137 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
44 eqidd 2734 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
45 simpr 484 . . . . . . . 8 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
4645eleq1d 2818 . . . . . . 7 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
4746, 45ifbieq1d 4486 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
4815, 28sselid 3921 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℕ)
4917, 28sselid 3921 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℤ)
50 1zzd 12379 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ ℤ)
5149, 50ifcld 4508 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
5244, 47, 48, 51fvmptd 6902 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
53 breq1 5080 . . . . . 6 (𝑥 = if(𝑘 ∈ ℙ, 𝑘, 1) → (𝑥 ∥ (lcm‘(1...𝑁)) ↔ if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁))))
5416adantr 480 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
55172a1i 12 . . . . . . . 8 ((1...𝑁) ∈ Fin → ((1...𝑁) ⊆ ℕ → (1...𝑁) ⊆ ℤ))
5655imdistanri 569 . . . . . . 7 (((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin) → ((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin))
57 dvdslcmf 16364 . . . . . . 7 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
5854, 56, 573syl 18 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
59 elfzuz2 13289 . . . . . . . . 9 (𝑘 ∈ (1...𝑁) → 𝑁 ∈ (ℤ‘1))
6059adantl 481 . . . . . . . 8 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑁 ∈ (ℤ‘1))
61 eluzfz1 13291 . . . . . . . 8 (𝑁 ∈ (ℤ‘1) → 1 ∈ (1...𝑁))
6260, 61syl 17 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ (1...𝑁))
6328, 62ifcld 4508 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ (1...𝑁))
6453, 58, 63rspcdva 3564 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁)))
6552, 64eqbrtrd 5099 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6665ralrimiva 3137 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
67 coprmproddvds 16396 . . 3 ((((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin) ∧ ((lcm‘(1...𝑁)) ∈ ℕ ∧ (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)):ℕ⟶ℕ) ∧ (∀𝑘 ∈ (1...𝑁)∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1 ∧ ∀𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))) → ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6816, 22, 27, 43, 66, 67syl122anc 1377 . 2 (𝑁 ∈ ℕ0 → ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6913, 68eqbrtrd 5099 1 (𝑁 ∈ ℕ0 → (#p𝑁) ∥ (lcm‘(1...𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 395   = wceq 1537  wcel 2101  wne 2938  wnel 3044  wral 3059  cdif 3886  wss 3889  ifcif 4462  {csn 4564   class class class wbr 5077  cmpt 5160  wf 6443  cfv 6447  (class class class)co 7295  Fincfn 8753  0cc0 10899  1c1 10900  cn 12001  0cn0 12261  cz 12347  cuz 12610  ...cfz 13267  cprod 15643  cdvds 15991   gcd cgcd 16229  lcmclcmf 16322  cprime 16404  #pcprmo 16760
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1793  ax-4 1807  ax-5 1909  ax-6 1967  ax-7 2007  ax-8 2103  ax-9 2111  ax-10 2132  ax-11 2149  ax-12 2166  ax-ext 2704  ax-rep 5212  ax-sep 5226  ax-nul 5233  ax-pow 5291  ax-pr 5355  ax-un 7608  ax-inf2 9427  ax-cnex 10955  ax-resscn 10956  ax-1cn 10957  ax-icn 10958  ax-addcl 10959  ax-addrcl 10960  ax-mulcl 10961  ax-mulrcl 10962  ax-mulcom 10963  ax-addass 10964  ax-mulass 10965  ax-distr 10966  ax-i2m1 10967  ax-1ne0 10968  ax-1rid 10969  ax-rnegex 10970  ax-rrecex 10971  ax-cnre 10972  ax-pre-lttri 10973  ax-pre-lttrn 10974  ax-pre-ltadd 10975  ax-pre-mulgt0 10976  ax-pre-sup 10977
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 844  df-3or 1086  df-3an 1087  df-tru 1540  df-fal 1550  df-ex 1778  df-nf 1782  df-sb 2063  df-mo 2535  df-eu 2564  df-clab 2711  df-cleq 2725  df-clel 2811  df-nfc 2884  df-ne 2939  df-nel 3045  df-ral 3060  df-rex 3069  df-rmo 3222  df-reu 3223  df-rab 3224  df-v 3436  df-sbc 3719  df-csb 3835  df-dif 3892  df-un 3894  df-in 3896  df-ss 3906  df-pss 3908  df-nul 4260  df-if 4463  df-pw 4538  df-sn 4565  df-pr 4567  df-op 4571  df-uni 4842  df-int 4883  df-iun 4929  df-br 5078  df-opab 5140  df-mpt 5161  df-tr 5195  df-id 5491  df-eprel 5497  df-po 5505  df-so 5506  df-fr 5546  df-se 5547  df-we 5548  df-xp 5597  df-rel 5598  df-cnv 5599  df-co 5600  df-dm 5601  df-rn 5602  df-res 5603  df-ima 5604  df-pred 6206  df-ord 6273  df-on 6274  df-lim 6275  df-suc 6276  df-iota 6399  df-fun 6449  df-fn 6450  df-f 6451  df-f1 6452  df-fo 6453  df-f1o 6454  df-fv 6455  df-isom 6456  df-riota 7252  df-ov 7298  df-oprab 7299  df-mpo 7300  df-om 7733  df-1st 7851  df-2nd 7852  df-frecs 8117  df-wrecs 8148  df-recs 8222  df-rdg 8261  df-1o 8317  df-2o 8318  df-er 8518  df-en 8754  df-dom 8755  df-sdom 8756  df-fin 8757  df-sup 9229  df-inf 9230  df-oi 9297  df-card 9725  df-pnf 11039  df-mnf 11040  df-xr 11041  df-ltxr 11042  df-le 11043  df-sub 11235  df-neg 11236  df-div 11661  df-nn 12002  df-2 12064  df-3 12065  df-n0 12262  df-z 12348  df-uz 12611  df-rp 12759  df-fz 13268  df-fzo 13411  df-fl 13540  df-mod 13618  df-seq 13750  df-exp 13811  df-hash 14073  df-cj 14838  df-re 14839  df-im 14840  df-sqrt 14974  df-abs 14975  df-clim 15225  df-prod 15644  df-dvds 15992  df-gcd 16230  df-lcmf 16324  df-prm 16405  df-prmo 16761
This theorem is referenced by:  prmolelcmf  16777
  Copyright terms: Public domain W3C validator