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

Theorem modsubi 12786
Description: Subtract from within a mod calculation. (Contributed by Mario Carneiro, 18-Feb-2014.)
Hypotheses
Ref Expression
modsubi.1  |-  N  e.  NN
modsubi.2  |-  A  e.  NN
modsubi.3  |-  B  e. 
NN0
modsubi.4  |-  M  e. 
NN0
modsubi.6  |-  ( A  mod  N )  =  ( K  mod  N
)
modsubi.5  |-  ( M  +  B )  =  K
Assertion
Ref Expression
modsubi  |-  ( ( A  -  B )  mod  N )  =  ( M  mod  N
)

Proof of Theorem modsubi
StepHypRef Expression
1 modsubi.2 . . . . 5  |-  A  e.  NN
2 nnq 9761 . . . . 5  |-  ( A  e.  NN  ->  A  e.  QQ )
31, 2mp1i 10 . . . 4  |-  ( T. 
->  A  e.  QQ )
4 modsubi.5 . . . . . . 7  |-  ( M  +  B )  =  K
5 modsubi.4 . . . . . . . 8  |-  M  e. 
NN0
6 modsubi.3 . . . . . . . 8  |-  B  e. 
NN0
75, 6nn0addcli 9339 . . . . . . 7  |-  ( M  +  B )  e. 
NN0
84, 7eqeltrri 2280 . . . . . 6  |-  K  e. 
NN0
98nn0zi 9401 . . . . 5  |-  K  e.  ZZ
10 zq 9754 . . . . 5  |-  ( K  e.  ZZ  ->  K  e.  QQ )
119, 10mp1i 10 . . . 4  |-  ( T. 
->  K  e.  QQ )
126nn0negzi 9414 . . . . 5  |-  -u B  e.  ZZ
13 zq 9754 . . . . 5  |-  ( -u B  e.  ZZ  ->  -u B  e.  QQ )
1412, 13mp1i 10 . . . 4  |-  ( T. 
->  -u B  e.  QQ )
15 modsubi.1 . . . . 5  |-  N  e.  NN
16 nnq 9761 . . . . 5  |-  ( N  e.  NN  ->  N  e.  QQ )
1715, 16mp1i 10 . . . 4  |-  ( T. 
->  N  e.  QQ )
18 nngt0 9068 . . . . 5  |-  ( N  e.  NN  ->  0  <  N )
1915, 18mp1i 10 . . . 4  |-  ( T. 
->  0  <  N )
20 modsubi.6 . . . . 5  |-  ( A  mod  N )  =  ( K  mod  N
)
2120a1i 9 . . . 4  |-  ( T. 
->  ( A  mod  N
)  =  ( K  mod  N ) )
223, 11, 14, 17, 19, 21modqadd1 10513 . . 3  |-  ( T. 
->  ( ( A  +  -u B )  mod  N
)  =  ( ( K  +  -u B
)  mod  N )
)
2322mptru 1382 . 2  |-  ( ( A  +  -u B
)  mod  N )  =  ( ( K  +  -u B )  mod 
N )
241nncni 9053 . . . 4  |-  A  e.  CC
256nn0cni 9314 . . . 4  |-  B  e.  CC
2624, 25negsubi 8357 . . 3  |-  ( A  +  -u B )  =  ( A  -  B
)
2726oveq1i 5961 . 2  |-  ( ( A  +  -u B
)  mod  N )  =  ( ( A  -  B )  mod 
N )
287nn0rei 9313 . . . . . . 7  |-  ( M  +  B )  e.  RR
294, 28eqeltrri 2280 . . . . . 6  |-  K  e.  RR
3029recni 8091 . . . . 5  |-  K  e.  CC
3130, 25negsubi 8357 . . . 4  |-  ( K  +  -u B )  =  ( K  -  B
)
325nn0cni 9314 . . . . . 6  |-  M  e.  CC
3330, 25, 32subadd2i 8367 . . . . 5  |-  ( ( K  -  B )  =  M  <->  ( M  +  B )  =  K )
344, 33mpbir 146 . . . 4  |-  ( K  -  B )  =  M
3531, 34eqtri 2227 . . 3  |-  ( K  +  -u B )  =  M
3635oveq1i 5961 . 2  |-  ( ( K  +  -u B
)  mod  N )  =  ( M  mod  N )
3723, 27, 363eqtr3i 2235 1  |-  ( ( A  -  B )  mod  N )  =  ( M  mod  N
)
Colors of variables: wff set class
Syntax hints:    = wceq 1373   T. wtru 1374    e. wcel 2177   class class class wbr 4047  (class class class)co 5951   RRcr 7931   0cc0 7932    + caddc 7935    < clt 8114    - cmin 8250   -ucneg 8251   NNcn 9043   NN0cn0 9302   ZZcz 9379   QQcq 9747    mod cmo 10474
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 615  ax-in2 616  ax-io 711  ax-5 1471  ax-7 1472  ax-gen 1473  ax-ie1 1517  ax-ie2 1518  ax-8 1528  ax-10 1529  ax-11 1530  ax-i12 1531  ax-bndl 1533  ax-4 1534  ax-17 1550  ax-i9 1554  ax-ial 1558  ax-i5r 1559  ax-13 2179  ax-14 2180  ax-ext 2188  ax-sep 4166  ax-pow 4222  ax-pr 4257  ax-un 4484  ax-setind 4589  ax-cnex 8023  ax-resscn 8024  ax-1cn 8025  ax-1re 8026  ax-icn 8027  ax-addcl 8028  ax-addrcl 8029  ax-mulcl 8030  ax-mulrcl 8031  ax-addcom 8032  ax-mulcom 8033  ax-addass 8034  ax-mulass 8035  ax-distr 8036  ax-i2m1 8037  ax-0lt1 8038  ax-1rid 8039  ax-0id 8040  ax-rnegex 8041  ax-precex 8042  ax-cnre 8043  ax-pre-ltirr 8044  ax-pre-ltwlin 8045  ax-pre-lttrn 8046  ax-pre-apti 8047  ax-pre-ltadd 8048  ax-pre-mulgt0 8049  ax-pre-mulext 8050  ax-arch 8051
This theorem depends on definitions:  df-bi 117  df-3or 982  df-3an 983  df-tru 1376  df-fal 1379  df-nf 1485  df-sb 1787  df-eu 2058  df-mo 2059  df-clab 2193  df-cleq 2199  df-clel 2202  df-nfc 2338  df-ne 2378  df-nel 2473  df-ral 2490  df-rex 2491  df-reu 2492  df-rmo 2493  df-rab 2494  df-v 2775  df-sbc 3000  df-csb 3095  df-dif 3169  df-un 3171  df-in 3173  df-ss 3180  df-pw 3619  df-sn 3640  df-pr 3641  df-op 3643  df-uni 3853  df-int 3888  df-iun 3931  df-br 4048  df-opab 4110  df-mpt 4111  df-id 4344  df-po 4347  df-iso 4348  df-xp 4685  df-rel 4686  df-cnv 4687  df-co 4688  df-dm 4689  df-rn 4690  df-res 4691  df-ima 4692  df-iota 5237  df-fun 5278  df-fn 5279  df-f 5280  df-fv 5284  df-riota 5906  df-ov 5954  df-oprab 5955  df-mpo 5956  df-1st 6233  df-2nd 6234  df-pnf 8116  df-mnf 8117  df-xr 8118  df-ltxr 8119  df-le 8120  df-sub 8252  df-neg 8253  df-reap 8655  df-ap 8662  df-div 8753  df-inn 9044  df-n0 9303  df-z 9380  df-q 9748  df-rp 9783  df-fl 10420  df-mod 10475
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator