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 BAA+1B=BA

Proof

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