Metamath Proof Explorer


Theorem pfxres

Description: Value of the prefix extractor as the restriction of a word. (Contributed by Stefan O'Rear, 24-Aug-2015) (Revised by AV, 2-May-2020)

Ref Expression
Assertion pfxres ⊢ S ∈ Word A ∧ L ∈ 0 … S → S prefix L = S ↾ 0 ..^ L

Proof

Step Hyp Ref Expression
1 pfxmpt ⊢ S ∈ Word A ∧ L ∈ 0 … S → S prefix L = x ∈ 0 ..^ L ⟼ S ⁡ x
2 wrdf ⊢ S ∈ Word A → S : 0 ..^ S ⟶ A
3 2 adantr ⊢ S ∈ Word A ∧ L ∈ 0 … S → S : 0 ..^ S ⟶ A
4 elfzuz3 ⊢ L ∈ 0 … S → S ∈ ℤ ≥ L
5 4 adantl ⊢ S ∈ Word A ∧ L ∈ 0 … S → S ∈ ℤ ≥ L
6 fzoss2 ⊢ S ∈ ℤ ≥ L → 0 ..^ L ⊆ 0 ..^ S
7 5 6 syl ⊢ S ∈ Word A ∧ L ∈ 0 … S → 0 ..^ L ⊆ 0 ..^ S
8 3 7 feqresmpt ⊢ S ∈ Word A ∧ L ∈ 0 … S → S ↾ 0 ..^ L = x ∈ 0 ..^ L ⟼ S ⁡ x
9 1 8 eqtr4d ⊢ S ∈ Word A ∧ L ∈ 0 … S → S prefix L = S ↾ 0 ..^ L