Metamath Proof Explorer


Theorem pfxccatpfx1

Description: A prefix of a concatenation being a prefix of the first concatenated word. (Contributed by AV, 10-May-2020)

Ref Expression
Hypothesis swrdccatin2.l L = A
Assertion pfxccatpfx1 A Word V B Word V N 0 L A ++ B prefix N = A prefix N

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L = A
2 3simpa A Word V B Word V N 0 L A Word V B Word V
3 elfznn0 N 0 L N 0
4 0elfz N 0 0 0 N
5 3 4 syl N 0 L 0 0 N
6 1 oveq2i 0 L = 0 A
7 6 eleq2i N 0 L N 0 A
8 7 biimpi N 0 L N 0 A
9 5 8 jca N 0 L 0 0 N N 0 A
10 9 3ad2ant3 A Word V B Word V N 0 L 0 0 N N 0 A
11 swrdccatin1 A Word V B Word V 0 0 N N 0 A A ++ B substr 0 N = A substr 0 N
12 2 10 11 sylc A Word V B Word V N 0 L A ++ B substr 0 N = A substr 0 N
13 ccatcl A Word V B Word V A ++ B Word V
14 13 3adant3 A Word V B Word V N 0 L A ++ B Word V
15 3 3ad2ant3 A Word V B Word V N 0 L N 0
16 14 15 jca A Word V B Word V N 0 L A ++ B Word V N 0
17 pfxval A ++ B Word V N 0 A ++ B prefix N = A ++ B substr 0 N
18 16 17 syl A Word V B Word V N 0 L A ++ B prefix N = A ++ B substr 0 N
19 pfxval A Word V N 0 A prefix N = A substr 0 N
20 3 19 sylan2 A Word V N 0 L A prefix N = A substr 0 N
21 20 3adant2 A Word V B Word V N 0 L A prefix N = A substr 0 N
22 12 18 21 3eqtr4d A Word V B Word V N 0 L A ++ B prefix N = A prefix N