Metamath Proof Explorer


Theorem pfxccatin12

Description: The subword of a concatenation of two words within both of the concatenated words. (Contributed by Alexander van der Vekens, 5-Apr-2018) (Revised by AV, 9-May-2020)

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

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L = A
2 1 pfxccatin12lem2c A Word V B Word V M 0 L N L L + B A ++ B Word V M 0 N N 0 A ++ B
3 swrdvalfn A ++ B Word V M 0 N N 0 A ++ B A ++ B substr M N Fn 0 ..^ N M
4 2 3 syl A Word V B Word V M 0 L N L L + B A ++ B substr M N Fn 0 ..^ N M
5 swrdcl A Word V A substr M L Word V
6 pfxcl B Word V B prefix N L Word V
7 ccatvalfn A substr M L Word V B prefix N L Word V A substr M L ++ B prefix N L Fn 0 ..^ A substr M L + B prefix N L
8 5 6 7 syl2an A Word V B Word V A substr M L ++ B prefix N L Fn 0 ..^ A substr M L + B prefix N L
9 8 adantr A Word V B Word V M 0 L N L L + B A substr M L ++ B prefix N L Fn 0 ..^ A substr M L + B prefix N L
10 simpll A Word V B Word V M 0 L N L L + B A Word V
11 simprl A Word V B Word V M 0 L N L L + B M 0 L
12 lencl A Word V A 0
13 nn0fz0 A 0 A 0 A
14 12 13 sylib A Word V A 0 A
15 1 14 eqeltrid A Word V L 0 A
16 15 ad2antrr A Word V B Word V M 0 L N L L + B L 0 A
17 swrdlen A Word V M 0 L L 0 A A substr M L = L M
18 10 11 16 17 syl3anc A Word V B Word V M 0 L N L L + B A substr M L = L M
19 lencl B Word V B 0
20 19 nn0zd B Word V B
21 elfzmlbp B N L L + B N L 0 B
22 20 21 sylan B Word V N L L + B N L 0 B
23 pfxlen B Word V N L 0 B B prefix N L = N L
24 22 23 syldan B Word V N L L + B B prefix N L = N L
25 24 ad2ant2l A Word V B Word V M 0 L N L L + B B prefix N L = N L
26 18 25 oveq12d A Word V B Word V M 0 L N L L + B A substr M L + B prefix N L = L M + N - L
27 elfz2nn0 M 0 L M 0 L 0 M L
28 nn0cn L 0 L
29 28 ad2antll N M 0 L 0 L
30 nn0cn M 0 M
31 30 ad2antrl N M 0 L 0 M
32 zcn N N
33 32 adantr N M 0 L 0 N
34 29 31 33 3jca N M 0 L 0 L M N
35 34 ex N M 0 L 0 L M N
36 elfzelz N L L + B N
37 35 36 syl11 M 0 L 0 N L L + B L M N
38 37 3adant3 M 0 L 0 M L N L L + B L M N
39 27 38 sylbi M 0 L N L L + B L M N
40 39 imp M 0 L N L L + B L M N
41 npncan3 L M N L M + N - L = N M
42 40 41 syl M 0 L N L L + B L M + N - L = N M
43 42 adantl A Word V B Word V M 0 L N L L + B L M + N - L = N M
44 26 43 eqtr2d A Word V B Word V M 0 L N L L + B N M = A substr M L + B prefix N L
45 44 oveq2d A Word V B Word V M 0 L N L L + B 0 ..^ N M = 0 ..^ A substr M L + B prefix N L
46 45 fneq2d A Word V B Word V M 0 L N L L + B A substr M L ++ B prefix N L Fn 0 ..^ N M A substr M L ++ B prefix N L Fn 0 ..^ A substr M L + B prefix N L
47 9 46 mpbird A Word V B Word V M 0 L N L L + B A substr M L ++ B prefix N L Fn 0 ..^ N M
48 simprl k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A Word V B Word V M 0 L N L L + B
49 simpr A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ N M
50 49 anim2i k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ L M k 0 ..^ N M
51 50 ancomd k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ N M k 0 ..^ L M
52 1 pfxccatin12lem3 A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ L M A ++ B substr M N k = A substr M L k
53 48 51 52 sylc k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A ++ B substr M N k = A substr M L k
54 5 6 anim12i A Word V B Word V A substr M L Word V B prefix N L Word V
55 54 adantr A Word V B Word V M 0 L N L L + B A substr M L Word V B prefix N L Word V
56 55 ad2antrl k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L Word V B prefix N L Word V
57 simpl k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ L M
58 18 oveq2d A Word V B Word V M 0 L N L L + B 0 ..^ A substr M L = 0 ..^ L M
59 58 ad2antrl k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M 0 ..^ A substr M L = 0 ..^ L M
60 57 59 eleqtrrd k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ A substr M L
61 df-3an A substr M L Word V B prefix N L Word V k 0 ..^ A substr M L A substr M L Word V B prefix N L Word V k 0 ..^ A substr M L
62 56 60 61 sylanbrc k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L Word V B prefix N L Word V k 0 ..^ A substr M L
63 ccatval1 A substr M L Word V B prefix N L Word V k 0 ..^ A substr M L A substr M L ++ B prefix N L k = A substr M L k
64 62 63 syl k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L ++ B prefix N L k = A substr M L k
65 53 64 eqtr4d k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A ++ B substr M N k = A substr M L ++ B prefix N L k
66 simprl ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A Word V B Word V M 0 L N L L + B
67 49 anim2i ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M ¬ k 0 ..^ L M k 0 ..^ N M
68 67 ancomd ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k 0 ..^ N M ¬ k 0 ..^ L M
69 1 pfxccatin12lem2 A Word V B Word V M 0 L N L L + B k 0 ..^ N M ¬ k 0 ..^ L M A ++ B substr M N k = B prefix N L k A substr M L
70 66 68 69 sylc ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A ++ B substr M N k = B prefix N L k A substr M L
71 55 ad2antrl ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L Word V B prefix N L Word V
72 elfzuz N L L + B N L
73 eluzelz N L N
74 id L 0 M 0 N L 0 M 0 N
75 74 3expia L 0 M 0 N L 0 M 0 N
76 75 ancoms M 0 L 0 N L 0 M 0 N
77 76 3adant3 M 0 L 0 M L N L 0 M 0 N
78 27 77 sylbi M 0 L N L 0 M 0 N
79 73 78 syl5com N L M 0 L L 0 M 0 N
80 72 79 syl N L L + B M 0 L L 0 M 0 N
81 80 impcom M 0 L N L L + B L 0 M 0 N
82 81 adantl A Word V B Word V M 0 L N L L + B L 0 M 0 N
83 82 ad2antrl ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M L 0 M 0 N
84 pfxccatin12lem4 L 0 M 0 N k 0 ..^ N M ¬ k 0 ..^ L M k L M ..^ L M + N - L
85 83 68 84 sylc ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k L M ..^ L M + N - L
86 18 26 oveq12d A Word V B Word V M 0 L N L L + B A substr M L ..^ A substr M L + B prefix N L = L M ..^ L M + N - L
87 86 ad2antrl ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L ..^ A substr M L + B prefix N L = L M ..^ L M + N - L
88 85 87 eleqtrrd ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M k A substr M L ..^ A substr M L + B prefix N L
89 df-3an A substr M L Word V B prefix N L Word V k A substr M L ..^ A substr M L + B prefix N L A substr M L Word V B prefix N L Word V k A substr M L ..^ A substr M L + B prefix N L
90 71 88 89 sylanbrc ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L Word V B prefix N L Word V k A substr M L ..^ A substr M L + B prefix N L
91 ccatval2 A substr M L Word V B prefix N L Word V k A substr M L ..^ A substr M L + B prefix N L A substr M L ++ B prefix N L k = B prefix N L k A substr M L
92 90 91 syl ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A substr M L ++ B prefix N L k = B prefix N L k A substr M L
93 70 92 eqtr4d ¬ k 0 ..^ L M A Word V B Word V M 0 L N L L + B k 0 ..^ N M A ++ B substr M N k = A substr M L ++ B prefix N L k
94 65 93 pm2.61ian A Word V B Word V M 0 L N L L + B k 0 ..^ N M A ++ B substr M N k = A substr M L ++ B prefix N L k
95 4 47 94 eqfnfvd A Word V B Word V M 0 L N L L + B A ++ B substr M N = A substr M L ++ B prefix N L
96 95 ex A Word V B Word V M 0 L N L L + B A ++ B substr M N = A substr M L ++ B prefix N L