Metamath Proof Explorer


Theorem ccats1pfxeqbi

Description: A word is a prefix of a word with length greater by 1 than the first word iff the second word is the first word concatenated with the last symbol of the second word. (Contributed by AV, 24-Oct-2018) (Revised by AV, 10-May-2020)

Ref Expression
Assertion ccats1pfxeqbi WWordVUWordVU=W+1W=UprefixWU=W++⟨“lastSU”⟩

Proof

Step Hyp Ref Expression
1 ccats1pfxeq WWordVUWordVU=W+1W=UprefixWU=W++⟨“lastSU”⟩
2 simp1 WWordVUWordVU=W+1WWordV
3 lencl WWordVW0
4 nn0p1nn W0W+1
5 3 4 syl WWordVW+1
6 5 3ad2ant1 WWordVUWordVU=W+1W+1
7 3simpc WWordVUWordVU=W+1UWordVU=W+1
8 lswlgt0cl W+1UWordVU=W+1lastSUV
9 6 7 8 syl2anc WWordVUWordVU=W+1lastSUV
10 9 s1cld WWordVUWordVU=W+1⟨“lastSU”⟩WordV
11 eqidd WWordVUWordVU=W+1W=W
12 pfxccatid WWordV⟨“lastSU”⟩WordVW=WW++⟨“lastSU”⟩prefixW=W
13 12 eqcomd WWordV⟨“lastSU”⟩WordVW=WW=W++⟨“lastSU”⟩prefixW
14 2 10 11 13 syl3anc WWordVUWordVU=W+1W=W++⟨“lastSU”⟩prefixW
15 oveq1 U=W++⟨“lastSU”⟩UprefixW=W++⟨“lastSU”⟩prefixW
16 15 eqcomd U=W++⟨“lastSU”⟩W++⟨“lastSU”⟩prefixW=UprefixW
17 14 16 sylan9eq WWordVUWordVU=W+1U=W++⟨“lastSU”⟩W=UprefixW
18 17 ex WWordVUWordVU=W+1U=W++⟨“lastSU”⟩W=UprefixW
19 1 18 impbid WWordVUWordVU=W+1W=UprefixWU=W++⟨“lastSU”⟩