HomeHome Metamath Proof Explorer < Previous   Next >
Related theorems
Unicode version

Theorem nnsub 4450
Description: Subtraction of natural numbers.
Hypotheses
Ref Expression
nnsub.1 |- A e. NN
nnsub.2 |- B e. NN
Assertion
Ref Expression
nnsub |- (A < B <-> (B - A) e. NN)

Proof of Theorem nnsub
StepHypRef Expression
1 nnsub.2 . . 3 |- B e. NN
2 breq2 2066 . . . . 5 |- (x = 1 -> (A < x <-> A < 1))
3 opreq1 3006 . . . . . 6 |- (x = 1 -> (x - A) = (1 - A))
43eleq1d 1155 . . . . 5 |- (x = 1 -> ((x - A) e. NN <-> (1 - A) e. NN))
52, 4imbi12d 474 . . . 4 |- (x = 1 -> ((A < x -> (x - A) e. NN) <-> (A < 1 -> (1 - A) e. NN)))
6 breq2 2066 . . . . 5 |- (x = y -> (A < x <-> A < y))
7 opreq1 3006 . . . . . 6 |- (x = y -> (x - A) = (y - A))
87eleq1d 1155 . . . . 5 |- (x = y -> ((x - A) e. NN <-> (y - A) e. NN))
96, 8imbi12d 474 . . . 4 |- (x = y -> ((A < x -> (x - A) e. NN) <-> (A < y -> (y - A) e. NN)))
10 breq2 2066 . . . . 5 |- (x = (y + 1) -> (A < x <-> A < (y + 1)))
11 opreq1 3006 . . . . . 6 |- (x = (y + 1) -> (x - A) = ((y + 1) - A))
1211eleq1d 1155 . . . . 5 |- (x = (y + 1) -> ((x - A) e. NN <-> ((y + 1) - A) e. NN))
1310, 12imbi12d 474 . . . 4 |- (x = (y + 1) -> ((A < x -> (x - A) e. NN) <-> (A < (y + 1) -> ((y + 1) - A) e. NN)))
14 breq2 2066 . . . . 5 |- (x = B -> (A < x <-> A < B))
15 opreq1 3006 . . . . . 6 |- (x = B -> (x - A) = (B - A))
1615eleq1d 1155 . . . . 5 |- (x = B -> ((x - A) e. NN <-> (B - A) e. NN))
1714, 16imbi12d 474 . . . 4 |- (x = B -> ((A < x -> (x - A) e. NN) <-> (A < B -> (B - A) e. NN)))
18 nnsub.1 . . . . . . 7 |- A e. NN
19 nnge1t 4439 . . . . . . 7 |- (A e. NN -> 1 <_ A)
2018, 19ax-mp 6 . . . . . 6 |- 1 <_ A
21 ax1re 4064 . . . . . . 7 |- 1 e. RR
2218nnre 4429 . . . . . . 7 |- A e. RR
2321, 22lelt 4301 . . . . . 6 |- (1 <_ A <-> -. A < 1)
2420, 23mpbi 164 . . . . 5 |- -. A < 1
2524pm2.21i 73 . . . 4 |- (A < 1 -> (1 - A) e. NN)
26 nnret 4427 . . . . . . . . 9 |- (y e. NN -> y e. RR)
2726, 22jctil 240 . . . . . . . 8 |- (y e. NN -> (A e. RR /\ y e. RR))
28 leloet 4284 . . . . . . . 8 |- ((A e. RR /\ y e. RR) -> (A <_ y <-> (A < y \/ A = y)))
2927, 28syl 12 . . . . . . 7 |- (y e. NN -> (A <_ y <-> (A < y \/ A = y)))
30 nnleltp1t 4448 . . . . . . . 8 |- ((A e. NN /\ y e. NN) -> (A <_ y <-> A < (y + 1)))
3118, 30mpan 518 . . . . . . 7 |- (y e. NN -> (A <_ y <-> A < (y + 1)))
3229, 31bitr3d 408 . . . . . 6 |- (y e. NN -> ((A < y \/ A = y) <-> A < (y + 1)))
33 nncnt 4428 . . . . . . . . . . . . 13 |- (y e. NN -> y e. CC)
3418nncn 4430 . . . . . . . . . . . . 13 |- A e. CC
3533, 34jctir 241 . . . . . . . . . . . 12 |- (y e. NN -> (y e. CC /\ A e. CC))
36 1cn 4101 . . . . . . . . . . . . 13 |- 1 e. CC
37 addsubt 4151 . . . . . . . . . . . . 13 |- ((y e. CC /\ 1 e. CC /\ A e. CC) -> ((y + 1) - A) = ((y - A) + 1))
3836, 37mp3an2 640 . . . . . . . . . . . 12 |- ((y e. CC /\ A e. CC) -> ((y + 1) - A) = ((y - A) + 1))
3935, 38syl 12 . . . . . . . . . . 11 |- (y e. NN -> ((y + 1) - A) = ((y - A) + 1))
4039eleq1d 1155 . . . . . . . . . 10 |- (y e. NN -> (((y + 1) - A) e. NN <-> ((y - A) + 1) e. NN))
41 peano2nn 4433 . . . . . . . . . 10 |- ((y - A) e. NN -> ((y - A) + 1) e. NN)
4240, 41syl5bir 184 . . . . . . . . 9 |- (y e. NN -> ((y - A) e. NN -> ((y + 1) - A) e. NN))
4342syl3d 26 . . . . . . . 8 |- (y e. NN -> ((A < y -> (y - A) e. NN) -> (A < y -> ((y + 1) - A) e. NN)))
4443com23 32 . . . . . . 7 |- (y e. NN -> (A < y -> ((A < y -> (y - A) e. NN) -> ((y + 1) - A) e. NN)))
4534, 36, 34addsub 4153 . . . . . . . . . . . 12 |- ((A + 1) - A) = ((A - A) + 1)
4634subid 4155 . . . . . . . . . . . . 13 |- (A - A) = 0
4746opreq1i 3009 . . . . . . . . . . . 12 |- ((A - A) + 1) = (0 + 1)
4836addid2 4113 . . . . . . . . . . . 12 |- (0 + 1) = 1
4945, 47, 483eqtr 1123 . . . . . . . . . . 11 |- ((A + 1) - A) = 1
50 1nn 4432 . . . . . . . . . . 11 |- 1 e. NN
5149, 50eqeltr 1159 . . . . . . . . . 10 |- ((A + 1) - A) e. NN
52 opreq1 3006 . . . . . . . . . . . 12 |- (A = y -> (A + 1) = (y + 1))
5352opreq1d 3012 . . . . . . . . . . 11 |- (A = y -> ((A + 1) - A) = ((y + 1) - A))
5453eleq1d 1155 . . . . . . . . . 10 |- (A = y -> (((A + 1) - A) e. NN <-> ((y + 1) - A) e. NN))
5551, 54mpbii 168 . . . . . . . . 9 |- (A = y -> ((y + 1) - A) e. NN)
5655a1d 14 . . . . . . . 8 |- (A = y -> ((A < y -> (y - A) e. NN) -> ((y + 1) - A) e. NN))
5756a1i 7 . . . . . . 7 |- (y e. NN -> (A = y -> ((A < y -> (y - A) e. NN) -> ((y + 1) - A) e. NN)))
5844, 57jaod 329 . . . . . 6 |- (y e. NN -> ((A < y \/ A = y) -> ((A < y -> (y - A) e. NN) -> ((y + 1) - A) e. NN)))
5932, 58sylbird 180 . . . . 5 |- (y e. NN -> (A < (y + 1) -> ((A < y -> (y - A) e. NN) -> ((y + 1) - A) e. NN)))
6059com23 32 . . . 4 |- (y e. NN -> ((A < y -> (y - A) e. NN) -> (A < (y + 1) -> ((y + 1) - A) e. NN)))
615, 9, 13, 17, 25, 60nnind 4434 . . 3 |- (B e. NN -> (A < B -> (B - A) e. NN))
621, 61ax-mp 6 . 2 |- (A < B -> (B - A) e. NN)
63 nngt0t 4441 . . 3 |- ((B - A) e. NN -> 0 < (B - A))
641nnre 4429 . . . 4 |- B e. RR
6522, 64posdif 4328 . . 3 |- (A < B <-> 0 < (B - A))
6663, 65sylibr 175 . 2 |- ((B - A) e. NN -> A < B)
6762, 66impbi 139 1 |- (A < B <-> (B - A) e. NN)
Colors of variables: wff set class
Syntax hints:  -. wn 1   -> wi 2   <-> wb 127   \/ wo 195   /\ wa 196   = weq 797   = wceq 1091   e. wcel 1092   class class class wbr 2054  (class class class)co 3001  CCcc 4026  RRcr 4027  0cc0 4028  1c1 4029   + caddc 4031   < clt 4033   - cmin 4089   <_ cle 4092  NNcn 4093
This theorem is referenced by:  nnsubt 4451
This theorem was proved from axioms:  ax-1 3  ax-2 4  ax-3 5  ax-mp 6  ax-4 673  ax-5 674  ax-6 675  ax-7 676  ax-gen 677  ax-8 798  ax-9 799  ax-10 800  ax-11 801  ax-12 802  ax-13 804  ax-14 805  ax-16 922  ax-17 925  ax-ext 1074  ax-rep 1075  ax-un 1076  ax-pow 1077  ax-reg 1078  ax-inf 1079
This theorem depends on definitions:  df-bi 128  df-or 197  df-an 198  df-3or 582  df-3an 583  df-ex 679  df-sb 853  df-eu 1009  df-mo 1010  df-clab 1093  df-cleq 1097  df-clel 1099  df-ne 1192  df-ral 1205  df-rex 1206  df-reu 1207  df-rab 1208  df-v 1349  df-sbc 1441  df-dif 1489  df-un 1490  df-in 1491  df-ss 1492  df-pss 1494  df-nul 1708  df-if 1777  df-pw 1799  df-sn 1811  df-pr 1812  df-tp 1814  df-op 1815  df-uni 1920  df-int 1966  df-iun 1996  df-tr 2042  df-br 2063  df-opab 2098  df-eprel 2122  df-id 2125  df-po 2128  df-so 2138  df-fr 2169  df-we 2186  df-ord 2202  df-on 2203  df-lim 2204  df-suc 2205  df-om 2373  df-xp 2424  df-rel 2425  df-cnv 2426  df-co 2427  df-dm 2428  df-rn 2429  df-res 2430  df-ima 2431  df-fun 2432  df-fn 2433  df-f 2434  df-f1 2435  df-fv 2438  df-rdg 2970  df-opr 3003  df-oprab 3004  df-1o 3104  df-oadd 3106  df-omul 3107  df-er 3200  df-ec 3202  df-qs 3205  df-ni 3794  df-pli 3795  df-mi 3796  df-lti 3797  df-plpq 3829  df-mpq 3830  df-enq 3831  df-nq 3832  df-plq 3833  df-mq 3834  df-rq 3835  df-ltq 3836  df-1q 3837  df-np 3880  df-1p 3881  df-plp 3882  df-mp 3883  df-ltp 3884  df-plpr 3958  df-mpr 3959  df-enr 3960  df-nr 3961  df-plr 3962  df-mr 3963  df-ltr 3964  df-0r 3965  df-1r 3966  df-m1r 3967  df-c 4034  df-0 4035  df-1 4036  df-r 4038  df-plus 4039  df-mul 4040  df-lt 4041  df-sub 4133  df-neg 4135  df-le 4277  df-n 4423
metamath.org