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

Theorem modprmn0modprm0 13974
Description: For an integer not being 0 modulo a given prime number and a nonnegative integer less than the prime number, there is always a second nonnegative integer (less than the given prime number) so that the sum of this second nonnegative integer multiplied with the integer and the first nonnegative integer is 0 ( modulo the given prime number). (Contributed by Alexander van der Vekens, 10-Nov-2018.)
Assertion
Ref Expression
modprmn0modprm0  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  (
I  e.  ( 0..^ P )  ->  E. j  e.  ( 0..^ P ) ( ( I  +  ( j  x.  N
) )  mod  P
)  =  0 ) )
Distinct variable groups:    j, I    j, N    P, j

Proof of Theorem modprmn0modprm0
StepHypRef Expression
1 simpl1 991 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  P  e.  Prime )
2 prmnn 13865 . . . . . . . . 9  |-  ( P  e.  Prime  ->  P  e.  NN )
3 zmodfzo 11828 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  P  e.  NN )  ->  ( N  mod  P
)  e.  ( 0..^ P ) )
42, 3sylan2 474 . . . . . . . 8  |-  ( ( N  e.  ZZ  /\  P  e.  Prime )  -> 
( N  mod  P
)  e.  ( 0..^ P ) )
54ancoms 453 . . . . . . 7  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( N  mod  P )  e.  ( 0..^ P ) )
653adant3 1008 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  ( N  mod  P )  e.  ( 0..^ P ) )
7 fzo1fzo0n0 11686 . . . . . . . 8  |-  ( ( N  mod  P )  e.  ( 1..^ P )  <->  ( ( N  mod  P )  e.  ( 0..^ P )  /\  ( N  mod  P )  =/=  0 ) )
87simplbi2com 627 . . . . . . 7  |-  ( ( N  mod  P )  =/=  0  ->  (
( N  mod  P
)  e.  ( 0..^ P )  ->  ( N  mod  P )  e.  ( 1..^ P ) ) )
983ad2ant3 1011 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  (
( N  mod  P
)  e.  ( 0..^ P )  ->  ( N  mod  P )  e.  ( 1..^ P ) ) )
106, 9mpd 15 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  ( N  mod  P )  e.  ( 1..^ P ) )
1110adantr 465 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( N  mod  P
)  e.  ( 1..^ P ) )
12 simpr 461 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  I  e.  ( 0..^ P ) )
13 nnnn0modprm0 13973 . . . 4  |-  ( ( P  e.  Prime  /\  ( N  mod  P )  e.  ( 1..^ P )  /\  I  e.  ( 0..^ P ) )  ->  E. j  e.  ( 0..^ P ) ( ( I  +  ( j  x.  ( N  mod  P ) ) )  mod  P )  =  0 )
141, 11, 12, 13syl3anc 1219 . . 3  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  E. j  e.  (
0..^ P ) ( ( I  +  ( j  x.  ( N  mod  P ) ) )  mod  P )  =  0 )
15 elfzoelz 11651 . . . . . . . . . 10  |-  ( j  e.  ( 0..^ P )  ->  j  e.  ZZ )
1615zcnd 10846 . . . . . . . . 9  |-  ( j  e.  ( 0..^ P )  ->  j  e.  CC )
172anim1i 568 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  e.  NN  /\  N  e.  ZZ ) )
1817ancomd 451 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( N  e.  ZZ  /\  P  e.  NN ) )
19 zmodcl 11825 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  P  e.  NN )  ->  ( N  mod  P
)  e.  NN0 )
20 nn0cn 10687 . . . . . . . . . . . 12  |-  ( ( N  mod  P )  e.  NN0  ->  ( N  mod  P )  e.  CC )
2118, 19, 203syl 20 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( N  mod  P )  e.  CC )
22213adant3 1008 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  ( N  mod  P )  e.  CC )
2322adantr 465 . . . . . . . . 9  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( N  mod  P
)  e.  CC )
24 mulcom 9466 . . . . . . . . 9  |-  ( ( j  e.  CC  /\  ( N  mod  P )  e.  CC )  -> 
( j  x.  ( N  mod  P ) )  =  ( ( N  mod  P )  x.  j ) )
2516, 23, 24syl2anr 478 . . . . . . . 8  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( j  x.  ( N  mod  P
) )  =  ( ( N  mod  P
)  x.  j ) )
2625oveq2d 6203 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( I  +  ( j  x.  ( N  mod  P ) ) )  =  ( I  +  ( ( N  mod  P )  x.  j ) ) )
2726oveq1d 6202 . . . . . 6  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( ( I  +  ( j  x.  ( N  mod  P
) ) )  mod 
P )  =  ( ( I  +  ( ( N  mod  P
)  x.  j ) )  mod  P ) )
28 elfzoelz 11651 . . . . . . . . . 10  |-  ( I  e.  ( 0..^ P )  ->  I  e.  ZZ )
2928zred 10845 . . . . . . . . 9  |-  ( I  e.  ( 0..^ P )  ->  I  e.  RR )
3029adantl 466 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  I  e.  RR )
3130adantr 465 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  I  e.  RR )
32 zre 10748 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  N  e.  RR )
33323ad2ant2 1010 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  N  e.  RR )
3433adantr 465 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  N  e.  RR )
3534adantr 465 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  N  e.  RR )
3615adantl 466 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  j  e.  ZZ )
372nnrpd 11124 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  RR+ )
38373ad2ant1 1009 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  P  e.  RR+ )
3938adantr 465 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  P  e.  RR+ )
4039adantr 465 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  P  e.  RR+ )
41 modaddmulmod 11863 . . . . . . 7  |-  ( ( ( I  e.  RR  /\  N  e.  RR  /\  j  e.  ZZ )  /\  P  e.  RR+ )  ->  ( ( I  +  ( ( N  mod  P )  x.  j ) )  mod  P )  =  ( ( I  +  ( N  x.  j ) )  mod 
P ) )
4231, 35, 36, 40, 41syl31anc 1222 . . . . . 6  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( ( I  +  ( ( N  mod  P )  x.  j ) )  mod 
P )  =  ( ( I  +  ( N  x.  j ) )  mod  P ) )
43 zcn 10749 . . . . . . . . . . . . . 14  |-  ( N  e.  ZZ  ->  N  e.  CC )
4443adantr 465 . . . . . . . . . . . . 13  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  ->  N  e.  CC )
4516adantl 466 . . . . . . . . . . . . 13  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  -> 
j  e.  CC )
4644, 45mulcomd 9505 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  -> 
( N  x.  j
)  =  ( j  x.  N ) )
4746ex 434 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
j  e.  ( 0..^ P )  ->  ( N  x.  j )  =  ( j  x.  N ) ) )
48473ad2ant2 1010 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  (
j  e.  ( 0..^ P )  ->  ( N  x.  j )  =  ( j  x.  N ) ) )
4948adantr 465 . . . . . . . . 9  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( j  e.  ( 0..^ P )  -> 
( N  x.  j
)  =  ( j  x.  N ) ) )
5049imp 429 . . . . . . . 8  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( N  x.  j )  =  ( j  x.  N ) )
5150oveq2d 6203 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( I  +  ( N  x.  j
) )  =  ( I  +  ( j  x.  N ) ) )
5251oveq1d 6202 . . . . . 6  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( ( I  +  ( N  x.  j ) )  mod 
P )  =  ( ( I  +  ( j  x.  N ) )  mod  P ) )
5327, 42, 523eqtrrd 2496 . . . . 5  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( ( I  +  ( j  x.  N ) )  mod 
P )  =  ( ( I  +  ( j  x.  ( N  mod  P ) ) )  mod  P ) )
5453eqeq1d 2453 . . . 4  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  ( ( ( I  +  ( j  x.  N ) )  mod  P )  =  0  <->  ( ( I  +  ( j  x.  ( N  mod  P
) ) )  mod 
P )  =  0 ) )
5554rexbidva 2836 . . 3  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( E. j  e.  ( 0..^ P ) ( ( I  +  ( j  x.  N
) )  mod  P
)  =  0  <->  E. j  e.  ( 0..^ P ) ( ( I  +  ( j  x.  ( N  mod  P ) ) )  mod 
P )  =  0 ) )
5614, 55mpbird 232 . 2  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  E. j  e.  (
0..^ P ) ( ( I  +  ( j  x.  N ) )  mod  P )  =  0 )
5756ex 434 1  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  (
I  e.  ( 0..^ P )  ->  E. j  e.  ( 0..^ P ) ( ( I  +  ( j  x.  N
) )  mod  P
)  =  0 ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    /\ w3a 965    = wceq 1370    e. wcel 1758    =/= wne 2642   E.wrex 2794  (class class class)co 6187   CCcc 9378   RRcr 9379   0cc0 9380   1c1 9381    + caddc 9383    x. cmul 9385   NNcn 10420   NN0cn0 10677   ZZcz 10744   RR+crp 11089  ..^cfzo 11646    mod cmo 11806   Primecprime 13862
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1952  ax-ext 2430  ax-rep 4498  ax-sep 4508  ax-nul 4516  ax-pow 4565  ax-pr 4626  ax-un 6469  ax-cnex 9436  ax-resscn 9437  ax-1cn 9438  ax-icn 9439  ax-addcl 9440  ax-addrcl 9441  ax-mulcl 9442  ax-mulrcl 9443  ax-mulcom 9444  ax-addass 9445  ax-mulass 9446  ax-distr 9447  ax-i2m1 9448  ax-1ne0 9449  ax-1rid 9450  ax-rnegex 9451  ax-rrecex 9452  ax-cnre 9453  ax-pre-lttri 9454  ax-pre-lttrn 9455  ax-pre-ltadd 9456  ax-pre-mulgt0 9457  ax-pre-sup 9458
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2264  df-mo 2265  df-clab 2437  df-cleq 2443  df-clel 2446  df-nfc 2599  df-ne 2644  df-nel 2645  df-ral 2798  df-rex 2799  df-reu 2800  df-rmo 2801  df-rab 2802  df-v 3067  df-sbc 3282  df-csb 3384  df-dif 3426  df-un 3428  df-in 3430  df-ss 3437  df-pss 3439  df-nul 3733  df-if 3887  df-pw 3957  df-sn 3973  df-pr 3975  df-tp 3977  df-op 3979  df-uni 4187  df-int 4224  df-iun 4268  df-br 4388  df-opab 4446  df-mpt 4447  df-tr 4481  df-eprel 4727  df-id 4731  df-po 4736  df-so 4737  df-fr 4774  df-we 4776  df-ord 4817  df-on 4818  df-lim 4819  df-suc 4820  df-xp 4941  df-rel 4942  df-cnv 4943  df-co 4944  df-dm 4945  df-rn 4946  df-res 4947  df-ima 4948  df-iota 5476  df-fun 5515  df-fn 5516  df-f 5517  df-f1 5518  df-fo 5519  df-f1o 5520  df-fv 5521  df-riota 6148  df-ov 6190  df-oprab 6191  df-mpt2 6192  df-om 6574  df-1st 6674  df-2nd 6675  df-recs 6929  df-rdg 6963  df-1o 7017  df-2o 7018  df-oadd 7021  df-er 7198  df-map 7313  df-en 7408  df-dom 7409  df-sdom 7410  df-fin 7411  df-sup 7789  df-card 8207  df-cda 8435  df-pnf 9518  df-mnf 9519  df-xr 9520  df-ltxr 9521  df-le 9522  df-sub 9695  df-neg 9696  df-div 10092  df-nn 10421  df-2 10478  df-3 10479  df-n0 10678  df-z 10745  df-uz 10960  df-rp 11090  df-fz 11536  df-fzo 11647  df-fl 11740  df-mod 11807  df-seq 11905  df-exp 11964  df-hash 12202  df-cj 12687  df-re 12688  df-im 12689  df-sqr 12823  df-abs 12824  df-dvds 13635  df-gcd 13790  df-prm 13863  df-phi 13940
This theorem is referenced by:  cshwsidrepsw  14219
  Copyright terms: Public domain W3C validator