ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  qnegmod Unicode version

Theorem qnegmod 9440
Description: The negation of a number modulo a positive number is equal to the difference of the modulus and the number modulo the modulus. (Contributed by Jim Kingdon, 24-Oct-2021.)
Assertion
Ref Expression
qnegmod  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( -u A  mod  N )  =  ( ( N  -  A )  mod 
N ) )

Proof of Theorem qnegmod
StepHypRef Expression
1 qcn 8789 . . . . . 6  |-  ( N  e.  QQ  ->  N  e.  CC )
213ad2ant2 961 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  N  e.  CC )
3 qcn 8789 . . . . . 6  |-  ( A  e.  QQ  ->  A  e.  CC )
433ad2ant1 960 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  A  e.  CC )
52, 4negsubd 7481 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( N  +  -u A )  =  ( N  -  A ) )
65eqcomd 2087 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( N  -  A )  =  ( N  +  -u A ) )
76oveq1d 5552 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( N  -  A
)  mod  N )  =  ( ( N  +  -u A )  mod 
N ) )
82mulid2d 7188 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
1  x.  N )  =  N )
98oveq1d 5552 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( 1  x.  N
)  +  -u A
)  =  ( N  +  -u A ) )
109oveq1d 5552 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( ( N  +  -u A
)  mod  N )
)
11 1cnd 7186 . . . . . 6  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  1  e.  CC )
1211, 2mulcld 7190 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
1  x.  N )  e.  CC )
13 qnegcl 8791 . . . . . . 7  |-  ( A  e.  QQ  ->  -u A  e.  QQ )
14 qcn 8789 . . . . . . 7  |-  ( -u A  e.  QQ  ->  -u A  e.  CC )
1513, 14syl 14 . . . . . 6  |-  ( A  e.  QQ  ->  -u A  e.  CC )
16153ad2ant1 960 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  -u A  e.  CC )
1712, 16addcomd 7315 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( 1  x.  N
)  +  -u A
)  =  ( -u A  +  ( 1  x.  N ) ) )
1817oveq1d 5552 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( (
-u A  +  ( 1  x.  N ) )  mod  N ) )
19133ad2ant1 960 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  -u A  e.  QQ )
20 1zzd 8448 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  1  e.  ZZ )
21 simp2 940 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  N  e.  QQ )
22 simp3 941 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  0  <  N )
23 modqcyc 9430 . . . 4  |-  ( ( ( -u A  e.  QQ  /\  1  e.  ZZ )  /\  ( N  e.  QQ  /\  0  <  N ) )  -> 
( ( -u A  +  ( 1  x.  N ) )  mod 
N )  =  (
-u A  mod  N
) )
2419, 20, 21, 22, 23syl22anc 1171 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( -u A  +  ( 1  x.  N ) )  mod  N )  =  ( -u A  mod  N ) )
2518, 24eqtrd 2114 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( -u A  mod  N ) )
267, 10, 253eqtr2rd 2121 1  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( -u A  mod  N )  =  ( ( N  -  A )  mod 
N ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ w3a 920    = wceq 1285    e. wcel 1434   class class class wbr 3787  (class class class)co 5537   CCcc 7030   0cc0 7032   1c1 7033    + caddc 7035    x. cmul 7037    < clt 7204    - cmin 7335   -ucneg 7336   ZZcz 8421   QQcq 8774    mod cmo 9393
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2064  ax-sep 3898  ax-pow 3950  ax-pr 3966  ax-un 4190  ax-setind 4282  ax-cnex 7118  ax-resscn 7119  ax-1cn 7120  ax-1re 7121  ax-icn 7122  ax-addcl 7123  ax-addrcl 7124  ax-mulcl 7125  ax-mulrcl 7126  ax-addcom 7127  ax-mulcom 7128  ax-addass 7129  ax-mulass 7130  ax-distr 7131  ax-i2m1 7132  ax-0lt1 7133  ax-1rid 7134  ax-0id 7135  ax-rnegex 7136  ax-precex 7137  ax-cnre 7138  ax-pre-ltirr 7139  ax-pre-ltwlin 7140  ax-pre-lttrn 7141  ax-pre-apti 7142  ax-pre-ltadd 7143  ax-pre-mulgt0 7144  ax-pre-mulext 7145  ax-arch 7146
This theorem depends on definitions:  df-bi 115  df-3or 921  df-3an 922  df-tru 1288  df-fal 1291  df-nf 1391  df-sb 1687  df-eu 1945  df-mo 1946  df-clab 2069  df-cleq 2075  df-clel 2078  df-nfc 2209  df-ne 2247  df-nel 2341  df-ral 2354  df-rex 2355  df-reu 2356  df-rmo 2357  df-rab 2358  df-v 2604  df-sbc 2817  df-csb 2910  df-dif 2976  df-un 2978  df-in 2980  df-ss 2987  df-pw 3386  df-sn 3406  df-pr 3407  df-op 3409  df-uni 3604  df-int 3639  df-iun 3682  df-br 3788  df-opab 3842  df-mpt 3843  df-id 4050  df-po 4053  df-iso 4054  df-xp 4371  df-rel 4372  df-cnv 4373  df-co 4374  df-dm 4375  df-rn 4376  df-res 4377  df-ima 4378  df-iota 4891  df-fun 4928  df-fn 4929  df-f 4930  df-fv 4934  df-riota 5493  df-ov 5540  df-oprab 5541  df-mpt2 5542  df-1st 5792  df-2nd 5793  df-pnf 7206  df-mnf 7207  df-xr 7208  df-ltxr 7209  df-le 7210  df-sub 7337  df-neg 7338  df-reap 7731  df-ap 7738  df-div 7817  df-inn 8096  df-n0 8345  df-z 8422  df-q 8775  df-rp 8805  df-fl 9341  df-mod 9394
This theorem is referenced by:  m1modnnsub1  9441
  Copyright terms: Public domain W3C validator