Metamath Proof Explorer


Theorem nnsub

Description: Subtraction of positive integers. (Contributed by NM, 20-Aug-2001) (Revised by Mario Carneiro, 16-May-2014)

Ref Expression
Assertion nnsub ABA<BBA

Proof

Step Hyp Ref Expression
1 breq2 x=1z<xz<1
2 oveq1 x=1xz=1z
3 2 eleq1d x=1xz1z
4 1 3 imbi12d x=1z<xxzz<11z
5 4 ralbidv x=1zz<xxzzz<11z
6 breq2 x=yz<xz<y
7 oveq1 x=yxz=yz
8 7 eleq1d x=yxzyz
9 6 8 imbi12d x=yz<xxzz<yyz
10 9 ralbidv x=yzz<xxzzz<yyz
11 breq2 x=y+1z<xz<y+1
12 oveq1 x=y+1xz=y+1-z
13 12 eleq1d x=y+1xzy+1-z
14 11 13 imbi12d x=y+1z<xxzz<y+1y+1-z
15 14 ralbidv x=y+1zz<xxzzz<y+1y+1-z
16 breq2 x=Bz<xz<B
17 oveq1 x=Bxz=Bz
18 17 eleq1d x=BxzBz
19 16 18 imbi12d x=Bz<xxzz<BBz
20 19 ralbidv x=Bzz<xxzzz<BBz
21 nnnlt1 z¬z<1
22 21 pm2.21d zz<11z
23 22 rgen zz<11z
24 breq1 z=xz<yx<y
25 oveq2 z=xyz=yx
26 25 eleq1d z=xyzyx
27 24 26 imbi12d z=xz<yyzx<yyx
28 27 cbvralvw zz<yyzxx<yyx
29 nncn yy
30 29 adantr yzy
31 ax-1cn 1
32 pncan y1y+1-1=y
33 30 31 32 sylancl yzy+1-1=y
34 simpl yzy
35 33 34 eqeltrd yzy+1-1
36 oveq2 z=1y+1-z=y+1-1
37 36 eleq1d z=1y+1-zy+1-1
38 35 37 syl5ibrcom yzz=1y+1-z
39 38 2a1dd yzz=1xx<yyxz<y+1y+1-z
40 breq1 x=z1x<yz1<y
41 oveq2 x=z1yx=yz1
42 41 eleq1d x=z1yxyz1
43 40 42 imbi12d x=z1x<yyxz1<yyz1
44 43 rspcv z1xx<yyxz1<yyz1
45 nnre zz
46 nnre yy
47 1re 1
48 ltsubadd z1yz1<yz<y+1
49 47 48 mp3an2 zyz1<yz<y+1
50 45 46 49 syl2anr yzz1<yz<y+1
51 nncn zz
52 subsub3 yz1yz1=y+1-z
53 31 52 mp3an3 yzyz1=y+1-z
54 29 51 53 syl2an yzyz1=y+1-z
55 54 eleq1d yzyz1y+1-z
56 50 55 imbi12d yzz1<yyz1z<y+1y+1-z
57 56 biimpd yzz1<yyz1z<y+1y+1-z
58 44 57 syl9r yzz1xx<yyxz<y+1y+1-z
59 nn1m1nn zz=1z1
60 59 adantl yzz=1z1
61 39 58 60 mpjaod yzxx<yyxz<y+1y+1-z
62 61 ralrimdva yxx<yyxzz<y+1y+1-z
63 28 62 biimtrid yzz<yyzzz<y+1y+1-z
64 5 10 15 20 23 63 nnind Bzz<BBz
65 breq1 z=Az<BA<B
66 oveq2 z=ABz=BA
67 66 eleq1d z=ABzBA
68 65 67 imbi12d z=Az<BBzA<BBA
69 68 rspcva Azz<BBzA<BBA
70 64 69 sylan2 ABA<BBA
71 nngt0 BA0<BA
72 nnre AA
73 nnre BB
74 posdif ABA<B0<BA
75 72 73 74 syl2an ABA<B0<BA
76 71 75 imbitrrid ABBAA<B
77 70 76 impbid ABA<BBA