Metamath Proof Explorer


Theorem ubmelm1fzo

Description: The result of subtracting 1 and an integer of a half-open range of nonnegative integers from the upper bound of this range is contained in this range. (Contributed by AV, 23-Mar-2018) (Revised by AV, 30-Oct-2018)

Ref Expression
Assertion ubmelm1fzo K 0 ..^ N N - K - 1 0 ..^ N

Proof

Step Hyp Ref Expression
1 elfzo0 K 0 ..^ N K 0 N K < N
2 nnz N N
3 2 adantr N K 0 N
4 nn0z K 0 K
5 4 adantl N K 0 K
6 3 5 zsubcld N K 0 N K
7 6 ancoms K 0 N N K
8 peano2zm N K N - K - 1
9 7 8 syl K 0 N N - K - 1
10 9 3adant3 K 0 N K < N N - K - 1
11 simp3 K 0 N K < N K < N
12 4 2 anim12i K 0 N K N
13 12 3adant3 K 0 N K < N K N
14 znnsub K N K < N N K
15 13 14 syl K 0 N K < N K < N N K
16 11 15 mpbid K 0 N K < N N K
17 nnm1ge0 N K 0 N - K - 1
18 16 17 syl K 0 N K < N 0 N - K - 1
19 elnn0z N - K - 1 0 N - K - 1 0 N - K - 1
20 10 18 19 sylanbrc K 0 N K < N N - K - 1 0
21 simp2 K 0 N K < N N
22 nncn N N
23 22 adantl K 0 N N
24 nn0cn K 0 K
25 24 adantr K 0 N K
26 1cnd K 0 N 1
27 23 25 26 subsub4d K 0 N N - K - 1 = N K + 1
28 nn0p1gt0 K 0 0 < K + 1
29 28 adantr K 0 N 0 < K + 1
30 nn0re K 0 K
31 peano2re K K + 1
32 30 31 syl K 0 K + 1
33 nnre N N
34 ltsubpos K + 1 N 0 < K + 1 N K + 1 < N
35 32 33 34 syl2an K 0 N 0 < K + 1 N K + 1 < N
36 29 35 mpbid K 0 N N K + 1 < N
37 27 36 eqbrtrd K 0 N N - K - 1 < N
38 37 3adant3 K 0 N K < N N - K - 1 < N
39 elfzo0 N - K - 1 0 ..^ N N - K - 1 0 N N - K - 1 < N
40 20 21 38 39 syl3anbrc K 0 N K < N N - K - 1 0 ..^ N
41 1 40 sylbi K 0 ..^ N N - K - 1 0 ..^ N