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

Theorem nn0sub 10847
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 10805 . . . 4  |-  ( M  e.  NN0  ->  M  e.  RR )
2 nn0re 10805 . . . 4  |-  ( N  e.  NN0  ->  N  e.  RR )
3 leloe 9672 . . . 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 10798 . . . . . 6  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
6 elnn0 10798 . . . . . . . 8  |-  ( M  e.  NN0  <->  ( M  e.  NN  \/  M  =  0 ) )
7 nnsub 10575 . . . . . . . . . 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 10566 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  0  <  N )
10 nncn 10545 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  N  e.  CC )
1110subid1d 9920 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  ( N  -  0 )  =  N )
12 id 22 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  N  e.  NN )
1311, 12eqeltrd 2555 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  ( N  -  0 )  e.  NN )
149, 132thd 240 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
0  <  N  <->  ( N  -  0 )  e.  NN ) )
15 breq1 4450 . . . . . . . . . . 11  |-  ( M  =  0  ->  ( M  <  N  <->  0  <  N ) )
16 oveq2 6293 . . . . . . . . . . . 12  |-  ( M  =  0  ->  ( N  -  M )  =  ( N  - 
0 ) )
1716eleq1d 2536 . . . . . . . . . . 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 10823 . . . . . . . . . 10  |-  ( M  e.  NN0  ->  -.  M  <  0 )
2322pm2.21d 106 . . . . . . . . 9  |-  ( M  e.  NN0  ->  ( M  <  0  ->  (
0  -  M )  e.  NN ) )
24 nngt0 10566 . . . . . . . . . 10  |-  ( ( 0  -  M )  e.  NN  ->  0  <  ( 0  -  M
) )
25 0re 9597 . . . . . . . . . . 11  |-  0  e.  RR
26 posdif 10046 . . . . . . . . . . 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 4451 . . . . . . . . 9  |-  ( N  =  0  ->  ( M  <  N  <->  M  <  0 ) )
31 oveq1 6292 . . . . . . . . . 10  |-  ( N  =  0  ->  ( N  -  M )  =  ( 0  -  M ) )
3231eleq1d 2536 . . . . . . . . 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 10806 . . . . . 6  |-  ( N  e.  NN0  ->  N  e.  CC )
39 nn0cn 10806 . . . . . 6  |-  ( M  e.  NN0  ->  M  e.  CC )
40 subeq0 9846 . . . . . 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 2476 . . . . 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 10798 . 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 1379    e. wcel 1767   class class class wbr 4447  (class class class)co 6285   CCcc 9491   RRcr 9492   0cc0 9493    < clt 9629    <_ cle 9630    - cmin 9806   NNcn 10537   NN0cn0 10796
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1601  ax-4 1612  ax-5 1680  ax-6 1719  ax-7 1739  ax-8 1769  ax-9 1771  ax-10 1786  ax-11 1791  ax-12 1803  ax-13 1968  ax-ext 2445  ax-sep 4568  ax-nul 4576  ax-pow 4625  ax-pr 4686  ax-un 6577  ax-resscn 9550  ax-1cn 9551  ax-icn 9552  ax-addcl 9553  ax-addrcl 9554  ax-mulcl 9555  ax-mulrcl 9556  ax-mulcom 9557  ax-addass 9558  ax-mulass 9559  ax-distr 9560  ax-i2m1 9561  ax-1ne0 9562  ax-1rid 9563  ax-rnegex 9564  ax-rrecex 9565  ax-cnre 9566  ax-pre-lttri 9567  ax-pre-lttrn 9568  ax-pre-ltadd 9569  ax-pre-mulgt0 9570
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1382  df-ex 1597  df-nf 1600  df-sb 1712  df-eu 2279  df-mo 2280  df-clab 2453  df-cleq 2459  df-clel 2462  df-nfc 2617  df-ne 2664  df-nel 2665  df-ral 2819  df-rex 2820  df-reu 2821  df-rab 2823  df-v 3115  df-sbc 3332  df-csb 3436  df-dif 3479  df-un 3481  df-in 3483  df-ss 3490  df-pss 3492  df-nul 3786  df-if 3940  df-pw 4012  df-sn 4028  df-pr 4030  df-tp 4032  df-op 4034  df-uni 4246  df-iun 4327  df-br 4448  df-opab 4506  df-mpt 4507  df-tr 4541  df-eprel 4791  df-id 4795  df-po 4800  df-so 4801  df-fr 4838  df-we 4840  df-ord 4881  df-on 4882  df-lim 4883  df-suc 4884  df-xp 5005  df-rel 5006  df-cnv 5007  df-co 5008  df-dm 5009  df-rn 5010  df-res 5011  df-ima 5012  df-iota 5551  df-fun 5590  df-fn 5591  df-f 5592  df-f1 5593  df-fo 5594  df-f1o 5595  df-fv 5596  df-riota 6246  df-ov 6288  df-oprab 6289  df-mpt2 6290  df-om 6686  df-recs 7043  df-rdg 7077  df-er 7312  df-en 7518  df-dom 7519  df-sdom 7520  df-pnf 9631  df-mnf 9632  df-xr 9633  df-ltxr 9634  df-le 9635  df-sub 9808  df-neg 9809  df-nn 10538  df-n0 10797
This theorem is referenced by:  nn0n0n1ge2  10860  elz2  10882  nn0sub2  10924  fz0fzdiffz0  11782  ubmelfzo  11850  repswcshw  12746  swrd2lsw  12856  2swrd2eqwrdeq  12857  psrbagcon  17833  coe1tmmul2  18128  aaliou3lem6  22570  basellem5  23183  omndmul3  27462  jm2.27c  30780  subsubelfzo0  32032
  Copyright terms: Public domain W3C validator