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

Theorem prmodvdslcmf 15798
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 15784 . . 3 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1))
2 eqidd 2652 . . . . . 6 (𝑘 ∈ (1...𝑁) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
3 simpr 476 . . . . . . . 8 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
43eleq1d 2715 . . . . . . 7 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
54, 3ifbieq1d 4142 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
6 elfznn 12408 . . . . . 6 (𝑘 ∈ (1...𝑁) → 𝑘 ∈ ℕ)
7 1nn 11069 . . . . . . . 8 1 ∈ ℕ
87a1i 11 . . . . . . 7 (𝑘 ∈ (1...𝑁) → 1 ∈ ℕ)
96, 8ifcld 4164 . . . . . 6 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
102, 5, 6, 9fvmptd 6327 . . . . 5 (𝑘 ∈ (1...𝑁) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
1110eqcomd 2657 . . . 4 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) = ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
1211prodeq2i 14693 . . 3 𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)
131, 12syl6eq 2701 . 2 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
14 fzfid 12812 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ∈ Fin)
15 fz1ssnn 12410 . . . 4 (1...𝑁) ⊆ ℕ
1614, 15jctil 559 . . 3 (𝑁 ∈ ℕ0 → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
17 fzssz 12381 . . . . 5 (1...𝑁) ⊆ ℤ
1817a1i 11 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ⊆ ℤ)
19 0nelfz1 12398 . . . . 5 0 ∉ (1...𝑁)
2019a1i 11 . . . 4 (𝑁 ∈ ℕ0 → 0 ∉ (1...𝑁))
21 lcmfn0cl 15386 . . . 4 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin ∧ 0 ∉ (1...𝑁)) → (lcm‘(1...𝑁)) ∈ ℕ)
2218, 14, 20, 21syl3anc 1366 . . 3 (𝑁 ∈ ℕ0 → (lcm‘(1...𝑁)) ∈ ℕ)
23 id 22 . . . . . 6 (𝑚 ∈ ℕ → 𝑚 ∈ ℕ)
247a1i 11 . . . . . 6 (𝑚 ∈ ℕ → 1 ∈ ℕ)
2523, 24ifcld 4164 . . . . 5 (𝑚 ∈ ℕ → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2625adantl 481 . . . 4 ((𝑁 ∈ ℕ0𝑚 ∈ ℕ) → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
27 eqid 2651 . . . 4 (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))
2826, 27fmptd 6425 . . 3 (𝑁 ∈ ℕ0 → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)):ℕ⟶ℕ)
29 simpr 476 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ (1...𝑁))
3029adantr 480 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘 ∈ (1...𝑁))
31 eldifi 3765 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑥 ∈ (1...𝑁))
3231adantl 481 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑥 ∈ (1...𝑁))
33 eldif 3617 . . . . . . . 8 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) ↔ (𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}))
34 velsn 4226 . . . . . . . . . . . 12 (𝑥 ∈ {𝑘} ↔ 𝑥 = 𝑘)
3534biimpri 218 . . . . . . . . . . 11 (𝑥 = 𝑘𝑥 ∈ {𝑘})
3635equcoms 1993 . . . . . . . . . 10 (𝑘 = 𝑥𝑥 ∈ {𝑘})
3736necon3bi 2849 . . . . . . . . 9 𝑥 ∈ {𝑘} → 𝑘𝑥)
3837adantl 481 . . . . . . . 8 ((𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}) → 𝑘𝑥)
3933, 38sylbi 207 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑘𝑥)
4039adantl 481 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘𝑥)
4127fvprmselgcd1 15796 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑥 ∈ (1...𝑁) ∧ 𝑘𝑥) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4230, 32, 40, 41syl3anc 1366 . . . . 5 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4342ralrimiva 2995 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4443ralrimiva 2995 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
45 eqidd 2652 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
46 simpr 476 . . . . . . . 8 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
4746eleq1d 2715 . . . . . . 7 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
4847, 46ifbieq1d 4142 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
4915, 29sseldi 3634 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℕ)
5017, 29sseldi 3634 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℤ)
51 1zzd 11446 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ ℤ)
5250, 51ifcld 4164 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
5345, 48, 49, 52fvmptd 6327 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
54 elfzuz2 12384 . . . . . . . . 9 (𝑘 ∈ (1...𝑁) → 𝑁 ∈ (ℤ‘1))
5554adantl 481 . . . . . . . 8 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑁 ∈ (ℤ‘1))
56 eluzfz1 12386 . . . . . . . 8 (𝑁 ∈ (ℤ‘1) → 1 ∈ (1...𝑁))
5755, 56syl 17 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ (1...𝑁))
5829, 57ifcld 4164 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ (1...𝑁))
5916adantr 480 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
60172a1i 12 . . . . . . . 8 ((1...𝑁) ∈ Fin → ((1...𝑁) ⊆ ℕ → (1...𝑁) ⊆ ℤ))
6160imdistanri 727 . . . . . . 7 (((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin) → ((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin))
62 dvdslcmf 15391 . . . . . . 7 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
6359, 61, 623syl 18 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
64 breq1 4688 . . . . . . 7 (𝑥 = if(𝑘 ∈ ℙ, 𝑘, 1) → (𝑥 ∥ (lcm‘(1...𝑁)) ↔ if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁))))
6564rspcv 3336 . . . . . 6 (if(𝑘 ∈ ℙ, 𝑘, 1) ∈ (1...𝑁) → (∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁))))
6658, 63, 65sylc 65 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁)))
6753, 66eqbrtrd 4707 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6867ralrimiva 2995 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
69 coprmproddvds 15424 . . 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...𝑁)))
7016, 22, 28, 44, 68, 69syl122anc 1375 . 2 (𝑁 ∈ ℕ0 → ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
7113, 70eqbrtrd 4707 1 (𝑁 ∈ ℕ0 → (#p𝑁) ∥ (lcm‘(1...𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 383   = wceq 1523  wcel 2030  wne 2823  wnel 2926  wral 2941  cdif 3604  wss 3607  ifcif 4119  {csn 4210   class class class wbr 4685  cmpt 4762  wf 5922  cfv 5926  (class class class)co 6690  Fincfn 7997  0cc0 9974  1c1 9975  cn 11058  0cn0 11330  cz 11415  cuz 11725  ...cfz 12364  cprod 14679  cdvds 15027   gcd cgcd 15263  lcmclcmf 15349  cprime 15432  #pcprmo 15782
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1762  ax-4 1777  ax-5 1879  ax-6 1945  ax-7 1981  ax-8 2032  ax-9 2039  ax-10 2059  ax-11 2074  ax-12 2087  ax-13 2282  ax-ext 2631  ax-rep 4804  ax-sep 4814  ax-nul 4822  ax-pow 4873  ax-pr 4936  ax-un 6991  ax-inf2 8576  ax-cnex 10030  ax-resscn 10031  ax-1cn 10032  ax-icn 10033  ax-addcl 10034  ax-addrcl 10035  ax-mulcl 10036  ax-mulrcl 10037  ax-mulcom 10038  ax-addass 10039  ax-mulass 10040  ax-distr 10041  ax-i2m1 10042  ax-1ne0 10043  ax-1rid 10044  ax-rnegex 10045  ax-rrecex 10046  ax-cnre 10047  ax-pre-lttri 10048  ax-pre-lttrn 10049  ax-pre-ltadd 10050  ax-pre-mulgt0 10051  ax-pre-sup 10052
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1055  df-3an 1056  df-tru 1526  df-fal 1529  df-ex 1745  df-nf 1750  df-sb 1938  df-eu 2502  df-mo 2503  df-clab 2638  df-cleq 2644  df-clel 2647  df-nfc 2782  df-ne 2824  df-nel 2927  df-ral 2946  df-rex 2947  df-reu 2948  df-rmo 2949  df-rab 2950  df-v 3233  df-sbc 3469  df-csb 3567  df-dif 3610  df-un 3612  df-in 3614  df-ss 3621  df-pss 3623  df-nul 3949  df-if 4120  df-pw 4193  df-sn 4211  df-pr 4213  df-tp 4215  df-op 4217  df-uni 4469  df-int 4508  df-iun 4554  df-br 4686  df-opab 4746  df-mpt 4763  df-tr 4786  df-id 5053  df-eprel 5058  df-po 5064  df-so 5065  df-fr 5102  df-se 5103  df-we 5104  df-xp 5149  df-rel 5150  df-cnv 5151  df-co 5152  df-dm 5153  df-rn 5154  df-res 5155  df-ima 5156  df-pred 5718  df-ord 5764  df-on 5765  df-lim 5766  df-suc 5767  df-iota 5889  df-fun 5928  df-fn 5929  df-f 5930  df-f1 5931  df-fo 5932  df-f1o 5933  df-fv 5934  df-isom 5935  df-riota 6651  df-ov 6693  df-oprab 6694  df-mpt2 6695  df-om 7108  df-1st 7210  df-2nd 7211  df-wrecs 7452  df-recs 7513  df-rdg 7551  df-1o 7605  df-2o 7606  df-oadd 7609  df-er 7787  df-en 7998  df-dom 7999  df-sdom 8000  df-fin 8001  df-sup 8389  df-inf 8390  df-oi 8456  df-card 8803  df-pnf 10114  df-mnf 10115  df-xr 10116  df-ltxr 10117  df-le 10118  df-sub 10306  df-neg 10307  df-div 10723  df-nn 11059  df-2 11117  df-3 11118  df-n0 11331  df-z 11416  df-uz 11726  df-rp 11871  df-fz 12365  df-fzo 12505  df-fl 12633  df-mod 12709  df-seq 12842  df-exp 12901  df-hash 13158  df-cj 13883  df-re 13884  df-im 13885  df-sqrt 14019  df-abs 14020  df-clim 14263  df-prod 14680  df-dvds 15028  df-gcd 15264  df-lcmf 15351  df-prm 15433  df-prmo 15783
This theorem is referenced by:  prmolelcmf  15799
  Copyright terms: Public domain W3C validator