Metamath Proof Explorer


Theorem pfxccat3a

Description: A prefix of a concatenation is either a prefix of the first concatenated word or a concatenation of the first word with a prefix of the second word. (Contributed by Alexander van der Vekens, 31-Mar-2018) (Revised by AV, 10-May-2020)

Ref Expression
Hypotheses swrdccatin2.l L=A
pfxccatpfx2.m M=B
Assertion pfxccat3a AWordVBWordVN0L+MA++BprefixN=ifNLAprefixNA++BprefixNL

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L=A
2 pfxccatpfx2.m M=B
3 simprl NLAWordVBWordVN0L+MAWordVBWordV
4 elfznn0 N0L+MN0
5 4 adantl AWordVBWordVN0L+MN0
6 5 adantl NLAWordVBWordVN0L+MN0
7 lencl AWordVA0
8 1 7 eqeltrid AWordVL0
9 8 adantr AWordVBWordVL0
10 9 adantr AWordVBWordVN0L+ML0
11 10 adantl NLAWordVBWordVN0L+ML0
12 simpl NLAWordVBWordVN0L+MNL
13 elfz2nn0 N0LN0L0NL
14 6 11 12 13 syl3anbrc NLAWordVBWordVN0L+MN0L
15 df-3an AWordVBWordVN0LAWordVBWordVN0L
16 3 14 15 sylanbrc NLAWordVBWordVN0L+MAWordVBWordVN0L
17 1 pfxccatpfx1 AWordVBWordVN0LA++BprefixN=AprefixN
18 16 17 syl NLAWordVBWordVN0L+MA++BprefixN=AprefixN
19 iftrue NLifNLAprefixNA++BprefixNL=AprefixN
20 19 adantr NLAWordVBWordVN0L+MifNLAprefixNA++BprefixNL=AprefixN
21 18 20 eqtr4d NLAWordVBWordVN0L+MA++BprefixN=ifNLAprefixNA++BprefixNL
22 simprl ¬NLAWordVBWordVN0L+MAWordVBWordV
23 elfz2nn0 N0L+MN0L+M0NL+M
24 1 eleq1i L0A0
25 nn0ltp1le L0N0L<NL+1N
26 nn0re L0L
27 nn0re N0N
28 ltnle LNL<N¬NL
29 26 27 28 syl2an L0N0L<N¬NL
30 25 29 bitr3d L0N0L+1N¬NL
31 30 3ad2antr1 L0N0L+M0NL+ML+1N¬NL
32 simpr3 L0N0L+M0NL+MNL+M
33 32 anim1ci L0N0L+M0NL+ML+1NL+1NNL+M
34 nn0z N0N
35 34 3ad2ant1 N0L+M0NL+MN
36 35 adantl L0N0L+M0NL+MN
37 36 adantr L0N0L+M0NL+ML+1NN
38 peano2nn0 L0L+10
39 38 nn0zd L0L+1
40 39 adantr L0N0L+M0NL+ML+1
41 40 adantr L0N0L+M0NL+ML+1NL+1
42 nn0z L+M0L+M
43 42 3ad2ant2 N0L+M0NL+ML+M
44 43 adantl L0N0L+M0NL+ML+M
45 44 adantr L0N0L+M0NL+ML+1NL+M
46 elfz NL+1L+MNL+1L+ML+1NNL+M
47 37 41 45 46 syl3anc L0N0L+M0NL+ML+1NNL+1L+ML+1NNL+M
48 33 47 mpbird L0N0L+M0NL+ML+1NNL+1L+M
49 48 ex L0N0L+M0NL+ML+1NNL+1L+M
50 31 49 sylbird L0N0L+M0NL+M¬NLNL+1L+M
51 50 ex L0N0L+M0NL+M¬NLNL+1L+M
52 24 51 sylbir A0N0L+M0NL+M¬NLNL+1L+M
53 7 52 syl AWordVN0L+M0NL+M¬NLNL+1L+M
54 53 adantr AWordVBWordVN0L+M0NL+M¬NLNL+1L+M
55 23 54 biimtrid AWordVBWordVN0L+M¬NLNL+1L+M
56 55 imp AWordVBWordVN0L+M¬NLNL+1L+M
57 56 impcom ¬NLAWordVBWordVN0L+MNL+1L+M
58 df-3an AWordVBWordVNL+1L+MAWordVBWordVNL+1L+M
59 22 57 58 sylanbrc ¬NLAWordVBWordVN0L+MAWordVBWordVNL+1L+M
60 1 2 pfxccatpfx2 AWordVBWordVNL+1L+MA++BprefixN=A++BprefixNL
61 59 60 syl ¬NLAWordVBWordVN0L+MA++BprefixN=A++BprefixNL
62 iffalse ¬NLifNLAprefixNA++BprefixNL=A++BprefixNL
63 62 adantr ¬NLAWordVBWordVN0L+MifNLAprefixNA++BprefixNL=A++BprefixNL
64 61 63 eqtr4d ¬NLAWordVBWordVN0L+MA++BprefixN=ifNLAprefixNA++BprefixNL
65 21 64 pm2.61ian AWordVBWordVN0L+MA++BprefixN=ifNLAprefixNA++BprefixNL
66 65 ex AWordVBWordVN0L+MA++BprefixN=ifNLAprefixNA++BprefixNL