Metamath Proof Explorer


Theorem 2elfz2melfz

Description: If the sum of two integers of a 0-based finite set of sequential integers is greater than the upper bound, the difference between one of the integers and the difference between the upper bound and the other integer is in the 0-based finite set of sequential integers with the first integer as upper bound. (Contributed by Alexander van der Vekens, 7-Apr-2018) (Revised by Alexander van der Vekens, 31-May-2018)

Ref Expression
Assertion 2elfz2melfz A0NB0NN<A+BBNA0A

Proof

Step Hyp Ref Expression
1 elfzelz A0NA
2 elfzel2 B0NN
3 elfzelz B0NB
4 simplr NBAB
5 zsubcl NANA
6 5 adantlr NBANA
7 4 6 zsubcld NBABNA
8 7 adantr NBAN<A+BBNA
9 zre NN
10 9 ad2antrr NBAN
11 zaddcl ABA+B
12 11 zred ABA+B
13 12 expcom BAA+B
14 13 adantl NBAA+B
15 14 imp NBAA+B
16 10 15 10 ltsub1d NBAN<A+BNN<A+B-N
17 zre BB
18 9 17 anim12i NBNB
19 zre AA
20 18 19 anim12i NBANBA
21 id NN
22 21 21 resubcld NNN
23 22 ad2antrr NBANN
24 readdcl ABA+B
25 24 expcom BAA+B
26 25 adantl NBAA+B
27 26 imp NBAA+B
28 simpll NBAN
29 27 28 resubcld NBAA+B-N
30 23 29 jca NBANNA+B-N
31 ltle NNA+B-NNN<A+B-NNNA+B-N
32 20 30 31 3syl NBANN<A+B-NNNA+B-N
33 zcn NN
34 33 subidd NNN=0
35 34 ad2antrr NBANN=0
36 zcn BB
37 36 adantl NBB
38 37 adantr NBAB
39 33 ad2antrr NBAN
40 zcn AA
41 40 adantl NBAA
42 simp3 BNAA
43 simp1 BNAB
44 42 43 addcomd BNAA+B=B+A
45 44 oveq1d BNAA+B-N=B+A-N
46 subsub3 BNABNA=B+A-N
47 45 46 eqtr4d BNAA+B-N=BNA
48 38 39 41 47 syl3anc NBAA+B-N=BNA
49 35 48 breq12d NBANNA+B-N0BNA
50 32 49 sylibd NBANN<A+B-N0BNA
51 16 50 sylbid NBAN<A+B0BNA
52 51 imp NBAN<A+B0BNA
53 elnn0z BNA0BNA0BNA
54 8 52 53 sylanbrc NBAN<A+BBNA0
55 54 exp31 NBAN<A+BBNA0
56 2 3 55 syl2anc B0NAN<A+BBNA0
57 1 56 mpan9 A0NB0NN<A+BBNA0
58 57 imp A0NB0NN<A+BBNA0
59 elfznn0 A0NA0
60 59 ad2antrr A0NB0NN<A+BA0
61 elfzle2 B0NBN
62 61 adantl A0NB0NBN
63 elfzel2 A0NN
64 63 zcnd A0NN
65 1 zcnd A0NA
66 64 65 jca A0NNA
67 66 adantr A0NB0NNA
68 npcan NAN-A+A=N
69 67 68 syl A0NB0NN-A+A=N
70 62 69 breqtrrd A0NB0NBN-A+A
71 3 zred B0NB
72 71 adantl A0NB0NB
73 63 zred A0NN
74 1 zred A0NA
75 73 74 resubcld A0NNA
76 75 adantr A0NB0NNA
77 74 adantr A0NB0NA
78 72 76 77 lesubadd2d A0NB0NBNAABN-A+A
79 70 78 mpbird A0NB0NBNAA
80 79 adantr A0NB0NN<A+BBNAA
81 elfz2nn0 BNA0ABNA0A0BNAA
82 58 60 80 81 syl3anbrc A0NB0NN<A+BBNA0A
83 82 ex A0NB0NN<A+BBNA0A