Metamath Proof Explorer


Theorem pfxccat1

Description: Recover the left half of a concatenated word. (Contributed by Mario Carneiro, 27-Sep-2015) (Revised by AV, 6-May-2020)

Ref Expression
Assertion pfxccat1 S Word B T Word B S ++ T prefix S = S

Proof

Step Hyp Ref Expression
1 ccatcl S Word B T Word B S ++ T Word B
2 lencl S Word B S 0
3 lencl T Word B T 0
4 2 3 anim12i S Word B T Word B S 0 T 0
5 nn0fz0 S 0 S 0 S
6 2 5 sylib S Word B S 0 S
7 6 adantr S Word B T Word B S 0 S
8 elfz0add S 0 T 0 S 0 S S 0 S + T
9 4 7 8 sylc S Word B T Word B S 0 S + T
10 ccatlen S Word B T Word B S ++ T = S + T
11 10 oveq2d S Word B T Word B 0 S ++ T = 0 S + T
12 9 11 eleqtrrd S Word B T Word B S 0 S ++ T
13 pfxres S ++ T Word B S 0 S ++ T S ++ T prefix S = S ++ T 0 ..^ S
14 1 12 13 syl2anc S Word B T Word B S ++ T prefix S = S ++ T 0 ..^ S
15 ccatvalfn S Word B T Word B S ++ T Fn 0 ..^ S + T
16 2 nn0zd S Word B S
17 16 uzidd S Word B S S
18 uzaddcl S S T 0 S + T S
19 17 3 18 syl2an S Word B T Word B S + T S
20 fzoss2 S + T S 0 ..^ S 0 ..^ S + T
21 19 20 syl S Word B T Word B 0 ..^ S 0 ..^ S + T
22 15 21 fnssresd S Word B T Word B S ++ T 0 ..^ S Fn 0 ..^ S
23 wrdfn S Word B S Fn 0 ..^ S
24 23 adantr S Word B T Word B S Fn 0 ..^ S
25 fvres k 0 ..^ S S ++ T 0 ..^ S k = S ++ T k
26 25 adantl S Word B T Word B k 0 ..^ S S ++ T 0 ..^ S k = S ++ T k
27 ccatval1 S Word B T Word B k 0 ..^ S S ++ T k = S k
28 27 3expa S Word B T Word B k 0 ..^ S S ++ T k = S k
29 26 28 eqtrd S Word B T Word B k 0 ..^ S S ++ T 0 ..^ S k = S k
30 22 24 29 eqfnfvd S Word B T Word B S ++ T 0 ..^ S = S
31 14 30 eqtrd S Word B T Word B S ++ T prefix S = S