Metamath Proof Explorer


Theorem hashfzp1

Description: Value of the numeric cardinality of a (possibly empty) integer range. (Contributed by AV, 19-Jun-2021)

Ref Expression
Assertion hashfzp1 B A A + 1 B = B A

Proof

Step Hyp Ref Expression
1 hash0 = 0
2 eluzelre B A B
3 2 ltp1d B A B < B + 1
4 eluzelz B A B
5 peano2z B B + 1
6 5 ancri B B + 1 B
7 fzn B + 1 B B < B + 1 B + 1 B =
8 4 6 7 3syl B A B < B + 1 B + 1 B =
9 3 8 mpbid B A B + 1 B =
10 9 fveq2d B A B + 1 B =
11 4 zcnd B A B
12 11 subidd B A B B = 0
13 1 10 12 3eqtr4a B A B + 1 B = B B
14 oveq1 A = B A + 1 = B + 1
15 14 fvoveq1d A = B A + 1 B = B + 1 B
16 oveq2 A = B B A = B B
17 15 16 eqeq12d A = B A + 1 B = B A B + 1 B = B B
18 13 17 syl5ibr A = B B A A + 1 B = B A
19 uzp1 B A B = A B A + 1
20 pm2.24 A = B ¬ A = B B A + 1
21 20 eqcoms B = A ¬ A = B B A + 1
22 ax-1 B A + 1 ¬ A = B B A + 1
23 21 22 jaoi B = A B A + 1 ¬ A = B B A + 1
24 19 23 syl B A ¬ A = B B A + 1
25 24 impcom ¬ A = B B A B A + 1
26 hashfz B A + 1 A + 1 B = B - A + 1 + 1
27 25 26 syl ¬ A = B B A A + 1 B = B - A + 1 + 1
28 eluzel2 B A A
29 28 zcnd B A A
30 1cnd B A 1
31 11 29 30 nppcan2d B A B - A + 1 + 1 = B A
32 31 adantl ¬ A = B B A B - A + 1 + 1 = B A
33 27 32 eqtrd ¬ A = B B A A + 1 B = B A
34 33 ex ¬ A = B B A A + 1 B = B A
35 18 34 pm2.61i B A A + 1 B = B A