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

Theorem nn0sub 10272
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 10232 . . . 4  |-  ( M  e.  NN0  ->  M  e.  RR )
2 nn0re 10232 . . . 4  |-  ( N  e.  NN0  ->  N  e.  RR )
3 leloe 9163 . . . 4  |-  ( ( M  e.  RR  /\  N  e.  RR )  ->  ( M  <_  N  <->  ( M  <  N  \/  M  =  N )
) )
41, 2, 3syl2an 465 . . 3  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( M  <  N  \/  M  =  N )
) )
5 elnn0 10225 . . . . . 6  |-  ( N  e.  NN0  <->  ( N  e.  NN  \/  N  =  0 ) )
6 elnn0 10225 . . . . . . . 8  |-  ( M  e.  NN0  <->  ( M  e.  NN  \/  M  =  0 ) )
7 nnsub 10040 . . . . . . . . . 10  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) )
87ex 425 . . . . . . . . 9  |-  ( M  e.  NN  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
9 nngt0 10031 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  0  <  N )
10 nncn 10010 . . . . . . . . . . . . 13  |-  ( N  e.  NN  ->  N  e.  CC )
1110subid1d 9402 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  ( N  -  0 )  =  N )
12 id 21 . . . . . . . . . . . 12  |-  ( N  e.  NN  ->  N  e.  NN )
1311, 12eqeltrd 2512 . . . . . . . . . . 11  |-  ( N  e.  NN  ->  ( N  -  0 )  e.  NN )
149, 132thd 233 . . . . . . . . . 10  |-  ( N  e.  NN  ->  (
0  <  N  <->  ( N  -  0 )  e.  NN ) )
15 breq1 4217 . . . . . . . . . . 11  |-  ( M  =  0  ->  ( M  <  N  <->  0  <  N ) )
16 oveq2 6091 . . . . . . . . . . . 12  |-  ( M  =  0  ->  ( N  -  M )  =  ( N  - 
0 ) )
1716eleq1d 2504 . . . . . . . . . . 11  |-  ( M  =  0  ->  (
( N  -  M
)  e.  NN  <->  ( N  -  0 )  e.  NN ) )
1815, 17bibi12d 314 . . . . . . . . . 10  |-  ( M  =  0  ->  (
( M  <  N  <->  ( N  -  M )  e.  NN )  <->  ( 0  <  N  <->  ( N  -  0 )  e.  NN ) ) )
1914, 18syl5ibr 214 . . . . . . . . 9  |-  ( M  =  0  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
208, 19jaoi 370 . . . . . . . 8  |-  ( ( M  e.  NN  \/  M  =  0 )  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
216, 20sylbi 189 . . . . . . 7  |-  ( M  e.  NN0  ->  ( N  e.  NN  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
22 nn0nlt0 10250 . . . . . . . . . 10  |-  ( M  e.  NN0  ->  -.  M  <  0 )
2322pm2.21d 101 . . . . . . . . 9  |-  ( M  e.  NN0  ->  ( M  <  0  ->  (
0  -  M )  e.  NN ) )
24 nngt0 10031 . . . . . . . . . 10  |-  ( ( 0  -  M )  e.  NN  ->  0  <  ( 0  -  M
) )
25 0re 9093 . . . . . . . . . . 11  |-  0  e.  RR
26 posdif 9523 . . . . . . . . . . 11  |-  ( ( M  e.  RR  /\  0  e.  RR )  ->  ( M  <  0  <->  0  <  ( 0  -  M ) ) )
271, 25, 26sylancl 645 . . . . . . . . . 10  |-  ( M  e.  NN0  ->  ( M  <  0  <->  0  <  ( 0  -  M ) ) )
2824, 27syl5ibr 214 . . . . . . . . 9  |-  ( M  e.  NN0  ->  ( ( 0  -  M )  e.  NN  ->  M  <  0 ) )
2923, 28impbid 185 . . . . . . . 8  |-  ( M  e.  NN0  ->  ( M  <  0  <->  ( 0  -  M )  e.  NN ) )
30 breq2 4218 . . . . . . . . 9  |-  ( N  =  0  ->  ( M  <  N  <->  M  <  0 ) )
31 oveq1 6090 . . . . . . . . . 10  |-  ( N  =  0  ->  ( N  -  M )  =  ( 0  -  M ) )
3231eleq1d 2504 . . . . . . . . 9  |-  ( N  =  0  ->  (
( N  -  M
)  e.  NN  <->  ( 0  -  M )  e.  NN ) )
3330, 32bibi12d 314 . . . . . . . 8  |-  ( N  =  0  ->  (
( M  <  N  <->  ( N  -  M )  e.  NN )  <->  ( M  <  0  <->  ( 0  -  M )  e.  NN ) ) )
3429, 33syl5ibrcom 215 . . . . . . 7  |-  ( M  e.  NN0  ->  ( N  =  0  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
3521, 34jaod 371 . . . . . 6  |-  ( M  e.  NN0  ->  ( ( N  e.  NN  \/  N  =  0 )  ->  ( M  < 
N  <->  ( N  -  M )  e.  NN ) ) )
365, 35syl5bi 210 . . . . 5  |-  ( M  e.  NN0  ->  ( N  e.  NN0  ->  ( M  <  N  <->  ( N  -  M )  e.  NN ) ) )
3736imp 420 . . . 4  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <  N  <->  ( N  -  M )  e.  NN ) )
38 nn0cn 10233 . . . . . 6  |-  ( N  e.  NN0  ->  N  e.  CC )
39 nn0cn 10233 . . . . . 6  |-  ( M  e.  NN0  ->  M  e.  CC )
40 subeq0 9329 . . . . . 6  |-  ( ( N  e.  CC  /\  M  e.  CC )  ->  ( ( N  -  M )  =  0  <-> 
N  =  M ) )
4138, 39, 40syl2anr 466 . . . . 5  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( ( N  -  M )  =  0  <-> 
N  =  M ) )
42 eqcom 2440 . . . . 5  |-  ( N  =  M  <->  M  =  N )
4341, 42syl6rbb 255 . . . 4  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  =  N  <-> 
( N  -  M
)  =  0 ) )
4437, 43orbi12d 692 . . 3  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( ( M  < 
N  \/  M  =  N )  <->  ( ( N  -  M )  e.  NN  \/  ( N  -  M )  =  0 ) ) )
454, 44bitrd 246 . 2  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( ( N  -  M
)  e.  NN  \/  ( N  -  M
)  =  0 ) ) )
46 elnn0 10225 . 2  |-  ( ( N  -  M )  e.  NN0  <->  ( ( N  -  M )  e.  NN  \/  ( N  -  M )  =  0 ) )
4745, 46syl6bbr 256 1  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M  <_  N  <->  ( N  -  M )  e.  NN0 ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 178    \/ wo 359    /\ wa 360    = wceq 1653    e. wcel 1726   class class class wbr 4214  (class class class)co 6083   CCcc 8990   RRcr 8991   0cc0 8992    < clt 9122    <_ cle 9123    - cmin 9293   NNcn 10002   NN0cn0 10223
This theorem is referenced by:  nn0n0n1ge2  10282  elz2  10300  nn0sub2  10337  psrbagcon  16438  coe1tmmul2  16670  aaliou3lem6  20267  basellem5  20869  jm2.27c  27080  fz0fzdiffz0  28130  subsubelfzo0  28146
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-riota 6551  df-recs 6635  df-rdg 6670  df-er 6907  df-en 7112  df-dom 7113  df-sdom 7114  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-nn 10003  df-n0 10224
  Copyright terms: Public domain W3C validator