Users' Mathboxes Mathbox for Stefan O'Rear < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  hashgcdeq Unicode version

Theorem hashgcdeq 26665
Description: Number of initial natural numbers with specified divisors. (Contributed by Stefan O'Rear, 12-Sep-2015.)
Assertion
Ref Expression
hashgcdeq  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 ) )
Distinct variable groups:    x, M    x, N

Proof of Theorem hashgcdeq
Dummy variables  z 
y are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 eqeq2 2325 . 2  |-  ( ( phi `  ( M  /  N ) )  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 )  -> 
( ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  ( phi `  ( M  /  N
) )  <->  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 ) ) )
2 eqeq2 2325 . 2  |-  ( 0  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 )  -> 
( ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  0  <->  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 ) ) )
3 nndivdvds 12584 . . . . 5  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( N  ||  M  <->  ( M  /  N )  e.  NN ) )
43biimpa 470 . . . 4  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  N  ||  M
)  ->  ( M  /  N )  e.  NN )
5 dfphi2 12889 . . . 4  |-  ( ( M  /  N )  e.  NN  ->  ( phi `  ( M  /  N ) )  =  ( # `  {
y  e.  ( 0..^ ( M  /  N
) )  |  ( y  gcd  ( M  /  N ) )  =  1 } ) )
64, 5syl 15 . . 3  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  N  ||  M
)  ->  ( phi `  ( M  /  N
) )  =  (
# `  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N
) )  =  1 } ) )
7 eqid 2316 . . . . . 6  |-  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  =  {
y  e.  ( 0..^ ( M  /  N
) )  |  ( y  gcd  ( M  /  N ) )  =  1 }
8 eqid 2316 . . . . . 6  |-  { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }  =  { x  e.  ( 0..^ M )  |  ( x  gcd  M
)  =  N }
9 eqid 2316 . . . . . 6  |-  ( z  e.  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N
) )  =  1 }  |->  ( z  x.  N ) )  =  ( z  e.  {
y  e.  ( 0..^ ( M  /  N
) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  |->  ( z  x.  N ) )
107, 8, 9hashgcdlem 26664 . . . . 5  |-  ( ( M  e.  NN  /\  N  e.  NN  /\  N  ||  M )  ->  (
z  e.  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  |->  ( z  x.  N ) ) : { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N
) )  =  1 } -1-1-onto-> { x  e.  ( 0..^ M )  |  ( x  gcd  M
)  =  N }
)
11103expa 1151 . . . 4  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  N  ||  M
)  ->  ( z  e.  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  |->  ( z  x.  N ) ) : { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 } -1-1-onto-> { x  e.  ( 0..^ M )  |  ( x  gcd  M
)  =  N }
)
12 ovex 5925 . . . . . 6  |-  ( 0..^ ( M  /  N
) )  e.  _V
1312rabex 4202 . . . . 5  |-  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  e.  _V
1413f1oen 6925 . . . 4  |-  ( ( z  e.  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  |->  ( z  x.  N ) ) : { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N
) )  =  1 } -1-1-onto-> { x  e.  ( 0..^ M )  |  ( x  gcd  M
)  =  N }  ->  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  ~~  { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )
15 hasheni 11394 . . . 4  |-  ( { y  e.  ( 0..^ ( M  /  N
) )  |  ( y  gcd  ( M  /  N ) )  =  1 }  ~~  { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }  ->  (
# `  { y  e.  ( 0..^ ( M  /  N ) )  |  ( y  gcd  ( M  /  N
) )  =  1 } )  =  (
# `  { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }
) )
1611, 14, 153syl 18 . . 3  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  N  ||  M
)  ->  ( # `  {
y  e.  ( 0..^ ( M  /  N
) )  |  ( y  gcd  ( M  /  N ) )  =  1 } )  =  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } ) )
176, 16eqtr2d 2349 . 2  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  N  ||  M
)  ->  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  ( phi `  ( M  /  N
) ) )
18 simprr 733 . . . . . . . . . 10  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  ( x  gcd  M )  =  N )
19 elfzoelz 10922 . . . . . . . . . . . . 13  |-  ( x  e.  ( 0..^ M )  ->  x  e.  ZZ )
2019ad2antrl 708 . . . . . . . . . . . 12  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  x  e.  ZZ )
21 nnz 10092 . . . . . . . . . . . . 13  |-  ( M  e.  NN  ->  M  e.  ZZ )
2221ad2antrr 706 . . . . . . . . . . . 12  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  M  e.  ZZ )
23 gcddvds 12741 . . . . . . . . . . . 12  |-  ( ( x  e.  ZZ  /\  M  e.  ZZ )  ->  ( ( x  gcd  M )  ||  x  /\  ( x  gcd  M ) 
||  M ) )
2420, 22, 23syl2anc 642 . . . . . . . . . . 11  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  ( (
x  gcd  M )  ||  x  /\  (
x  gcd  M )  ||  M ) )
2524simprd 449 . . . . . . . . . 10  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  ( x  gcd  M )  ||  M
)
2618, 25eqbrtrrd 4082 . . . . . . . . 9  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  ( x  e.  ( 0..^ M )  /\  ( x  gcd  M )  =  N ) )  ->  N  ||  M
)
2726expr 598 . . . . . . . 8  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  x  e.  ( 0..^ M ) )  ->  ( ( x  gcd  M )  =  N  ->  N  ||  M
) )
2827con3d 125 . . . . . . 7  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  x  e.  ( 0..^ M ) )  ->  ( -.  N  ||  M  ->  -.  (
x  gcd  M )  =  N ) )
2928impancom 427 . . . . . 6  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  -.  N  ||  M )  ->  (
x  e.  ( 0..^ M )  ->  -.  ( x  gcd  M )  =  N ) )
3029ralrimiv 2659 . . . . 5  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  -.  N  ||  M )  ->  A. x  e.  ( 0..^ M )  -.  ( x  gcd  M )  =  N )
31 rabeq0 3510 . . . . 5  |-  ( { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }  =  (/)  <->  A. x  e.  ( 0..^ M )  -.  (
x  gcd  M )  =  N )
3230, 31sylibr 203 . . . 4  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  -.  N  ||  M )  ->  { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }  =  (/) )
3332fveq2d 5567 . . 3  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  -.  N  ||  M )  ->  ( # `
 { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }
)  =  ( # `  (/) ) )
34 hash0 11402 . . 3  |-  ( # `  (/) )  =  0
3533, 34syl6eq 2364 . 2  |-  ( ( ( M  e.  NN  /\  N  e.  NN )  /\  -.  N  ||  M )  ->  ( # `
 { x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N }
)  =  0 )
361, 2, 17, 35ifbothda 3629 1  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( # `  {
x  e.  ( 0..^ M )  |  ( x  gcd  M )  =  N } )  =  if ( N 
||  M ,  ( phi `  ( M  /  N ) ) ,  0 ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 358    = wceq 1633    e. wcel 1701   A.wral 2577   {crab 2581   (/)c0 3489   ifcif 3599   class class class wbr 4060    e. cmpt 4114   -1-1-onto->wf1o 5291   ` cfv 5292  (class class class)co 5900    ~~ cen 6903   0cc0 8782   1c1 8783    x. cmul 8787    / cdiv 9468   NNcn 9791   ZZcz 10071  ..^cfzo 10917   #chash 11384    || cdivides 12578    gcd cgcd 12732   phicphi 12879
This theorem is referenced by:  phisum  26666
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1537  ax-5 1548  ax-17 1607  ax-9 1645  ax-8 1666  ax-13 1703  ax-14 1705  ax-6 1720  ax-7 1725  ax-11 1732  ax-12 1897  ax-ext 2297  ax-rep 4168  ax-sep 4178  ax-nul 4186  ax-pow 4225  ax-pr 4251  ax-un 4549  ax-cnex 8838  ax-resscn 8839  ax-1cn 8840  ax-icn 8841  ax-addcl 8842  ax-addrcl 8843  ax-mulcl 8844  ax-mulrcl 8845  ax-mulcom 8846  ax-addass 8847  ax-mulass 8848  ax-distr 8849  ax-i2m1 8850  ax-1ne0 8851  ax-1rid 8852  ax-rnegex 8853  ax-rrecex 8854  ax-cnre 8855  ax-pre-lttri 8856  ax-pre-lttrn 8857  ax-pre-ltadd 8858  ax-pre-mulgt0 8859  ax-pre-sup 8860
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1533  df-nf 1536  df-sb 1640  df-eu 2180  df-mo 2181  df-clab 2303  df-cleq 2309  df-clel 2312  df-nfc 2441  df-ne 2481  df-nel 2482  df-ral 2582  df-rex 2583  df-reu 2584  df-rmo 2585  df-rab 2586  df-v 2824  df-sbc 3026  df-csb 3116  df-dif 3189  df-un 3191  df-in 3193  df-ss 3200  df-pss 3202  df-nul 3490  df-if 3600  df-pw 3661  df-sn 3680  df-pr 3681  df-tp 3682  df-op 3683  df-uni 3865  df-int 3900  df-iun 3944  df-br 4061  df-opab 4115  df-mpt 4116  df-tr 4151  df-eprel 4342  df-id 4346  df-po 4351  df-so 4352  df-fr 4389  df-we 4391  df-ord 4432  df-on 4433  df-lim 4434  df-suc 4435  df-om 4694  df-xp 4732  df-rel 4733  df-cnv 4734  df-co 4735  df-dm 4736  df-rn 4737  df-res 4738  df-ima 4739  df-iota 5256  df-fun 5294  df-fn 5295  df-f 5296  df-f1 5297  df-fo 5298  df-f1o 5299  df-fv 5300  df-ov 5903  df-oprab 5904  df-mpt2 5905  df-1st 6164  df-2nd 6165  df-riota 6346  df-recs 6430  df-rdg 6465  df-1o 6521  df-oadd 6525  df-er 6702  df-en 6907  df-dom 6908  df-sdom 6909  df-fin 6910  df-sup 7239  df-card 7617  df-pnf 8914  df-mnf 8915  df-xr 8916  df-ltxr 8917  df-le 8918  df-sub 9084  df-neg 9085  df-div 9469  df-nn 9792  df-2 9849  df-3 9850  df-n0 10013  df-z 10072  df-uz 10278  df-rp 10402  df-fz 10830  df-fzo 10918  df-fl 10972  df-mod 11021  df-seq 11094  df-exp 11152  df-hash 11385  df-cj 11631  df-re 11632  df-im 11633  df-sqr 11767  df-abs 11768  df-dvds 12579  df-gcd 12733  df-phi 12881
  Copyright terms: Public domain W3C validator