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 A 0 N B 0 N N < A + B B N A 0 A

Proof

Step Hyp Ref Expression
1 elfzelz A 0 N A
2 elfzel2 B 0 N N
3 elfzelz B 0 N B
4 simplr N B A B
5 zsubcl N A N A
6 5 adantlr N B A N A
7 4 6 zsubcld N B A B N A
8 7 adantr N B A N < A + B B N A
9 zre N N
10 9 ad2antrr N B A N
11 zaddcl A B A + B
12 11 zred A B A + B
13 12 expcom B A A + B
14 13 adantl N B A A + B
15 14 imp N B A A + B
16 10 15 10 ltsub1d N B A N < A + B N N < A + B - N
17 zre B B
18 9 17 anim12i N B N B
19 zre A A
20 18 19 anim12i N B A N B A
21 id N N
22 21 21 resubcld N N N
23 22 ad2antrr N B A N N
24 readdcl A B A + B
25 24 expcom B A A + B
26 25 adantl N B A A + B
27 26 imp N B A A + B
28 simpll N B A N
29 27 28 resubcld N B A A + B - N
30 23 29 jca N B A N N A + B - N
31 ltle N N A + B - N N N < A + B - N N N A + B - N
32 20 30 31 3syl N B A N N < A + B - N N N A + B - N
33 zcn N N
34 33 subidd N N N = 0
35 34 ad2antrr N B A N N = 0
36 zcn B B
37 36 adantl N B B
38 37 adantr N B A B
39 33 ad2antrr N B A N
40 zcn A A
41 40 adantl N B A A
42 simp3 B N A A
43 simp1 B N A B
44 42 43 addcomd B N A A + B = B + A
45 44 oveq1d B N A A + B - N = B + A - N
46 subsub3 B N A B N A = B + A - N
47 45 46 eqtr4d B N A A + B - N = B N A
48 38 39 41 47 syl3anc N B A A + B - N = B N A
49 35 48 breq12d N B A N N A + B - N 0 B N A
50 32 49 sylibd N B A N N < A + B - N 0 B N A
51 16 50 sylbid N B A N < A + B 0 B N A
52 51 imp N B A N < A + B 0 B N A
53 elnn0z B N A 0 B N A 0 B N A
54 8 52 53 sylanbrc N B A N < A + B B N A 0
55 54 exp31 N B A N < A + B B N A 0
56 2 3 55 syl2anc B 0 N A N < A + B B N A 0
57 1 56 mpan9 A 0 N B 0 N N < A + B B N A 0
58 57 imp A 0 N B 0 N N < A + B B N A 0
59 elfznn0 A 0 N A 0
60 59 ad2antrr A 0 N B 0 N N < A + B A 0
61 elfzle2 B 0 N B N
62 61 adantl A 0 N B 0 N B N
63 elfzel2 A 0 N N
64 63 zcnd A 0 N N
65 1 zcnd A 0 N A
66 64 65 jca A 0 N N A
67 66 adantr A 0 N B 0 N N A
68 npcan N A N - A + A = N
69 67 68 syl A 0 N B 0 N N - A + A = N
70 62 69 breqtrrd A 0 N B 0 N B N - A + A
71 3 zred B 0 N B
72 71 adantl A 0 N B 0 N B
73 63 zred A 0 N N
74 1 zred A 0 N A
75 73 74 resubcld A 0 N N A
76 75 adantr A 0 N B 0 N N A
77 74 adantr A 0 N B 0 N A
78 72 76 77 lesubadd2d A 0 N B 0 N B N A A B N - A + A
79 70 78 mpbird A 0 N B 0 N B N A A
80 79 adantr A 0 N B 0 N N < A + B B N A A
81 elfz2nn0 B N A 0 A B N A 0 A 0 B N A A
82 58 60 80 81 syl3anbrc A 0 N B 0 N N < A + B B N A 0 A
83 82 ex A 0 N B 0 N N < A + B B N A 0 A