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

Theorem prmodvdslcmf 16030
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 16016 . . 3 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1))
2 eqidd 2766 . . . . . 6 (𝑘 ∈ (1...𝑁) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
3 simpr 477 . . . . . . . 8 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
43eleq1d 2829 . . . . . . 7 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
54, 3ifbieq1d 4266 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
6 elfznn 12577 . . . . . 6 (𝑘 ∈ (1...𝑁) → 𝑘 ∈ ℕ)
7 1nn 11287 . . . . . . . 8 1 ∈ ℕ
87a1i 11 . . . . . . 7 (𝑘 ∈ (1...𝑁) → 1 ∈ ℕ)
96, 8ifcld 4288 . . . . . 6 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
102, 5, 6, 9fvmptd 6477 . . . . 5 (𝑘 ∈ (1...𝑁) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
1110eqcomd 2771 . . . 4 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) = ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
1211prodeq2i 14932 . . 3 𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)
131, 12syl6eq 2815 . 2 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
14 fzfid 12980 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ∈ Fin)
15 fz1ssnn 12579 . . . 4 (1...𝑁) ⊆ ℕ
1614, 15jctil 515 . . 3 (𝑁 ∈ ℕ0 → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
17 fzssz 12550 . . . . 5 (1...𝑁) ⊆ ℤ
1817a1i 11 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ⊆ ℤ)
19 0nelfz1 12567 . . . . 5 0 ∉ (1...𝑁)
2019a1i 11 . . . 4 (𝑁 ∈ ℕ0 → 0 ∉ (1...𝑁))
21 lcmfn0cl 15620 . . . 4 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin ∧ 0 ∉ (1...𝑁)) → (lcm‘(1...𝑁)) ∈ ℕ)
2218, 14, 20, 21syl3anc 1490 . . 3 (𝑁 ∈ ℕ0 → (lcm‘(1...𝑁)) ∈ ℕ)
23 id 22 . . . . . 6 (𝑚 ∈ ℕ → 𝑚 ∈ ℕ)
247a1i 11 . . . . . 6 (𝑚 ∈ ℕ → 1 ∈ ℕ)
2523, 24ifcld 4288 . . . . 5 (𝑚 ∈ ℕ → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2625adantl 473 . . . 4 ((𝑁 ∈ ℕ0𝑚 ∈ ℕ) → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2726fmpttd 6575 . . 3 (𝑁 ∈ ℕ0 → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)):ℕ⟶ℕ)
28 simpr 477 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ (1...𝑁))
2928adantr 472 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘 ∈ (1...𝑁))
30 eldifi 3894 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑥 ∈ (1...𝑁))
3130adantl 473 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑥 ∈ (1...𝑁))
32 eldif 3742 . . . . . . . 8 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) ↔ (𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}))
33 velsn 4350 . . . . . . . . . . . 12 (𝑥 ∈ {𝑘} ↔ 𝑥 = 𝑘)
3433biimpri 219 . . . . . . . . . . 11 (𝑥 = 𝑘𝑥 ∈ {𝑘})
3534equcoms 2117 . . . . . . . . . 10 (𝑘 = 𝑥𝑥 ∈ {𝑘})
3635necon3bi 2963 . . . . . . . . 9 𝑥 ∈ {𝑘} → 𝑘𝑥)
3736adantl 473 . . . . . . . 8 ((𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}) → 𝑘𝑥)
3832, 37sylbi 208 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑘𝑥)
3938adantl 473 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘𝑥)
40 eqid 2765 . . . . . . 7 (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))
4140fvprmselgcd1 16028 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑥 ∈ (1...𝑁) ∧ 𝑘𝑥) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4229, 31, 39, 41syl3anc 1490 . . . . 5 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4342ralrimiva 3113 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4443ralrimiva 3113 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
45 eqidd 2766 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
46 simpr 477 . . . . . . . 8 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
4746eleq1d 2829 . . . . . . 7 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
4847, 46ifbieq1d 4266 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
4915, 28sseldi 3759 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℕ)
5017, 28sseldi 3759 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℤ)
51 1zzd 11655 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ ℤ)
5250, 51ifcld 4288 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
5345, 48, 49, 52fvmptd 6477 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
54 breq1 4812 . . . . . 6 (𝑥 = if(𝑘 ∈ ℙ, 𝑘, 1) → (𝑥 ∥ (lcm‘(1...𝑁)) ↔ if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁))))
5516adantr 472 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
56172a1i 12 . . . . . . . 8 ((1...𝑁) ∈ Fin → ((1...𝑁) ⊆ ℕ → (1...𝑁) ⊆ ℤ))
5756imdistanri 565 . . . . . . 7 (((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin) → ((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin))
58 dvdslcmf 15625 . . . . . . 7 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
5955, 57, 583syl 18 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
60 elfzuz2 12553 . . . . . . . . 9 (𝑘 ∈ (1...𝑁) → 𝑁 ∈ (ℤ‘1))
6160adantl 473 . . . . . . . 8 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑁 ∈ (ℤ‘1))
62 eluzfz1 12555 . . . . . . . 8 (𝑁 ∈ (ℤ‘1) → 1 ∈ (1...𝑁))
6361, 62syl 17 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ (1...𝑁))
6428, 63ifcld 4288 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ (1...𝑁))
6554, 59, 64rspcdva 3467 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁)))
6653, 65eqbrtrd 4831 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6766ralrimiva 3113 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
68 coprmproddvds 15657 . . 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...𝑁)))
6916, 22, 27, 44, 67, 68syl122anc 1498 . 2 (𝑁 ∈ ℕ0 → ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
7013, 69eqbrtrd 4831 1 (𝑁 ∈ ℕ0 → (#p𝑁) ∥ (lcm‘(1...𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 384   = wceq 1652  wcel 2155  wne 2937  wnel 3040  wral 3055  cdif 3729  wss 3732  ifcif 4243  {csn 4334   class class class wbr 4809  cmpt 4888  wf 6064  cfv 6068  (class class class)co 6842  Fincfn 8160  0cc0 10189  1c1 10190  cn 11274  0cn0 11538  cz 11624  cuz 11886  ...cfz 12533  cprod 14918  cdvds 15265   gcd cgcd 15497  lcmclcmf 15583  cprime 15665  #pcprmo 16014
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1890  ax-4 1904  ax-5 2005  ax-6 2070  ax-7 2105  ax-8 2157  ax-9 2164  ax-10 2183  ax-11 2198  ax-12 2211  ax-13 2352  ax-ext 2743  ax-rep 4930  ax-sep 4941  ax-nul 4949  ax-pow 5001  ax-pr 5062  ax-un 7147  ax-inf2 8753  ax-cnex 10245  ax-resscn 10246  ax-1cn 10247  ax-icn 10248  ax-addcl 10249  ax-addrcl 10250  ax-mulcl 10251  ax-mulrcl 10252  ax-mulcom 10253  ax-addass 10254  ax-mulass 10255  ax-distr 10256  ax-i2m1 10257  ax-1ne0 10258  ax-1rid 10259  ax-rnegex 10260  ax-rrecex 10261  ax-cnre 10262  ax-pre-lttri 10263  ax-pre-lttrn 10264  ax-pre-ltadd 10265  ax-pre-mulgt0 10266  ax-pre-sup 10267
This theorem depends on definitions:  df-bi 198  df-an 385  df-or 874  df-3or 1108  df-3an 1109  df-tru 1656  df-fal 1666  df-ex 1875  df-nf 1879  df-sb 2063  df-mo 2565  df-eu 2582  df-clab 2752  df-cleq 2758  df-clel 2761  df-nfc 2896  df-ne 2938  df-nel 3041  df-ral 3060  df-rex 3061  df-reu 3062  df-rmo 3063  df-rab 3064  df-v 3352  df-sbc 3597  df-csb 3692  df-dif 3735  df-un 3737  df-in 3739  df-ss 3746  df-pss 3748  df-nul 4080  df-if 4244  df-pw 4317  df-sn 4335  df-pr 4337  df-tp 4339  df-op 4341  df-uni 4595  df-int 4634  df-iun 4678  df-br 4810  df-opab 4872  df-mpt 4889  df-tr 4912  df-id 5185  df-eprel 5190  df-po 5198  df-so 5199  df-fr 5236  df-se 5237  df-we 5238  df-xp 5283  df-rel 5284  df-cnv 5285  df-co 5286  df-dm 5287  df-rn 5288  df-res 5289  df-ima 5290  df-pred 5865  df-ord 5911  df-on 5912  df-lim 5913  df-suc 5914  df-iota 6031  df-fun 6070  df-fn 6071  df-f 6072  df-f1 6073  df-fo 6074  df-f1o 6075  df-fv 6076  df-isom 6077  df-riota 6803  df-ov 6845  df-oprab 6846  df-mpt2 6847  df-om 7264  df-1st 7366  df-2nd 7367  df-wrecs 7610  df-recs 7672  df-rdg 7710  df-1o 7764  df-2o 7765  df-oadd 7768  df-er 7947  df-en 8161  df-dom 8162  df-sdom 8163  df-fin 8164  df-sup 8555  df-inf 8556  df-oi 8622  df-card 9016  df-pnf 10330  df-mnf 10331  df-xr 10332  df-ltxr 10333  df-le 10334  df-sub 10522  df-neg 10523  df-div 10939  df-nn 11275  df-2 11335  df-3 11336  df-n0 11539  df-z 11625  df-uz 11887  df-rp 12029  df-fz 12534  df-fzo 12674  df-fl 12801  df-mod 12877  df-seq 13009  df-exp 13068  df-hash 13322  df-cj 14124  df-re 14125  df-im 14126  df-sqrt 14260  df-abs 14261  df-clim 14504  df-prod 14919  df-dvds 15266  df-gcd 15498  df-lcmf 15585  df-prm 15666  df-prmo 16015
This theorem is referenced by:  prmolelcmf  16031
  Copyright terms: Public domain W3C validator