MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  wrdred1hash Structured version   Visualization version   GIF version

Theorem wrdred1hash 14600
Description: The length of a word truncated by a symbol. (Contributed by Alexander van der Vekens, 1-Nov-2017.) (Revised by AV, 29-Jan-2021.)
Assertion
Ref Expression
wrdred1hash ((𝐹 ∈ Word 𝑆 ∧ 1 ≤ (♯‘𝐹)) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1))

Proof of Theorem wrdred1hash
StepHypRef Expression
1 lencl 14572 . . 3 (𝐹 ∈ Word 𝑆 → (♯‘𝐹) ∈ ℕ0)
2 wrdf 14557 . . . 4 (𝐹 ∈ Word 𝑆𝐹:(0..^(♯‘𝐹))⟶𝑆)
3 ffn 6708 . . . 4 (𝐹:(0..^(♯‘𝐹))⟶𝑆𝐹 Fn (0..^(♯‘𝐹)))
4 nn0z 12617 . . . . . . . . . . 11 ((♯‘𝐹) ∈ ℕ0 → (♯‘𝐹) ∈ ℤ)
5 fzossrbm1 13719 . . . . . . . . . . 11 ((♯‘𝐹) ∈ ℤ → (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹)))
64, 5syl 18 . . . . . . . . . 10 ((♯‘𝐹) ∈ ℕ0 → (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹)))
76adantr 485 . . . . . . . . 9 (((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹)))
87adantl 486 . . . . . . . 8 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹)))
9 fnssresb 6660 . . . . . . . . 9 (𝐹 Fn (0..^(♯‘𝐹)) → ((𝐹 ↾ (0..^((♯‘𝐹) − 1))) Fn (0..^((♯‘𝐹) − 1)) ↔ (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹))))
109adantr 485 . . . . . . . 8 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → ((𝐹 ↾ (0..^((♯‘𝐹) − 1))) Fn (0..^((♯‘𝐹) − 1)) ↔ (0..^((♯‘𝐹) − 1)) ⊆ (0..^(♯‘𝐹))))
118, 10mpbird 260 . . . . . . 7 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → (𝐹 ↾ (0..^((♯‘𝐹) − 1))) Fn (0..^((♯‘𝐹) − 1)))
12 hashfn 14413 . . . . . . 7 ((𝐹 ↾ (0..^((♯‘𝐹) − 1))) Fn (0..^((♯‘𝐹) − 1)) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = (♯‘(0..^((♯‘𝐹) − 1))))
1311, 12syl 18 . . . . . 6 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = (♯‘(0..^((♯‘𝐹) − 1))))
14 1nn0 12522 . . . . . . . . 9 1 ∈ ℕ0
15 nn0sub2 12659 . . . . . . . . 9 ((1 ∈ ℕ0 ∧ (♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → ((♯‘𝐹) − 1) ∈ ℕ0)
1614, 15mp3an1 1474 . . . . . . . 8 (((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → ((♯‘𝐹) − 1) ∈ ℕ0)
17 hashfzo0 14469 . . . . . . . 8 (((♯‘𝐹) − 1) ∈ ℕ0 → (♯‘(0..^((♯‘𝐹) − 1))) = ((♯‘𝐹) − 1))
1816, 17syl 18 . . . . . . 7 (((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → (♯‘(0..^((♯‘𝐹) − 1))) = ((♯‘𝐹) − 1))
1918adantl 486 . . . . . 6 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → (♯‘(0..^((♯‘𝐹) − 1))) = ((♯‘𝐹) − 1))
2013, 19eqtrd 2804 . . . . 5 ((𝐹 Fn (0..^(♯‘𝐹)) ∧ ((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹))) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1))
2120ex 417 . . . 4 (𝐹 Fn (0..^(♯‘𝐹)) → (((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1)))
222, 3, 213syl 19 . . 3 (𝐹 ∈ Word 𝑆 → (((♯‘𝐹) ∈ ℕ0 ∧ 1 ≤ (♯‘𝐹)) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1)))
231, 22mpand 707 . 2 (𝐹 ∈ Word 𝑆 → (1 ≤ (♯‘𝐹) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1)))
2423imp 411 1 ((𝐹 ∈ Word 𝑆 ∧ 1 ≤ (♯‘𝐹)) → (♯‘(𝐹 ↾ (0..^((♯‘𝐹) − 1)))) = ((♯‘𝐹) − 1))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 209  wa 400   = wceq 1567  wcel 2149  wss 3913   class class class wbr 5113  cres 5666   Fn wfn 6534  wf 6535  cfv 6539  (class class class)co 7413  0cc0 11102  1c1 11103  cle 11246  cmin 11443  0cn0 12506  cz 12593  ..^cfzo 13684  chash 14368  Word cword 14552
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1822  ax-4 1836  ax-5 1937  ax-6 1994  ax-7 2035  ax-8 2151  ax-9 2159  ax-10 2182  ax-11 2198  ax-12 2219  ax-ext 2741  ax-rep 5242  ax-sep 5261  ax-nul 5273  ax-pow 5339  ax-pr 5407  ax-un 7735  ax-cnex 11158  ax-resscn 11159  ax-1cn 11160  ax-icn 11161  ax-addcl 11162  ax-addrcl 11163  ax-mulcl 11164  ax-mulrcl 11165  ax-mulcom 11166  ax-addass 11167  ax-mulass 11168  ax-distr 11169  ax-i2m1 11170  ax-1ne0 11171  ax-1rid 11172  ax-rnegex 11173  ax-rrecex 11174  ax-cnre 11175  ax-pre-lttri 11176  ax-pre-lttrn 11177  ax-pre-ltadd 11178  ax-pre-mulgt0 11179
This theorem depends on definitions:  df-bi 210  df-an 401  df-or 861  df-3or 1102  df-3an 1103  df-tru 1570  df-fal 1580  df-ex 1807  df-nf 1811  df-sb 2098  df-mo 2573  df-eu 2603  df-clab 2748  df-cleq 2761  df-clel 2844  df-nfc 2918  df-ne 2965  df-nel 3071  df-ral 3086  df-rex 3096  df-reu 3377  df-rab 3424  df-v 3465  df-sbc 3754  df-csb 3862  df-dif 3916  df-un 3918  df-in 3920  df-ss 3930  df-pss 3933  df-nul 4295  df-if 4493  df-pw 4569  df-sn 4595  df-pr 4597  df-op 4601  df-uni 4877  df-int 4917  df-iun 4962  df-br 5114  df-opab 5178  df-mpt 5197  df-tr 5223  df-id 5559  df-eprel 5564  df-po 5572  df-so 5573  df-fr 5617  df-we 5619  df-xp 5670  df-rel 5671  df-cnv 5672  df-co 5673  df-dm 5674  df-rn 5675  df-res 5676  df-ima 5677  df-pred 6305  df-ord 6366  df-on 6367  df-lim 6368  df-suc 6369  df-iota 6495  df-fun 6541  df-fn 6542  df-f 6543  df-f1 6544  df-fo 6545  df-f1o 6546  df-fv 6547  df-riota 7370  df-ov 7416  df-oprab 7417  df-mpo 7418  df-om 7865  df-1st 7988  df-2nd 7989  df-frecs 8280  df-wrecs 8311  df-recs 8360  df-rdg 8399  df-1o 8455  df-er 8696  df-en 8946  df-dom 8947  df-sdom 8948  df-fin 8949  df-card 9927  df-pnf 11247  df-mnf 11248  df-xr 11249  df-ltxr 11250  df-le 11251  df-sub 11445  df-neg 11446  df-nn 12236  df-n0 12507  df-z 12594  df-uz 12865  df-fz 13538  df-fzo 13685  df-hash 14369  df-word 14553
This theorem is referenced by:  redwlklem  29962  redwlk  29963
  Copyright terms: Public domain W3C validator