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

Theorem modprmn0modprm0 14416
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 997 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  P  e.  Prime )
2 prmnn 14304 . . . . . . . . 9  |-  ( P  e.  Prime  ->  P  e.  NN )
3 zmodfzo 12000 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  P  e.  NN )  ->  ( N  mod  P
)  e.  ( 0..^ P ) )
42, 3sylan2 472 . . . . . . . 8  |-  ( ( N  e.  ZZ  /\  P  e.  Prime )  -> 
( N  mod  P
)  e.  ( 0..^ P ) )
54ancoms 451 . . . . . . 7  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( N  mod  P )  e.  ( 0..^ P ) )
653adant3 1014 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  ( N  mod  P )  e.  ( 0..^ P ) )
7 fzo1fzo0n0 11841 . . . . . . . 8  |-  ( ( N  mod  P )  e.  ( 1..^ P )  <->  ( ( N  mod  P )  e.  ( 0..^ P )  /\  ( N  mod  P )  =/=  0 ) )
87simplbi2com 625 . . . . . . 7  |-  ( ( N  mod  P )  =/=  0  ->  (
( N  mod  P
)  e.  ( 0..^ P )  ->  ( N  mod  P )  e.  ( 1..^ P ) ) )
983ad2ant3 1017 . . . . . 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 463 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( N  mod  P
)  e.  ( 1..^ P ) )
12 simpr 459 . . . 4  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  I  e.  ( 0..^ P ) )
13 nnnn0modprm0 14415 . . . 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 1226 . . 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 11804 . . . . . . . . . 10  |-  ( j  e.  ( 0..^ P )  ->  j  e.  ZZ )
1615zcnd 10966 . . . . . . . . 9  |-  ( j  e.  ( 0..^ P )  ->  j  e.  CC )
172anim1i 566 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  e.  NN  /\  N  e.  ZZ ) )
1817ancomd 449 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( N  e.  ZZ  /\  P  e.  NN ) )
19 zmodcl 11997 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  P  e.  NN )  ->  ( N  mod  P
)  e.  NN0 )
20 nn0cn 10801 . . . . . . . . . . . 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 1014 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  ( N  mod  P )  e.  CC )
2322adantr 463 . . . . . . . . 9  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  -> 
( N  mod  P
)  e.  CC )
24 mulcom 9567 . . . . . . . . 9  |-  ( ( j  e.  CC  /\  ( N  mod  P )  e.  CC )  -> 
( j  x.  ( N  mod  P ) )  =  ( ( N  mod  P )  x.  j ) )
2516, 23, 24syl2anr 476 . . . . . . . 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 6286 . . . . . . 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 6285 . . . . . 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 11804 . . . . . . . . . 10  |-  ( I  e.  ( 0..^ P )  ->  I  e.  ZZ )
2928zred 10965 . . . . . . . . 9  |-  ( I  e.  ( 0..^ P )  ->  I  e.  RR )
3029adantl 464 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  I  e.  RR )
3130adantr 463 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  I  e.  RR )
32 zre 10864 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  N  e.  RR )
33323ad2ant2 1016 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  N  e.  RR )
3433adantr 463 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  N  e.  RR )
3534adantr 463 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  N  e.  RR )
3615adantl 464 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  j  e.  ZZ )
372nnrpd 11257 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  RR+ )
38373ad2ant1 1015 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  P  e.  RR+ )
3938adantr 463 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  /\  I  e.  ( 0..^ P ) )  ->  P  e.  RR+ )
4039adantr 463 . . . . . . 7  |-  ( ( ( ( P  e. 
Prime  /\  N  e.  ZZ  /\  ( N  mod  P
)  =/=  0 )  /\  I  e.  ( 0..^ P ) )  /\  j  e.  ( 0..^ P ) )  ->  P  e.  RR+ )
41 modaddmulmod 12035 . . . . . . 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 1229 . . . . . 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 10865 . . . . . . . . . . . . . 14  |-  ( N  e.  ZZ  ->  N  e.  CC )
4443adantr 463 . . . . . . . . . . . . 13  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  ->  N  e.  CC )
4516adantl 464 . . . . . . . . . . . . 13  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  -> 
j  e.  CC )
4644, 45mulcomd 9606 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  j  e.  ( 0..^ P ) )  -> 
( N  x.  j
)  =  ( j  x.  N ) )
4746ex 432 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
j  e.  ( 0..^ P )  ->  ( N  x.  j )  =  ( j  x.  N ) ) )
48473ad2ant2 1016 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  N  e.  ZZ  /\  ( N  mod  P )  =/=  0 )  ->  (
j  e.  ( 0..^ P )  ->  ( N  x.  j )  =  ( j  x.  N ) ) )
4948adantr 463 . . . . . . . . 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 427 . . . . . . . 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 6286 . . . . . . 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 6285 . . . . . 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 2500 . . . . 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 2456 . . . 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 2962 . . 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 432 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 367    /\ w3a 971    = wceq 1398    e. wcel 1823    =/= wne 2649   E.wrex 2805  (class class class)co 6270   CCcc 9479   RRcr 9480   0cc0 9481   1c1 9482    + caddc 9484    x. cmul 9486   NNcn 10531   NN0cn0 10791   ZZcz 10860   RR+crp 11221  ..^cfzo 11799    mod cmo 11978   Primecprime 14301
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1623  ax-4 1636  ax-5 1709  ax-6 1752  ax-7 1795  ax-8 1825  ax-9 1827  ax-10 1842  ax-11 1847  ax-12 1859  ax-13 2004  ax-ext 2432  ax-rep 4550  ax-sep 4560  ax-nul 4568  ax-pow 4615  ax-pr 4676  ax-un 6565  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558  ax-pre-sup 9559
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1401  df-ex 1618  df-nf 1622  df-sb 1745  df-eu 2288  df-mo 2289  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2651  df-nel 2652  df-ral 2809  df-rex 2810  df-reu 2811  df-rmo 2812  df-rab 2813  df-v 3108  df-sbc 3325  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3784  df-if 3930  df-pw 4001  df-sn 4017  df-pr 4019  df-tp 4021  df-op 4023  df-uni 4236  df-int 4272  df-iun 4317  df-br 4440  df-opab 4498  df-mpt 4499  df-tr 4533  df-eprel 4780  df-id 4784  df-po 4789  df-so 4790  df-fr 4827  df-we 4829  df-ord 4870  df-on 4871  df-lim 4872  df-suc 4873  df-xp 4994  df-rel 4995  df-cnv 4996  df-co 4997  df-dm 4998  df-rn 4999  df-res 5000  df-ima 5001  df-iota 5534  df-fun 5572  df-fn 5573  df-f 5574  df-f1 5575  df-fo 5576  df-f1o 5577  df-fv 5578  df-riota 6232  df-ov 6273  df-oprab 6274  df-mpt2 6275  df-om 6674  df-1st 6773  df-2nd 6774  df-recs 7034  df-rdg 7068  df-1o 7122  df-2o 7123  df-oadd 7126  df-er 7303  df-map 7414  df-en 7510  df-dom 7511  df-sdom 7512  df-fin 7513  df-sup 7893  df-card 8311  df-cda 8539  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9798  df-neg 9799  df-div 10203  df-nn 10532  df-2 10590  df-3 10591  df-n0 10792  df-z 10861  df-uz 11083  df-rp 11222  df-fz 11676  df-fzo 11800  df-fl 11910  df-mod 11979  df-seq 12090  df-exp 12149  df-hash 12388  df-cj 13014  df-re 13015  df-im 13016  df-sqrt 13150  df-abs 13151  df-dvds 14071  df-gcd 14229  df-prm 14302  df-phi 14380
This theorem is referenced by:  cshwsidrepsw  14662
  Copyright terms: Public domain W3C validator