Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
Mirrors > Home > MPE Home > Th. List > pfxccat1 | Structured version Visualization version GIF version |
Description: Recover the left half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015.) (Revised by AV, 6-May-2020.) |
Ref | Expression |
---|---|
pfxccat1 | ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) prefix (♯‘𝑆)) = 𝑆) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | ccatcl 13987 | . . 3 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (𝑆 ++ 𝑇) ∈ Word 𝐵) | |
2 | lencl 13946 | . . . . . 6 ⊢ (𝑆 ∈ Word 𝐵 → (♯‘𝑆) ∈ ℕ0) | |
3 | lencl 13946 | . . . . . 6 ⊢ (𝑇 ∈ Word 𝐵 → (♯‘𝑇) ∈ ℕ0) | |
4 | 2, 3 | anim12i 615 | . . . . 5 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((♯‘𝑆) ∈ ℕ0 ∧ (♯‘𝑇) ∈ ℕ0)) |
5 | nn0fz0 13068 | . . . . . . 7 ⊢ ((♯‘𝑆) ∈ ℕ0 ↔ (♯‘𝑆) ∈ (0...(♯‘𝑆))) | |
6 | 2, 5 | sylib 221 | . . . . . 6 ⊢ (𝑆 ∈ Word 𝐵 → (♯‘𝑆) ∈ (0...(♯‘𝑆))) |
7 | 6 | adantr 484 | . . . . 5 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (♯‘𝑆) ∈ (0...(♯‘𝑆))) |
8 | elfz0add 13069 | . . . . 5 ⊢ (((♯‘𝑆) ∈ ℕ0 ∧ (♯‘𝑇) ∈ ℕ0) → ((♯‘𝑆) ∈ (0...(♯‘𝑆)) → (♯‘𝑆) ∈ (0...((♯‘𝑆) + (♯‘𝑇))))) | |
9 | 4, 7, 8 | sylc 65 | . . . 4 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (♯‘𝑆) ∈ (0...((♯‘𝑆) + (♯‘𝑇)))) |
10 | ccatlen 13988 | . . . . 5 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (♯‘(𝑆 ++ 𝑇)) = ((♯‘𝑆) + (♯‘𝑇))) | |
11 | 10 | oveq2d 7173 | . . . 4 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (0...(♯‘(𝑆 ++ 𝑇))) = (0...((♯‘𝑆) + (♯‘𝑇)))) |
12 | 9, 11 | eleqtrrd 2856 | . . 3 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (♯‘𝑆) ∈ (0...(♯‘(𝑆 ++ 𝑇)))) |
13 | pfxres 14102 | . . 3 ⊢ (((𝑆 ++ 𝑇) ∈ Word 𝐵 ∧ (♯‘𝑆) ∈ (0...(♯‘(𝑆 ++ 𝑇)))) → ((𝑆 ++ 𝑇) prefix (♯‘𝑆)) = ((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆)))) | |
14 | 1, 12, 13 | syl2anc 587 | . 2 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) prefix (♯‘𝑆)) = ((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆)))) |
15 | ccatvalfn 13996 | . . . 4 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (𝑆 ++ 𝑇) Fn (0..^((♯‘𝑆) + (♯‘𝑇)))) | |
16 | 2 | nn0zd 12138 | . . . . . . 7 ⊢ (𝑆 ∈ Word 𝐵 → (♯‘𝑆) ∈ ℤ) |
17 | 16 | uzidd 12312 | . . . . . 6 ⊢ (𝑆 ∈ Word 𝐵 → (♯‘𝑆) ∈ (ℤ≥‘(♯‘𝑆))) |
18 | uzaddcl 12358 | . . . . . 6 ⊢ (((♯‘𝑆) ∈ (ℤ≥‘(♯‘𝑆)) ∧ (♯‘𝑇) ∈ ℕ0) → ((♯‘𝑆) + (♯‘𝑇)) ∈ (ℤ≥‘(♯‘𝑆))) | |
19 | 17, 3, 18 | syl2an 598 | . . . . 5 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((♯‘𝑆) + (♯‘𝑇)) ∈ (ℤ≥‘(♯‘𝑆))) |
20 | fzoss2 13128 | . . . . 5 ⊢ (((♯‘𝑆) + (♯‘𝑇)) ∈ (ℤ≥‘(♯‘𝑆)) → (0..^(♯‘𝑆)) ⊆ (0..^((♯‘𝑆) + (♯‘𝑇)))) | |
21 | 19, 20 | syl 17 | . . . 4 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → (0..^(♯‘𝑆)) ⊆ (0..^((♯‘𝑆) + (♯‘𝑇)))) |
22 | 15, 21 | fnssresd 6460 | . . 3 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆))) Fn (0..^(♯‘𝑆))) |
23 | wrdfn 13941 | . . . 4 ⊢ (𝑆 ∈ Word 𝐵 → 𝑆 Fn (0..^(♯‘𝑆))) | |
24 | 23 | adantr 484 | . . 3 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → 𝑆 Fn (0..^(♯‘𝑆))) |
25 | fvres 6683 | . . . . 5 ⊢ (𝑘 ∈ (0..^(♯‘𝑆)) → (((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆)))‘𝑘) = ((𝑆 ++ 𝑇)‘𝑘)) | |
26 | 25 | adantl 485 | . . . 4 ⊢ (((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) ∧ 𝑘 ∈ (0..^(♯‘𝑆))) → (((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆)))‘𝑘) = ((𝑆 ++ 𝑇)‘𝑘)) |
27 | ccatval1 13991 | . . . . 5 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵 ∧ 𝑘 ∈ (0..^(♯‘𝑆))) → ((𝑆 ++ 𝑇)‘𝑘) = (𝑆‘𝑘)) | |
28 | 27 | 3expa 1116 | . . . 4 ⊢ (((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) ∧ 𝑘 ∈ (0..^(♯‘𝑆))) → ((𝑆 ++ 𝑇)‘𝑘) = (𝑆‘𝑘)) |
29 | 26, 28 | eqtrd 2794 | . . 3 ⊢ (((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) ∧ 𝑘 ∈ (0..^(♯‘𝑆))) → (((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆)))‘𝑘) = (𝑆‘𝑘)) |
30 | 22, 24, 29 | eqfnfvd 6802 | . 2 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) ↾ (0..^(♯‘𝑆))) = 𝑆) |
31 | 14, 30 | eqtrd 2794 | 1 ⊢ ((𝑆 ∈ Word 𝐵 ∧ 𝑇 ∈ Word 𝐵) → ((𝑆 ++ 𝑇) prefix (♯‘𝑆)) = 𝑆) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ∧ wa 399 = wceq 1539 ∈ wcel 2112 ⊆ wss 3861 ↾ cres 5531 Fn wfn 6336 ‘cfv 6341 (class class class)co 7157 0cc0 10589 + caddc 10592 ℕ0cn0 11948 ℤ≥cuz 12296 ...cfz 12953 ..^cfzo 13096 ♯chash 13754 Word cword 13927 ++ cconcat 13983 prefix cpfx 14093 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1798 ax-4 1812 ax-5 1912 ax-6 1971 ax-7 2016 ax-8 2114 ax-9 2122 ax-10 2143 ax-11 2159 ax-12 2176 ax-ext 2730 ax-rep 5161 ax-sep 5174 ax-nul 5181 ax-pow 5239 ax-pr 5303 ax-un 7466 ax-cnex 10645 ax-resscn 10646 ax-1cn 10647 ax-icn 10648 ax-addcl 10649 ax-addrcl 10650 ax-mulcl 10651 ax-mulrcl 10652 ax-mulcom 10653 ax-addass 10654 ax-mulass 10655 ax-distr 10656 ax-i2m1 10657 ax-1ne0 10658 ax-1rid 10659 ax-rnegex 10660 ax-rrecex 10661 ax-cnre 10662 ax-pre-lttri 10663 ax-pre-lttrn 10664 ax-pre-ltadd 10665 ax-pre-mulgt0 10666 |
This theorem depends on definitions: df-bi 210 df-an 400 df-or 845 df-3or 1086 df-3an 1087 df-tru 1542 df-fal 1552 df-ex 1783 df-nf 1787 df-sb 2071 df-mo 2558 df-eu 2589 df-clab 2737 df-cleq 2751 df-clel 2831 df-nfc 2902 df-ne 2953 df-nel 3057 df-ral 3076 df-rex 3077 df-reu 3078 df-rab 3080 df-v 3412 df-sbc 3700 df-csb 3809 df-dif 3864 df-un 3866 df-in 3868 df-ss 3878 df-pss 3880 df-nul 4229 df-if 4425 df-pw 4500 df-sn 4527 df-pr 4529 df-tp 4531 df-op 4533 df-uni 4803 df-int 4843 df-iun 4889 df-br 5038 df-opab 5100 df-mpt 5118 df-tr 5144 df-id 5435 df-eprel 5440 df-po 5448 df-so 5449 df-fr 5488 df-we 5490 df-xp 5535 df-rel 5536 df-cnv 5537 df-co 5538 df-dm 5539 df-rn 5540 df-res 5541 df-ima 5542 df-pred 6132 df-ord 6178 df-on 6179 df-lim 6180 df-suc 6181 df-iota 6300 df-fun 6343 df-fn 6344 df-f 6345 df-f1 6346 df-fo 6347 df-f1o 6348 df-fv 6349 df-riota 7115 df-ov 7160 df-oprab 7161 df-mpo 7162 df-om 7587 df-1st 7700 df-2nd 7701 df-wrecs 7964 df-recs 8025 df-rdg 8063 df-1o 8119 df-er 8306 df-en 8542 df-dom 8543 df-sdom 8544 df-fin 8545 df-card 9415 df-pnf 10729 df-mnf 10730 df-xr 10731 df-ltxr 10732 df-le 10733 df-sub 10924 df-neg 10925 df-nn 11689 df-n0 11949 df-z 12035 df-uz 12297 df-fz 12954 df-fzo 13097 df-hash 13755 df-word 13928 df-concat 13984 df-substr 14064 df-pfx 14094 |
This theorem is referenced by: ccatopth 14139 reuccatpfxs1 14170 wwlksnextbi 27794 wwlksnextsurj 27800 clwwlkfo 27949 ccatcan2d 39766 |
Copyright terms: Public domain | W3C validator |