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

Theorem qnegmod 10172
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 9452 . . . . . 6  |-  ( N  e.  QQ  ->  N  e.  CC )
213ad2ant2 1004 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  N  e.  CC )
3 qcn 9452 . . . . . 6  |-  ( A  e.  QQ  ->  A  e.  CC )
433ad2ant1 1003 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  A  e.  CC )
52, 4negsubd 8102 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( N  +  -u A )  =  ( N  -  A ) )
65eqcomd 2146 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  ( N  -  A )  =  ( N  +  -u A ) )
76oveq1d 5796 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( N  -  A
)  mod  N )  =  ( ( N  +  -u A )  mod 
N ) )
82mulid2d 7807 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
1  x.  N )  =  N )
98oveq1d 5796 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( 1  x.  N
)  +  -u A
)  =  ( N  +  -u A ) )
109oveq1d 5796 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( ( N  +  -u A
)  mod  N )
)
11 1cnd 7805 . . . . . 6  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  1  e.  CC )
1211, 2mulcld 7809 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
1  x.  N )  e.  CC )
13 qnegcl 9454 . . . . . . 7  |-  ( A  e.  QQ  ->  -u A  e.  QQ )
14 qcn 9452 . . . . . . 7  |-  ( -u A  e.  QQ  ->  -u A  e.  CC )
1513, 14syl 14 . . . . . 6  |-  ( A  e.  QQ  ->  -u A  e.  CC )
16153ad2ant1 1003 . . . . 5  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  -u A  e.  CC )
1712, 16addcomd 7936 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( 1  x.  N
)  +  -u A
)  =  ( -u A  +  ( 1  x.  N ) ) )
1817oveq1d 5796 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( (
-u A  +  ( 1  x.  N ) )  mod  N ) )
19133ad2ant1 1003 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  -u A  e.  QQ )
20 1zzd 9104 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  1  e.  ZZ )
21 simp2 983 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  N  e.  QQ )
22 simp3 984 . . . 4  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  0  <  N )
23 modqcyc 10162 . . . 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 1218 . . 3  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( -u A  +  ( 1  x.  N ) )  mod  N )  =  ( -u A  mod  N ) )
2518, 24eqtrd 2173 . 2  |-  ( ( A  e.  QQ  /\  N  e.  QQ  /\  0  <  N )  ->  (
( ( 1  x.  N )  +  -u A )  mod  N
)  =  ( -u A  mod  N ) )
267, 10, 253eqtr2rd 2180 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 963    = wceq 1332    e. wcel 1481   class class class wbr 3936  (class class class)co 5781   CCcc 7641   0cc0 7643   1c1 7644    + caddc 7646    x. cmul 7648    < clt 7823    - cmin 7956   -ucneg 7957   ZZcz 9077   QQcq 9437    mod cmo 10125
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 604  ax-in2 605  ax-io 699  ax-5 1424  ax-7 1425  ax-gen 1426  ax-ie1 1470  ax-ie2 1471  ax-8 1483  ax-10 1484  ax-11 1485  ax-i12 1486  ax-bndl 1487  ax-4 1488  ax-13 1492  ax-14 1493  ax-17 1507  ax-i9 1511  ax-ial 1515  ax-i5r 1516  ax-ext 2122  ax-sep 4053  ax-pow 4105  ax-pr 4138  ax-un 4362  ax-setind 4459  ax-cnex 7734  ax-resscn 7735  ax-1cn 7736  ax-1re 7737  ax-icn 7738  ax-addcl 7739  ax-addrcl 7740  ax-mulcl 7741  ax-mulrcl 7742  ax-addcom 7743  ax-mulcom 7744  ax-addass 7745  ax-mulass 7746  ax-distr 7747  ax-i2m1 7748  ax-0lt1 7749  ax-1rid 7750  ax-0id 7751  ax-rnegex 7752  ax-precex 7753  ax-cnre 7754  ax-pre-ltirr 7755  ax-pre-ltwlin 7756  ax-pre-lttrn 7757  ax-pre-apti 7758  ax-pre-ltadd 7759  ax-pre-mulgt0 7760  ax-pre-mulext 7761  ax-arch 7762
This theorem depends on definitions:  df-bi 116  df-3or 964  df-3an 965  df-tru 1335  df-fal 1338  df-nf 1438  df-sb 1737  df-eu 2003  df-mo 2004  df-clab 2127  df-cleq 2133  df-clel 2136  df-nfc 2271  df-ne 2310  df-nel 2405  df-ral 2422  df-rex 2423  df-reu 2424  df-rmo 2425  df-rab 2426  df-v 2691  df-sbc 2913  df-csb 3007  df-dif 3077  df-un 3079  df-in 3081  df-ss 3088  df-pw 3516  df-sn 3537  df-pr 3538  df-op 3540  df-uni 3744  df-int 3779  df-iun 3822  df-br 3937  df-opab 3997  df-mpt 3998  df-id 4222  df-po 4225  df-iso 4226  df-xp 4552  df-rel 4553  df-cnv 4554  df-co 4555  df-dm 4556  df-rn 4557  df-res 4558  df-ima 4559  df-iota 5095  df-fun 5132  df-fn 5133  df-f 5134  df-fv 5138  df-riota 5737  df-ov 5784  df-oprab 5785  df-mpo 5786  df-1st 6045  df-2nd 6046  df-pnf 7825  df-mnf 7826  df-xr 7827  df-ltxr 7828  df-le 7829  df-sub 7958  df-neg 7959  df-reap 8360  df-ap 8367  df-div 8456  df-inn 8744  df-n0 9001  df-z 9078  df-q 9438  df-rp 9470  df-fl 10073  df-mod 10126
This theorem is referenced by:  m1modnnsub1  10173
  Copyright terms: Public domain W3C validator