Metamath Proof Explorer


Theorem eluzgtdifelfzo

Description: Membership of the difference of integers in a half-open range of nonnegative integers. (Contributed by Alexander van der Vekens, 17-Sep-2018)

Ref Expression
Assertion eluzgtdifelfzo A B N A B < A N A 0 ..^ N B

Proof

Step Hyp Ref Expression
1 simpl N A B < A N A
2 1 adantl A B N A B < A N A
3 simpl A B A
4 3 adantr A B N A B < A A
5 eluzelz N A N
6 5 ad2antrr N A B < A A B N
7 simprr N A B < A A B B
8 6 7 zsubcld N A B < A A B N B
9 8 ancoms A B N A B < A N B
10 4 9 zaddcld A B N A B < A A + N - B
11 zre B B
12 zre A A
13 posdif B A B < A 0 < A B
14 13 biimpd B A B < A 0 < A B
15 11 12 14 syl2anr A B B < A 0 < A B
16 15 adantld A B N A B < A 0 < A B
17 16 imp A B N A B < A 0 < A B
18 resubcl A B A B
19 12 11 18 syl2an A B A B
20 19 adantr A B N A B < A A B
21 eluzelre N A N
22 21 ad2antrl A B N A B < A N
23 20 22 ltaddposd A B N A B < A 0 < A B N < N + A - B
24 17 23 mpbid A B N A B < A N < N + A - B
25 zcn A A
26 25 ad2antrr A B N A B < A A
27 eluzelcn N A N
28 27 ad2antrl A B N A B < A N
29 zcn B B
30 29 adantl A B B
31 30 adantr A B N A B < A B
32 addsub12 A N B A + N - B = N + A - B
33 32 breq2d A N B N < A + N - B N < N + A - B
34 26 28 31 33 syl3anc A B N A B < A N < A + N - B N < N + A - B
35 24 34 mpbird A B N A B < A N < A + N - B
36 elfzo2 N A ..^ A + N - B N A A + N - B N < A + N - B
37 2 10 35 36 syl3anbrc A B N A B < A N A ..^ A + N - B
38 fzosubel3 N A ..^ A + N - B N B N A 0 ..^ N B
39 37 9 38 syl2anc A B N A B < A N A 0 ..^ N B
40 39 ex A B N A B < A N A 0 ..^ N B