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

Theorem prmodvdslcmf 15957
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 15943 . . 3 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1))
2 eqidd 2771 . . . . . 6 (𝑘 ∈ (1...𝑁) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
3 simpr 471 . . . . . . . 8 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
43eleq1d 2834 . . . . . . 7 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
54, 3ifbieq1d 4246 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
6 elfznn 12576 . . . . . 6 (𝑘 ∈ (1...𝑁) → 𝑘 ∈ ℕ)
7 1nn 11232 . . . . . . . 8 1 ∈ ℕ
87a1i 11 . . . . . . 7 (𝑘 ∈ (1...𝑁) → 1 ∈ ℕ)
96, 8ifcld 4268 . . . . . 6 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℕ)
102, 5, 6, 9fvmptd 6430 . . . . 5 (𝑘 ∈ (1...𝑁) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
1110eqcomd 2776 . . . 4 (𝑘 ∈ (1...𝑁) → if(𝑘 ∈ ℙ, 𝑘, 1) = ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
1211prodeq2i 14855 . . 3 𝑘 ∈ (1...𝑁)if(𝑘 ∈ ℙ, 𝑘, 1) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘)
131, 12syl6eq 2820 . 2 (𝑁 ∈ ℕ0 → (#p𝑁) = ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘))
14 fzfid 12979 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ∈ Fin)
15 fz1ssnn 12578 . . . 4 (1...𝑁) ⊆ ℕ
1614, 15jctil 503 . . 3 (𝑁 ∈ ℕ0 → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
17 fzssz 12549 . . . . 5 (1...𝑁) ⊆ ℤ
1817a1i 11 . . . 4 (𝑁 ∈ ℕ0 → (1...𝑁) ⊆ ℤ)
19 0nelfz1 12566 . . . . 5 0 ∉ (1...𝑁)
2019a1i 11 . . . 4 (𝑁 ∈ ℕ0 → 0 ∉ (1...𝑁))
21 lcmfn0cl 15546 . . . 4 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin ∧ 0 ∉ (1...𝑁)) → (lcm‘(1...𝑁)) ∈ ℕ)
2218, 14, 20, 21syl3anc 1475 . . 3 (𝑁 ∈ ℕ0 → (lcm‘(1...𝑁)) ∈ ℕ)
23 id 22 . . . . . 6 (𝑚 ∈ ℕ → 𝑚 ∈ ℕ)
247a1i 11 . . . . . 6 (𝑚 ∈ ℕ → 1 ∈ ℕ)
2523, 24ifcld 4268 . . . . 5 (𝑚 ∈ ℕ → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
2625adantl 467 . . . 4 ((𝑁 ∈ ℕ0𝑚 ∈ ℕ) → if(𝑚 ∈ ℙ, 𝑚, 1) ∈ ℕ)
27 eqid 2770 . . . 4 (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))
2826, 27fmptd 6527 . . 3 (𝑁 ∈ ℕ0 → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)):ℕ⟶ℕ)
29 simpr 471 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ (1...𝑁))
3029adantr 466 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘 ∈ (1...𝑁))
31 eldifi 3881 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑥 ∈ (1...𝑁))
3231adantl 467 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑥 ∈ (1...𝑁))
33 eldif 3731 . . . . . . . 8 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) ↔ (𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}))
34 velsn 4330 . . . . . . . . . . . 12 (𝑥 ∈ {𝑘} ↔ 𝑥 = 𝑘)
3534biimpri 218 . . . . . . . . . . 11 (𝑥 = 𝑘𝑥 ∈ {𝑘})
3635equcoms 2104 . . . . . . . . . 10 (𝑘 = 𝑥𝑥 ∈ {𝑘})
3736necon3bi 2968 . . . . . . . . 9 𝑥 ∈ {𝑘} → 𝑘𝑥)
3837adantl 467 . . . . . . . 8 ((𝑥 ∈ (1...𝑁) ∧ ¬ 𝑥 ∈ {𝑘}) → 𝑘𝑥)
3933, 38sylbi 207 . . . . . . 7 (𝑥 ∈ ((1...𝑁) ∖ {𝑘}) → 𝑘𝑥)
4039adantl 467 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → 𝑘𝑥)
4127fvprmselgcd1 15955 . . . . . 6 ((𝑘 ∈ (1...𝑁) ∧ 𝑥 ∈ (1...𝑁) ∧ 𝑘𝑥) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4230, 32, 40, 41syl3anc 1475 . . . . 5 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑥 ∈ ((1...𝑁) ∖ {𝑘})) → (((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4342ralrimiva 3114 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
4443ralrimiva 3114 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)∀𝑥 ∈ ((1...𝑁) ∖ {𝑘})(((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) gcd ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑥)) = 1)
45 eqidd 2771 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)) = (𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1)))
46 simpr 471 . . . . . . . 8 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → 𝑚 = 𝑘)
4746eleq1d 2834 . . . . . . 7 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → (𝑚 ∈ ℙ ↔ 𝑘 ∈ ℙ))
4847, 46ifbieq1d 4246 . . . . . 6 (((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) ∧ 𝑚 = 𝑘) → if(𝑚 ∈ ℙ, 𝑚, 1) = if(𝑘 ∈ ℙ, 𝑘, 1))
4915, 29sseldi 3748 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℕ)
5017, 29sseldi 3748 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑘 ∈ ℤ)
51 1zzd 11609 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ ℤ)
5250, 51ifcld 4268 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ ℤ)
5345, 48, 49, 52fvmptd 6430 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) = if(𝑘 ∈ ℙ, 𝑘, 1))
54 breq1 4787 . . . . . 6 (𝑥 = if(𝑘 ∈ ℙ, 𝑘, 1) → (𝑥 ∥ (lcm‘(1...𝑁)) ↔ if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁))))
5516adantr 466 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin))
56172a1i 12 . . . . . . . 8 ((1...𝑁) ∈ Fin → ((1...𝑁) ⊆ ℕ → (1...𝑁) ⊆ ℤ))
5756imdistanri 551 . . . . . . 7 (((1...𝑁) ⊆ ℕ ∧ (1...𝑁) ∈ Fin) → ((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin))
58 dvdslcmf 15551 . . . . . . 7 (((1...𝑁) ⊆ ℤ ∧ (1...𝑁) ∈ Fin) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
5955, 57, 583syl 18 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ∀𝑥 ∈ (1...𝑁)𝑥 ∥ (lcm‘(1...𝑁)))
60 elfzuz2 12552 . . . . . . . . 9 (𝑘 ∈ (1...𝑁) → 𝑁 ∈ (ℤ‘1))
6160adantl 467 . . . . . . . 8 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 𝑁 ∈ (ℤ‘1))
62 eluzfz1 12554 . . . . . . . 8 (𝑁 ∈ (ℤ‘1) → 1 ∈ (1...𝑁))
6361, 62syl 17 . . . . . . 7 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → 1 ∈ (1...𝑁))
6429, 63ifcld 4268 . . . . . 6 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∈ (1...𝑁))
6554, 59, 64rspcdva 3464 . . . . 5 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → if(𝑘 ∈ ℙ, 𝑘, 1) ∥ (lcm‘(1...𝑁)))
6653, 65eqbrtrd 4806 . . . 4 ((𝑁 ∈ ℕ0𝑘 ∈ (1...𝑁)) → ((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
6766ralrimiva 3114 . . 3 (𝑁 ∈ ℕ0 → ∀𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
68 coprmproddvds 15583 . . 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, 28, 44, 67, 68syl122anc 1484 . 2 (𝑁 ∈ ℕ0 → ∏𝑘 ∈ (1...𝑁)((𝑚 ∈ ℕ ↦ if(𝑚 ∈ ℙ, 𝑚, 1))‘𝑘) ∥ (lcm‘(1...𝑁)))
7013, 69eqbrtrd 4806 1 (𝑁 ∈ ℕ0 → (#p𝑁) ∥ (lcm‘(1...𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 382   = wceq 1630  wcel 2144  wne 2942  wnel 3045  wral 3060  cdif 3718  wss 3721  ifcif 4223  {csn 4314   class class class wbr 4784  cmpt 4861  wf 6027  cfv 6031  (class class class)co 6792  Fincfn 8108  0cc0 10137  1c1 10138  cn 11221  0cn0 11493  cz 11578  cuz 11887  ...cfz 12532  cprod 14841  cdvds 15188   gcd cgcd 15423  lcmclcmf 15509  cprime 15591  #pcprmo 15941
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1869  ax-4 1884  ax-5 1990  ax-6 2056  ax-7 2092  ax-8 2146  ax-9 2153  ax-10 2173  ax-11 2189  ax-12 2202  ax-13 2407  ax-ext 2750  ax-rep 4902  ax-sep 4912  ax-nul 4920  ax-pow 4971  ax-pr 5034  ax-un 7095  ax-inf2 8701  ax-cnex 10193  ax-resscn 10194  ax-1cn 10195  ax-icn 10196  ax-addcl 10197  ax-addrcl 10198  ax-mulcl 10199  ax-mulrcl 10200  ax-mulcom 10201  ax-addass 10202  ax-mulass 10203  ax-distr 10204  ax-i2m1 10205  ax-1ne0 10206  ax-1rid 10207  ax-rnegex 10208  ax-rrecex 10209  ax-cnre 10210  ax-pre-lttri 10211  ax-pre-lttrn 10212  ax-pre-ltadd 10213  ax-pre-mulgt0 10214  ax-pre-sup 10215
This theorem depends on definitions:  df-bi 197  df-an 383  df-or 827  df-3or 1071  df-3an 1072  df-tru 1633  df-fal 1636  df-ex 1852  df-nf 1857  df-sb 2049  df-eu 2621  df-mo 2622  df-clab 2757  df-cleq 2763  df-clel 2766  df-nfc 2901  df-ne 2943  df-nel 3046  df-ral 3065  df-rex 3066  df-reu 3067  df-rmo 3068  df-rab 3069  df-v 3351  df-sbc 3586  df-csb 3681  df-dif 3724  df-un 3726  df-in 3728  df-ss 3735  df-pss 3737  df-nul 4062  df-if 4224  df-pw 4297  df-sn 4315  df-pr 4317  df-tp 4319  df-op 4321  df-uni 4573  df-int 4610  df-iun 4654  df-br 4785  df-opab 4845  df-mpt 4862  df-tr 4885  df-id 5157  df-eprel 5162  df-po 5170  df-so 5171  df-fr 5208  df-se 5209  df-we 5210  df-xp 5255  df-rel 5256  df-cnv 5257  df-co 5258  df-dm 5259  df-rn 5260  df-res 5261  df-ima 5262  df-pred 5823  df-ord 5869  df-on 5870  df-lim 5871  df-suc 5872  df-iota 5994  df-fun 6033  df-fn 6034  df-f 6035  df-f1 6036  df-fo 6037  df-f1o 6038  df-fv 6039  df-isom 6040  df-riota 6753  df-ov 6795  df-oprab 6796  df-mpt2 6797  df-om 7212  df-1st 7314  df-2nd 7315  df-wrecs 7558  df-recs 7620  df-rdg 7658  df-1o 7712  df-2o 7713  df-oadd 7716  df-er 7895  df-en 8109  df-dom 8110  df-sdom 8111  df-fin 8112  df-sup 8503  df-inf 8504  df-oi 8570  df-card 8964  df-pnf 10277  df-mnf 10278  df-xr 10279  df-ltxr 10280  df-le 10281  df-sub 10469  df-neg 10470  df-div 10886  df-nn 11222  df-2 11280  df-3 11281  df-n0 11494  df-z 11579  df-uz 11888  df-rp 12035  df-fz 12533  df-fzo 12673  df-fl 12800  df-mod 12876  df-seq 13008  df-exp 13067  df-hash 13321  df-cj 14046  df-re 14047  df-im 14048  df-sqrt 14182  df-abs 14183  df-clim 14426  df-prod 14842  df-dvds 15189  df-gcd 15424  df-lcmf 15511  df-prm 15592  df-prmo 15942
This theorem is referenced by:  prmolelcmf  15958
  Copyright terms: Public domain W3C validator