ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  hashfz Unicode version

Theorem hashfz 10842
Description: Value of the numeric cardinality of a nonempty integer range. (Contributed by Stefan O'Rear, 12-Sep-2014.) (Proof shortened by Mario Carneiro, 15-Apr-2015.)
Assertion
Ref Expression
hashfz  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( `  ( A ... B ) )  =  ( ( B  -  A )  +  1 ) )

Proof of Theorem hashfz
StepHypRef Expression
1 eluzel2 9568 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  A  e.  ZZ )
2 eluzelz 9572 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  B  e.  ZZ )
3 1z 9314 . . . . . 6  |-  1  e.  ZZ
4 zsubcl 9329 . . . . . 6  |-  ( ( 1  e.  ZZ  /\  A  e.  ZZ )  ->  ( 1  -  A
)  e.  ZZ )
53, 1, 4sylancr 414 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( 1  -  A )  e.  ZZ )
6 fzen 10079 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ  /\  (
1  -  A )  e.  ZZ )  -> 
( A ... B
)  ~~  ( ( A  +  ( 1  -  A ) ) ... ( B  +  ( 1  -  A
) ) ) )
71, 2, 5, 6syl3anc 1249 . . . 4  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( A ... B )  ~~  (
( A  +  ( 1  -  A ) ) ... ( B  +  ( 1  -  A ) ) ) )
81zcnd 9411 . . . . . 6  |-  ( B  e.  ( ZZ>= `  A
)  ->  A  e.  CC )
9 ax-1cn 7939 . . . . . 6  |-  1  e.  CC
10 pncan3 8200 . . . . . 6  |-  ( ( A  e.  CC  /\  1  e.  CC )  ->  ( A  +  ( 1  -  A ) )  =  1 )
118, 9, 10sylancl 413 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( A  +  ( 1  -  A ) )  =  1 )
12 1cnd 8008 . . . . . 6  |-  ( B  e.  ( ZZ>= `  A
)  ->  1  e.  CC )
132zcnd 9411 . . . . . . 7  |-  ( B  e.  ( ZZ>= `  A
)  ->  B  e.  CC )
1413, 8subcld 8303 . . . . . 6  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( B  -  A )  e.  CC )
1513, 12, 8addsub12d 8326 . . . . . 6  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( B  +  ( 1  -  A ) )  =  ( 1  +  ( B  -  A ) ) )
1612, 14, 15comraddd 8149 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( B  +  ( 1  -  A ) )  =  ( ( B  -  A )  +  1 ) )
1711, 16oveq12d 5918 . . . 4  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( ( A  +  ( 1  -  A ) ) ... ( B  +  ( 1  -  A
) ) )  =  ( 1 ... (
( B  -  A
)  +  1 ) ) )
187, 17breqtrd 4047 . . 3  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( A ... B )  ~~  (
1 ... ( ( B  -  A )  +  1 ) ) )
191, 2fzfigd 10468 . . . 4  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( A ... B )  e.  Fin )
20 1zzd 9315 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  1  e.  ZZ )
212, 1zsubcld 9415 . . . . . 6  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( B  -  A )  e.  ZZ )
2221peano2zd 9413 . . . . 5  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( ( B  -  A )  +  1 )  e.  ZZ )
2320, 22fzfigd 10468 . . . 4  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( 1 ... ( ( B  -  A )  +  1 ) )  e. 
Fin )
24 hashen 10805 . . . 4  |-  ( ( ( A ... B
)  e.  Fin  /\  ( 1 ... (
( B  -  A
)  +  1 ) )  e.  Fin )  ->  ( ( `  ( A ... B ) )  =  ( `  (
1 ... ( ( B  -  A )  +  1 ) ) )  <-> 
( A ... B
)  ~~  ( 1 ... ( ( B  -  A )  +  1 ) ) ) )
2519, 23, 24syl2anc 411 . . 3  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( ( `  ( A ... B
) )  =  ( `  ( 1 ... (
( B  -  A
)  +  1 ) ) )  <->  ( A ... B )  ~~  (
1 ... ( ( B  -  A )  +  1 ) ) ) )
2618, 25mpbird 167 . 2  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( `  ( A ... B ) )  =  ( `  (
1 ... ( ( B  -  A )  +  1 ) ) ) )
27 uznn0sub 9595 . . 3  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( B  -  A )  e.  NN0 )
28 peano2nn0 9251 . . 3  |-  ( ( B  -  A )  e.  NN0  ->  ( ( B  -  A )  +  1 )  e. 
NN0 )
29 hashfz1 10804 . . 3  |-  ( ( ( B  -  A
)  +  1 )  e.  NN0  ->  ( `  (
1 ... ( ( B  -  A )  +  1 ) ) )  =  ( ( B  -  A )  +  1 ) )
3027, 28, 293syl 17 . 2  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( `  (
1 ... ( ( B  -  A )  +  1 ) ) )  =  ( ( B  -  A )  +  1 ) )
3126, 30eqtrd 2222 1  |-  ( B  e.  ( ZZ>= `  A
)  ->  ( `  ( A ... B ) )  =  ( ( B  -  A )  +  1 ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 105    = wceq 1364    e. wcel 2160   class class class wbr 4021   ` cfv 5238  (class class class)co 5900    ~~ cen 6768   Fincfn 6770   CCcc 7844   1c1 7847    + caddc 7849    - cmin 8163   NN0cn0 9211   ZZcz 9288   ZZ>=cuz 9563   ...cfz 10044  ♯chash 10796
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 615  ax-in2 616  ax-io 710  ax-5 1458  ax-7 1459  ax-gen 1460  ax-ie1 1504  ax-ie2 1505  ax-8 1515  ax-10 1516  ax-11 1517  ax-i12 1518  ax-bndl 1520  ax-4 1521  ax-17 1537  ax-i9 1541  ax-ial 1545  ax-i5r 1546  ax-13 2162  ax-14 2163  ax-ext 2171  ax-coll 4136  ax-sep 4139  ax-nul 4147  ax-pow 4195  ax-pr 4230  ax-un 4454  ax-setind 4557  ax-iinf 4608  ax-cnex 7937  ax-resscn 7938  ax-1cn 7939  ax-1re 7940  ax-icn 7941  ax-addcl 7942  ax-addrcl 7943  ax-mulcl 7944  ax-addcom 7946  ax-addass 7948  ax-distr 7950  ax-i2m1 7951  ax-0lt1 7952  ax-0id 7954  ax-rnegex 7955  ax-cnre 7957  ax-pre-ltirr 7958  ax-pre-ltwlin 7959  ax-pre-lttrn 7960  ax-pre-apti 7961  ax-pre-ltadd 7962
This theorem depends on definitions:  df-bi 117  df-dc 836  df-3or 981  df-3an 982  df-tru 1367  df-fal 1370  df-nf 1472  df-sb 1774  df-eu 2041  df-mo 2042  df-clab 2176  df-cleq 2182  df-clel 2185  df-nfc 2321  df-ne 2361  df-nel 2456  df-ral 2473  df-rex 2474  df-reu 2475  df-rab 2477  df-v 2754  df-sbc 2978  df-csb 3073  df-dif 3146  df-un 3148  df-in 3150  df-ss 3157  df-nul 3438  df-pw 3595  df-sn 3616  df-pr 3617  df-op 3619  df-uni 3828  df-int 3863  df-iun 3906  df-br 4022  df-opab 4083  df-mpt 4084  df-tr 4120  df-id 4314  df-iord 4387  df-on 4389  df-ilim 4390  df-suc 4392  df-iom 4611  df-xp 4653  df-rel 4654  df-cnv 4655  df-co 4656  df-dm 4657  df-rn 4658  df-res 4659  df-ima 4660  df-iota 5199  df-fun 5240  df-fn 5241  df-f 5242  df-f1 5243  df-fo 5244  df-f1o 5245  df-fv 5246  df-riota 5855  df-ov 5903  df-oprab 5904  df-mpo 5905  df-1st 6169  df-2nd 6170  df-recs 6334  df-frec 6420  df-1o 6445  df-er 6563  df-en 6771  df-dom 6772  df-fin 6773  df-pnf 8029  df-mnf 8030  df-xr 8031  df-ltxr 8032  df-le 8033  df-sub 8165  df-neg 8166  df-inn 8955  df-n0 9212  df-z 9289  df-uz 9564  df-fz 10045  df-ihash 10797
This theorem is referenced by:  hashfzo  10843  hashfzp1  10845  hashfz0  10846
  Copyright terms: Public domain W3C validator