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

Theorem prmodvdslcmf 14983
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  |-  ( N  e.  NN0  ->  (#p `  N
)  ||  (lcm `  (
1 ... N ) ) )

Proof of Theorem prmodvdslcmf
Dummy variables  k  m  x are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 prmoval 14969 . . 3  |-  ( N  e.  NN0  ->  (#p `  N
)  =  prod_ k  e.  ( 1 ... N
) if ( k  e.  Prime ,  k ,  1 ) )
2 eqidd 2421 . . . . . 6  |-  ( k  e.  ( 1 ... N )  ->  (
m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) )  =  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) )
3 simpr 462 . . . . . . . 8  |-  ( ( k  e.  ( 1 ... N )  /\  m  =  k )  ->  m  =  k )
43eleq1d 2489 . . . . . . 7  |-  ( ( k  e.  ( 1 ... N )  /\  m  =  k )  ->  ( m  e.  Prime  <->  k  e.  Prime ) )
54, 3ifbieq1d 3929 . . . . . 6  |-  ( ( k  e.  ( 1 ... N )  /\  m  =  k )  ->  if ( m  e. 
Prime ,  m , 
1 )  =  if ( k  e.  Prime ,  k ,  1 ) )
6 elfznn 11822 . . . . . 6  |-  ( k  e.  ( 1 ... N )  ->  k  e.  NN )
7 1nn 10616 . . . . . . . 8  |-  1  e.  NN
87a1i 11 . . . . . . 7  |-  ( k  e.  ( 1 ... N )  ->  1  e.  NN )
96, 8ifcld 3949 . . . . . 6  |-  ( k  e.  ( 1 ... N )  ->  if ( k  e.  Prime ,  k ,  1 )  e.  NN )
102, 5, 6, 9fvmptd 5962 . . . . 5  |-  ( k  e.  ( 1 ... N )  ->  (
( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  =  if ( k  e.  Prime ,  k ,  1 ) )
1110eqcomd 2428 . . . 4  |-  ( k  e.  ( 1 ... N )  ->  if ( k  e.  Prime ,  k ,  1 )  =  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k ) )
1211prodeq2i 13951 . . 3  |-  prod_ k  e.  ( 1 ... N
) if ( k  e.  Prime ,  k ,  1 )  =  prod_ k  e.  ( 1 ... N ) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )
131, 12syl6eq 2477 . 2  |-  ( N  e.  NN0  ->  (#p `  N
)  =  prod_ k  e.  ( 1 ... N
) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k ) )
14 fzfid 12179 . . . 4  |-  ( N  e.  NN0  ->  ( 1 ... N )  e. 
Fin )
15 fz1ssnn 11824 . . . 4  |-  ( 1 ... N )  C_  NN
1614, 15jctil 539 . . 3  |-  ( N  e.  NN0  ->  ( ( 1 ... N ) 
C_  NN  /\  (
1 ... N )  e. 
Fin ) )
17 fzssz 11795 . . . . 5  |-  ( 1 ... N )  C_  ZZ
1817a1i 11 . . . 4  |-  ( N  e.  NN0  ->  ( 1 ... N )  C_  ZZ )
19 0nelfz1 11812 . . . . 5  |-  0  e/  ( 1 ... N
)
2019a1i 11 . . . 4  |-  ( N  e.  NN0  ->  0  e/  ( 1 ... N
) )
21 lcmfn0cl 14577 . . . 4  |-  ( ( ( 1 ... N
)  C_  ZZ  /\  (
1 ... N )  e. 
Fin  /\  0  e/  ( 1 ... N
) )  ->  (lcm `  ( 1 ... N
) )  e.  NN )
2218, 14, 20, 21syl3anc 1264 . . 3  |-  ( N  e.  NN0  ->  (lcm `  (
1 ... N ) )  e.  NN )
23 id 23 . . . . . 6  |-  ( m  e.  NN  ->  m  e.  NN )
247a1i 11 . . . . . 6  |-  ( m  e.  NN  ->  1  e.  NN )
2523, 24ifcld 3949 . . . . 5  |-  ( m  e.  NN  ->  if ( m  e.  Prime ,  m ,  1 )  e.  NN )
2625adantl 467 . . . 4  |-  ( ( N  e.  NN0  /\  m  e.  NN )  ->  if ( m  e. 
Prime ,  m , 
1 )  e.  NN )
27 eqid 2420 . . . 4  |-  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) )  =  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) )
2826, 27fmptd 6053 . . 3  |-  ( N  e.  NN0  ->  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) : NN --> NN )
29 simpr 462 . . . . . . 7  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  k  e.  ( 1 ... N ) )
3029adantr 466 . . . . . 6  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  x  e.  ( ( 1 ... N
)  \  { k } ) )  -> 
k  e.  ( 1 ... N ) )
31 eldifi 3584 . . . . . . 7  |-  ( x  e.  ( ( 1 ... N )  \  { k } )  ->  x  e.  ( 1 ... N ) )
3231adantl 467 . . . . . 6  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  x  e.  ( ( 1 ... N
)  \  { k } ) )  ->  x  e.  ( 1 ... N ) )
33 eldif 3443 . . . . . . . 8  |-  ( x  e.  ( ( 1 ... N )  \  { k } )  <-> 
( x  e.  ( 1 ... N )  /\  -.  x  e. 
{ k } ) )
34 elsn 4007 . . . . . . . . . . . 12  |-  ( x  e.  { k }  <-> 
x  =  k )
3534biimpri 209 . . . . . . . . . . 11  |-  ( x  =  k  ->  x  e.  { k } )
3635equcoms 1844 . . . . . . . . . 10  |-  ( k  =  x  ->  x  e.  { k } )
3736necon3bi 2651 . . . . . . . . 9  |-  ( -.  x  e.  { k }  ->  k  =/=  x )
3837adantl 467 . . . . . . . 8  |-  ( ( x  e.  ( 1 ... N )  /\  -.  x  e.  { k } )  ->  k  =/=  x )
3933, 38sylbi 198 . . . . . . 7  |-  ( x  e.  ( ( 1 ... N )  \  { k } )  ->  k  =/=  x
)
4039adantl 467 . . . . . 6  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  x  e.  ( ( 1 ... N
)  \  { k } ) )  -> 
k  =/=  x )
4127fvprmselgcd1 14981 . . . . . 6  |-  ( ( k  e.  ( 1 ... N )  /\  x  e.  ( 1 ... N )  /\  k  =/=  x )  -> 
( ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  gcd  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  x ) )  =  1 )
4230, 32, 40, 41syl3anc 1264 . . . . 5  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  x  e.  ( ( 1 ... N
)  \  { k } ) )  -> 
( ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  gcd  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  x ) )  =  1 )
4342ralrimiva 2837 . . . 4  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  A. x  e.  ( ( 1 ... N
)  \  { k } ) ( ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  gcd  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 x ) )  =  1 )
4443ralrimiva 2837 . . 3  |-  ( N  e.  NN0  ->  A. k  e.  ( 1 ... N
) A. x  e.  ( ( 1 ... N )  \  {
k } ) ( ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  gcd  (
( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  x ) )  =  1 )
45 eqidd 2421 . . . . . 6  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) )  =  ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) )
46 simpr 462 . . . . . . . 8  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  m  =  k )  ->  m  =  k )
4746eleq1d 2489 . . . . . . 7  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  m  =  k )  ->  ( m  e.  Prime 
<->  k  e.  Prime )
)
4847, 46ifbieq1d 3929 . . . . . 6  |-  ( ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  /\  m  =  k )  ->  if (
m  e.  Prime ,  m ,  1 )  =  if ( k  e. 
Prime ,  k , 
1 ) )
4915, 29sseldi 3459 . . . . . 6  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  k  e.  NN )
5017, 29sseldi 3459 . . . . . . 7  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  k  e.  ZZ )
51 1zzd 10964 . . . . . . 7  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  1  e.  ZZ )
5250, 51ifcld 3949 . . . . . 6  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  if ( k  e.  Prime ,  k ,  1 )  e.  ZZ )
5345, 48, 49, 52fvmptd 5962 . . . . 5  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  =  if ( k  e. 
Prime ,  k , 
1 ) )
54 elfzuz2 11798 . . . . . . . . 9  |-  ( k  e.  ( 1 ... N )  ->  N  e.  ( ZZ>= `  1 )
)
5554adantl 467 . . . . . . . 8  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  N  e.  (
ZZ>= `  1 ) )
56 eluzfz1 11800 . . . . . . . 8  |-  ( N  e.  ( ZZ>= `  1
)  ->  1  e.  ( 1 ... N
) )
5755, 56syl 17 . . . . . . 7  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  1  e.  ( 1 ... N ) )
5829, 57ifcld 3949 . . . . . 6  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  if ( k  e.  Prime ,  k ,  1 )  e.  ( 1 ... N ) )
5916adantr 466 . . . . . . 7  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  ( ( 1 ... N )  C_  NN  /\  ( 1 ... N )  e.  Fin ) )
60172a1i 12 . . . . . . . 8  |-  ( ( 1 ... N )  e.  Fin  ->  (
( 1 ... N
)  C_  NN  ->  ( 1 ... N ) 
C_  ZZ ) )
6160imdistanri 695 . . . . . . 7  |-  ( ( ( 1 ... N
)  C_  NN  /\  (
1 ... N )  e. 
Fin )  ->  (
( 1 ... N
)  C_  ZZ  /\  (
1 ... N )  e. 
Fin ) )
62 dvdslcmf 14582 . . . . . . 7  |-  ( ( ( 1 ... N
)  C_  ZZ  /\  (
1 ... N )  e. 
Fin )  ->  A. x  e.  ( 1 ... N
) x  ||  (lcm `  ( 1 ... N
) ) )
6359, 61, 623syl 18 . . . . . 6  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  A. x  e.  ( 1 ... N ) x  ||  (lcm `  (
1 ... N ) ) )
64 breq1 4420 . . . . . . 7  |-  ( x  =  if ( k  e.  Prime ,  k ,  1 )  ->  (
x  ||  (lcm `  (
1 ... N ) )  <-> 
if ( k  e. 
Prime ,  k , 
1 )  ||  (lcm `  ( 1 ... N
) ) ) )
6564rspcv 3175 . . . . . 6  |-  ( if ( k  e.  Prime ,  k ,  1 )  e.  ( 1 ... N )  ->  ( A. x  e.  (
1 ... N ) x 
||  (lcm `  ( 1 ... N ) )  ->  if ( k  e.  Prime ,  k ,  1 ) 
||  (lcm `  ( 1 ... N ) ) ) )
6658, 63, 65sylc 62 . . . . 5  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  if ( k  e.  Prime ,  k ,  1 )  ||  (lcm `  ( 1 ... N
) ) )
6753, 66eqbrtrd 4438 . . . 4  |-  ( ( N  e.  NN0  /\  k  e.  ( 1 ... N ) )  ->  ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  ||  (lcm `
 ( 1 ... N ) ) )
6867ralrimiva 2837 . . 3  |-  ( N  e.  NN0  ->  A. k  e.  ( 1 ... N
) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  ||  (lcm `
 ( 1 ... N ) ) )
69 coprmproddvds 14658 . . 3  |-  ( ( ( ( 1 ... N )  C_  NN  /\  ( 1 ... N
)  e.  Fin )  /\  ( (lcm `  (
1 ... N ) )  e.  NN  /\  (
m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) : NN --> NN )  /\  ( A. k  e.  ( 1 ... N
) A. x  e.  ( ( 1 ... N )  \  {
k } ) ( ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  gcd  (
( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  x ) )  =  1  /\ 
A. k  e.  ( 1 ... N ) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  ||  (lcm `  ( 1 ... N
) ) ) )  ->  prod_ k  e.  ( 1 ... N ) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `  k )  ||  (lcm `  ( 1 ... N
) ) )
7016, 22, 28, 44, 68, 69syl122anc 1273 . 2  |-  ( N  e.  NN0  ->  prod_ k  e.  ( 1 ... N
) ( ( m  e.  NN  |->  if ( m  e.  Prime ,  m ,  1 ) ) `
 k )  ||  (lcm `
 ( 1 ... N ) ) )
7113, 70eqbrtrd 4438 1  |-  ( N  e.  NN0  ->  (#p `  N
)  ||  (lcm `  (
1 ... N ) ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 370    = wceq 1437    e. wcel 1867    =/= wne 2616    e/ wnel 2617   A.wral 2773    \ cdif 3430    C_ wss 3433   ifcif 3906   {csn 3993   class class class wbr 4417    |-> cmpt 4476   -->wf 5589   ` cfv 5593  (class class class)co 6297   Fincfn 7569   0cc0 9535   1c1 9536   NNcn 10605   NN0cn0 10865   ZZcz 10933   ZZ>=cuz 11155   ...cfz 11778   prod_cprod 13937    || cdvds 14283    gcd cgcd 14446  lcmclcmf 14526   Primecprime 14600  #pcprmo 14967
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1665  ax-4 1678  ax-5 1748  ax-6 1794  ax-7 1838  ax-8 1869  ax-9 1871  ax-10 1886  ax-11 1891  ax-12 1904  ax-13 2052  ax-ext 2398  ax-rep 4530  ax-sep 4540  ax-nul 4548  ax-pow 4595  ax-pr 4653  ax-un 6589  ax-inf2 8144  ax-cnex 9591  ax-resscn 9592  ax-1cn 9593  ax-icn 9594  ax-addcl 9595  ax-addrcl 9596  ax-mulcl 9597  ax-mulrcl 9598  ax-mulcom 9599  ax-addass 9600  ax-mulass 9601  ax-distr 9602  ax-i2m1 9603  ax-1ne0 9604  ax-1rid 9605  ax-rnegex 9606  ax-rrecex 9607  ax-cnre 9608  ax-pre-lttri 9609  ax-pre-lttrn 9610  ax-pre-ltadd 9611  ax-pre-mulgt0 9612  ax-pre-sup 9613
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-tru 1440  df-fal 1443  df-ex 1660  df-nf 1664  df-sb 1787  df-eu 2267  df-mo 2268  df-clab 2406  df-cleq 2412  df-clel 2415  df-nfc 2570  df-ne 2618  df-nel 2619  df-ral 2778  df-rex 2779  df-reu 2780  df-rmo 2781  df-rab 2782  df-v 3080  df-sbc 3297  df-csb 3393  df-dif 3436  df-un 3438  df-in 3440  df-ss 3447  df-pss 3449  df-nul 3759  df-if 3907  df-pw 3978  df-sn 3994  df-pr 3996  df-tp 3998  df-op 4000  df-uni 4214  df-int 4250  df-iun 4295  df-br 4418  df-opab 4477  df-mpt 4478  df-tr 4513  df-eprel 4757  df-id 4761  df-po 4767  df-so 4768  df-fr 4805  df-se 4806  df-we 4807  df-xp 4852  df-rel 4853  df-cnv 4854  df-co 4855  df-dm 4856  df-rn 4857  df-res 4858  df-ima 4859  df-pred 5391  df-ord 5437  df-on 5438  df-lim 5439  df-suc 5440  df-iota 5557  df-fun 5595  df-fn 5596  df-f 5597  df-f1 5598  df-fo 5599  df-f1o 5600  df-fv 5601  df-isom 5602  df-riota 6259  df-ov 6300  df-oprab 6301  df-mpt2 6302  df-om 6699  df-1st 6799  df-2nd 6800  df-wrecs 7028  df-recs 7090  df-rdg 7128  df-1o 7182  df-2o 7183  df-oadd 7186  df-er 7363  df-en 7570  df-dom 7571  df-sdom 7572  df-fin 7573  df-sup 7954  df-inf 7955  df-oi 8023  df-card 8370  df-pnf 9673  df-mnf 9674  df-xr 9675  df-ltxr 9676  df-le 9677  df-sub 9858  df-neg 9859  df-div 10266  df-nn 10606  df-2 10664  df-3 10665  df-n0 10866  df-z 10934  df-uz 11156  df-rp 11299  df-fz 11779  df-fzo 11910  df-fl 12021  df-mod 12090  df-seq 12207  df-exp 12266  df-hash 12509  df-cj 13141  df-re 13142  df-im 13143  df-sqrt 13277  df-abs 13278  df-clim 13530  df-prod 13938  df-dvds 14284  df-gcd 14447  df-lcmf 14531  df-prm 14601  df-prmo 14968
This theorem is referenced by:  prmolelcmf  14984
  Copyright terms: Public domain W3C validator