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

Theorem nn0sub 10867
Description: Subtraction of nonnegative integers. (Contributed by NM, 9-May-2004.) (Proof shortened by Mario Carneiro, 16-May-2014.)
Assertion
Ref Expression
nn0sub  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( N  -  M )  e.  NN0 ) )

Proof of Theorem nn0sub
StepHypRef Expression
1 nn0re 10825 . . . 4  |-  ( M  e.  NN0  ->  M  e.  RR )
2 nn0re 10825 . . . 4  |-  ( N  e.  NN0  ->  N  e.  RR )
3 leloe 9688 . . . 4  |-  ( ( M  e.  RR  /\  N  e.  RR )  ->  ( M  <_  N  <->  ( M  <  N  \/  M  =  N )
) )
41, 2, 3syl2an 477 . . 3  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( M  <  N  \/  M  =  N )
) )
5 elnn0 10818 . . . . . 6  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
6 elnn0 10818 . . . . . . . 8  |-  ( M  e.  NN0  <->  ( M  e.  NN  \/  M  =  0 ) )
7 nnsub 10595 . . . . . . . . . 10  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) )
87ex 434 . . . . . . . . 9  |-  ( M  e.  NN  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
9 nngt0 10585 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  0  <  N )
10 nncn 10564 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  N  e.  CC )
1110subid1d 9939 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  ( N  -  0 )  =  N )
12 id 22 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  N  e.  NN )
1311, 12eqeltrd 2545 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  ( N  -  0 )  e.  NN )
149, 132thd 240 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
0  <  N  <->  ( N  -  0 )  e.  NN ) )
15 breq1 4459 . . . . . . . . . . 11  |-  ( M  =  0  ->  ( M  <  N  <->  0  <  N ) )
16 oveq2 6304 . . . . . . . . . . . 12  |-  ( M  =  0  ->  ( N  -  M )  =  ( N  - 
0 ) )
1716eleq1d 2526 . . . . . . . . . . 11  |-  ( M  =  0  ->  (
( N  -  M
)  e.  NN  <->  ( N  -  0 )  e.  NN ) )
1815, 17bibi12d 321 . . . . . . . . . 10  |-  ( M  =  0  ->  (
( M  <  N  <->  ( N  -  M )  e.  NN )  <->  ( 0  <  N  <->  ( N  -  0 )  e.  NN ) ) )
1914, 18syl5ibr 221 . . . . . . . . 9  |-  ( M  =  0  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
208, 19jaoi 379 . . . . . . . 8  |-  ( ( M  e.  NN  \/  M  =  0 )  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
216, 20sylbi 195 . . . . . . 7  |-  ( M  e.  NN0  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
22 nn0nlt0 10843 . . . . . . . . . 10  |-  ( M  e.  NN0  ->  -.  M  <  0 )
2322pm2.21d 106 . . . . . . . . 9  |-  ( M  e.  NN0  ->  ( M  <  0  ->  (
0  -  M )  e.  NN ) )
24 nngt0 10585 . . . . . . . . . 10  |-  ( ( 0  -  M )  e.  NN  ->  0  <  ( 0  -  M
) )
25 0re 9613 . . . . . . . . . . 11  |-  0  e.  RR
26 posdif 10066 . . . . . . . . . . 11  |-  ( ( M  e.  RR  /\  0  e.  RR )  ->  ( M  <  0  <->  0  <  ( 0  -  M ) ) )
271, 25, 26sylancl 662 . . . . . . . . . 10  |-  ( M  e.  NN0  ->  ( M  <  0  <->  0  <  ( 0  -  M ) ) )
2824, 27syl5ibr 221 . . . . . . . . 9  |-  ( M  e.  NN0  ->  ( ( 0  -  M )  e.  NN  ->  M  <  0 ) )
2923, 28impbid 191 . . . . . . . 8  |-  ( M  e.  NN0  ->  ( M  <  0  <->  ( 0  -  M )  e.  NN ) )
30 breq2 4460 . . . . . . . . 9  |-  ( N  =  0  ->  ( M  <  N  <->  M  <  0 ) )
31 oveq1 6303 . . . . . . . . . 10  |-  ( N  =  0  ->  ( N  -  M )  =  ( 0  -  M ) )
3231eleq1d 2526 . . . . . . . . 9  |-  ( N  =  0  ->  (
( N  -  M
)  e.  NN  <->  ( 0  -  M )  e.  NN ) )
3330, 32bibi12d 321 . . . . . . . 8  |-  ( N  =  0  ->  (
( M  <  N  <->  ( N  -  M )  e.  NN )  <->  ( M  <  0  <->  ( 0  -  M )  e.  NN ) ) )
3429, 33syl5ibrcom 222 . . . . . . 7  |-  ( M  e.  NN0  ->  ( N  =  0  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
3521, 34jaod 380 . . . . . 6  |-  ( M  e.  NN0  ->  ( ( N  e.  NN  \/  N  =  0 )  ->  ( M  < 
N  <->  ( N  -  M )  e.  NN ) ) )
365, 35syl5bi 217 . . . . 5  |-  ( M  e.  NN0  ->  ( N  e.  NN0  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
3736imp 429 . . . 4  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <  N  <->  ( N  -  M )  e.  NN ) )
38 nn0cn 10826 . . . . . 6  |-  ( N  e.  NN0  ->  N  e.  CC )
39 nn0cn 10826 . . . . . 6  |-  ( M  e.  NN0  ->  M  e.  CC )
40 subeq0 9864 . . . . . 6  |-  ( ( N  e.  CC  /\  M  e.  CC )  ->  ( ( N  -  M )  =  0  <-> 
N  =  M ) )
4138, 39, 40syl2anr 478 . . . . 5  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( ( N  -  M )  =  0  <-> 
N  =  M ) )
42 eqcom 2466 . . . . 5  |-  ( N  =  M  <->  M  =  N )
4341, 42syl6rbb 262 . . . 4  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  =  N  <-> 
( N  -  M
)  =  0 ) )
4437, 43orbi12d 709 . . 3  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( ( M  < 
N  \/  M  =  N )  <->  ( ( N  -  M )  e.  NN  \/  ( N  -  M )  =  0 ) ) )
454, 44bitrd 253 . 2  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( ( N  -  M
)  e.  NN  \/  ( N  -  M
)  =  0 ) ) )
46 elnn0 10818 . 2  |-  ( ( N  -  M )  e.  NN0  <->  ( ( N  -  M )  e.  NN  \/  ( N  -  M )  =  0 ) )
4745, 46syl6bbr 263 1  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( N  -  M )  e.  NN0 ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    \/ wo 368    /\ wa 369    = wceq 1395    e. wcel 1819   class class class wbr 4456  (class class class)co 6296   CCcc 9507   RRcr 9508   0cc0 9509    < clt 9645    <_ cle 9646    - cmin 9824   NNcn 10556   NN0cn0 10816
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1398  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4252  df-iun 4334  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-om 6700  df-recs 7060  df-rdg 7094  df-er 7329  df-en 7536  df-dom 7537  df-sdom 7538  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-nn 10557  df-n0 10817
This theorem is referenced by:  nn0n0n1ge2  10880  elz2  10902  nn0sub2  10945  fz0fzdiffz0  11809  ubmelfzo  11884  repswcshw  12792  swrd2lsw  12902  2swrd2eqwrdeq  12903  psrbagcon  18149  coe1tmmul2  18444  aaliou3lem6  22870  basellem5  23484  omndmul3  27863  jm2.27c  31153  binomcxplemnn0  31458  dvnxpaek  31942  subsubelfzo0  32602
  Copyright terms: Public domain W3C validator