Metamath Proof Explorer


Theorem efgcpbllemb

Description: Lemma for efgrelex . Show that L is an equivalence relation containing all direct extensions of a word, so is closed under .~ . (Contributed by Mario Carneiro, 1-Oct-2015)

Ref Expression
Hypotheses efgval.w W = I Word I × 2 𝑜
efgval.r ˙ = ~ FG I
efgval2.m M = y I , z 2 𝑜 y 1 𝑜 z
efgval2.t T = v W n 0 v , w I × 2 𝑜 v splice n n ⟨“ w M w ”⟩
efgred.d D = W x W ran T x
efgred.s S = m t Word W | t 0 D k 1 ..^ t t k ran T t k 1 m m 1
efgcpbllem.1 L = i j | i j W A ++ i ++ B ˙ A ++ j ++ B
Assertion efgcpbllemb A W B W ˙ L

Proof

Step Hyp Ref Expression
1 efgval.w W = I Word I × 2 𝑜
2 efgval.r ˙ = ~ FG I
3 efgval2.m M = y I , z 2 𝑜 y 1 𝑜 z
4 efgval2.t T = v W n 0 v , w I × 2 𝑜 v splice n n ⟨“ w M w ”⟩
5 efgred.d D = W x W ran T x
6 efgred.s S = m t Word W | t 0 D k 1 ..^ t t k ran T t k 1 m m 1
7 efgcpbllem.1 L = i j | i j W A ++ i ++ B ˙ A ++ j ++ B
8 1 2 3 4 efgval2 ˙ = r | r Er W f W ran T f f r
9 7 relopabiv Rel L
10 9 a1i A W B W Rel L
11 1 2 3 4 5 6 7 efgcpbllema f L g f W g W A ++ f ++ B ˙ A ++ g ++ B
12 11 simp2bi f L g g W
13 12 adantl A W B W f L g g W
14 11 simp1bi f L g f W
15 14 adantl A W B W f L g f W
16 1 2 efger ˙ Er W
17 16 a1i A W B W f L g ˙ Er W
18 11 simp3bi f L g A ++ f ++ B ˙ A ++ g ++ B
19 18 adantl A W B W f L g A ++ f ++ B ˙ A ++ g ++ B
20 17 19 ersym A W B W f L g A ++ g ++ B ˙ A ++ f ++ B
21 1 2 3 4 5 6 7 efgcpbllema g L f g W f W A ++ g ++ B ˙ A ++ f ++ B
22 13 15 20 21 syl3anbrc A W B W f L g g L f
23 14 ad2antrl A W B W f L g g L h f W
24 1 2 3 4 5 6 7 efgcpbllema g L h g W h W A ++ g ++ B ˙ A ++ h ++ B
25 24 simp2bi g L h h W
26 25 ad2antll A W B W f L g g L h h W
27 16 a1i A W B W f L g g L h ˙ Er W
28 18 ad2antrl A W B W f L g g L h A ++ f ++ B ˙ A ++ g ++ B
29 24 simp3bi g L h A ++ g ++ B ˙ A ++ h ++ B
30 29 ad2antll A W B W f L g g L h A ++ g ++ B ˙ A ++ h ++ B
31 27 28 30 ertrd A W B W f L g g L h A ++ f ++ B ˙ A ++ h ++ B
32 1 2 3 4 5 6 7 efgcpbllema f L h f W h W A ++ f ++ B ˙ A ++ h ++ B
33 23 26 31 32 syl3anbrc A W B W f L g g L h f L h
34 16 a1i A W B W f W ˙ Er W
35 fviss I Word I × 2 𝑜 Word I × 2 𝑜
36 1 35 eqsstri W Word I × 2 𝑜
37 simpll A W B W f W A W
38 36 37 sselid A W B W f W A Word I × 2 𝑜
39 simpr A W B W f W f W
40 36 39 sselid A W B W f W f Word I × 2 𝑜
41 ccatcl A Word I × 2 𝑜 f Word I × 2 𝑜 A ++ f Word I × 2 𝑜
42 38 40 41 syl2anc A W B W f W A ++ f Word I × 2 𝑜
43 simplr A W B W f W B W
44 36 43 sselid A W B W f W B Word I × 2 𝑜
45 ccatcl A ++ f Word I × 2 𝑜 B Word I × 2 𝑜 A ++ f ++ B Word I × 2 𝑜
46 42 44 45 syl2anc A W B W f W A ++ f ++ B Word I × 2 𝑜
47 1 efgrcl A W I V W = Word I × 2 𝑜
48 47 simprd A W W = Word I × 2 𝑜
49 48 ad2antrr A W B W f W W = Word I × 2 𝑜
50 46 49 eleqtrrd A W B W f W A ++ f ++ B W
51 34 50 erref A W B W f W A ++ f ++ B ˙ A ++ f ++ B
52 51 ex A W B W f W A ++ f ++ B ˙ A ++ f ++ B
53 52 pm4.71d A W B W f W f W A ++ f ++ B ˙ A ++ f ++ B
54 1 2 3 4 5 6 7 efgcpbllema f L f f W f W A ++ f ++ B ˙ A ++ f ++ B
55 df-3an f W f W A ++ f ++ B ˙ A ++ f ++ B f W f W A ++ f ++ B ˙ A ++ f ++ B
56 anidm f W f W f W
57 56 anbi1i f W f W A ++ f ++ B ˙ A ++ f ++ B f W A ++ f ++ B ˙ A ++ f ++ B
58 54 55 57 3bitri f L f f W A ++ f ++ B ˙ A ++ f ++ B
59 53 58 bitr4di A W B W f W f L f
60 10 22 33 59 iserd A W B W L Er W
61 1 2 3 4 efgtf f W T f = a 0 f , b I × 2 𝑜 f splice a a ⟨“ b M b ”⟩ T f : 0 f × I × 2 𝑜 W
62 61 simprd f W T f : 0 f × I × 2 𝑜 W
63 62 adantl A W B W f W T f : 0 f × I × 2 𝑜 W
64 ffn T f : 0 f × I × 2 𝑜 W T f Fn 0 f × I × 2 𝑜
65 ovelrn T f Fn 0 f × I × 2 𝑜 a ran T f c 0 f u I × 2 𝑜 a = c T f u
66 63 64 65 3syl A W B W f W a ran T f c 0 f u I × 2 𝑜 a = c T f u
67 simplr A W B W f W c 0 f u I × 2 𝑜 f W
68 62 ad2antlr A W B W f W c 0 f u I × 2 𝑜 T f : 0 f × I × 2 𝑜 W
69 simprl A W B W f W c 0 f u I × 2 𝑜 c 0 f
70 simprr A W B W f W c 0 f u I × 2 𝑜 u I × 2 𝑜
71 68 69 70 fovrnd A W B W f W c 0 f u I × 2 𝑜 c T f u W
72 50 adantr A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B W
73 37 adantr A W B W f W c 0 f u I × 2 𝑜 A W
74 36 73 sselid A W B W f W c 0 f u I × 2 𝑜 A Word I × 2 𝑜
75 40 adantr A W B W f W c 0 f u I × 2 𝑜 f Word I × 2 𝑜
76 pfxcl f Word I × 2 𝑜 f prefix c Word I × 2 𝑜
77 75 76 syl A W B W f W c 0 f u I × 2 𝑜 f prefix c Word I × 2 𝑜
78 ccatcl A Word I × 2 𝑜 f prefix c Word I × 2 𝑜 A ++ f prefix c Word I × 2 𝑜
79 74 77 78 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c Word I × 2 𝑜
80 3 efgmf M : I × 2 𝑜 I × 2 𝑜
81 80 ffvelrni u I × 2 𝑜 M u I × 2 𝑜
82 81 ad2antll A W B W f W c 0 f u I × 2 𝑜 M u I × 2 𝑜
83 70 82 s2cld A W B W f W c 0 f u I × 2 𝑜 ⟨“ u M u ”⟩ Word I × 2 𝑜
84 ccatcl A ++ f prefix c Word I × 2 𝑜 ⟨“ u M u ”⟩ Word I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜
85 79 83 84 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜
86 swrdcl f Word I × 2 𝑜 f substr c f Word I × 2 𝑜
87 75 86 syl A W B W f W c 0 f u I × 2 𝑜 f substr c f Word I × 2 𝑜
88 44 adantr A W B W f W c 0 f u I × 2 𝑜 B Word I × 2 𝑜
89 ccatass A ++ f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜 f substr c f Word I × 2 𝑜 B Word I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B
90 85 87 88 89 syl3anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B
91 ccatcl f prefix c Word I × 2 𝑜 ⟨“ u M u ”⟩ Word I × 2 𝑜 f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜
92 77 83 91 syl2anc A W B W f W c 0 f u I × 2 𝑜 f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜
93 ccatass A Word I × 2 𝑜 f prefix c ++ ⟨“ u M u ”⟩ Word I × 2 𝑜 f substr c f Word I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
94 74 92 87 93 syl3anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
95 ccatass A Word I × 2 𝑜 f prefix c Word I × 2 𝑜 ⟨“ u M u ”⟩ Word I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ = A ++ f prefix c ++ ⟨“ u M u ”⟩
96 74 77 83 95 syl3anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ = A ++ f prefix c ++ ⟨“ u M u ”⟩
97 96 oveq1d A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
98 1 2 3 4 efgtval f W c 0 f u I × 2 𝑜 c T f u = f splice c c ⟨“ u M u ”⟩
99 67 69 70 98 syl3anc A W B W f W c 0 f u I × 2 𝑜 c T f u = f splice c c ⟨“ u M u ”⟩
100 splval f W c 0 f c 0 f ⟨“ u M u ”⟩ Word I × 2 𝑜 f splice c c ⟨“ u M u ”⟩ = f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
101 67 69 69 83 100 syl13anc A W B W f W c 0 f u I × 2 𝑜 f splice c c ⟨“ u M u ”⟩ = f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
102 99 101 eqtrd A W B W f W c 0 f u I × 2 𝑜 c T f u = f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
103 102 oveq2d A W B W f W c 0 f u I × 2 𝑜 A ++ c T f u = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
104 94 97 103 3eqtr4rd A W B W f W c 0 f u I × 2 𝑜 A ++ c T f u = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f
105 104 oveq1d A W B W f W c 0 f u I × 2 𝑜 A ++ c T f u ++ B = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B
106 lencl A Word I × 2 𝑜 A 0
107 74 106 syl A W B W f W c 0 f u I × 2 𝑜 A 0
108 nn0uz 0 = 0
109 107 108 eleqtrdi A W B W f W c 0 f u I × 2 𝑜 A 0
110 elfznn0 c 0 f c 0
111 110 ad2antrl A W B W f W c 0 f u I × 2 𝑜 c 0
112 uzaddcl A 0 c 0 A + c 0
113 109 111 112 syl2anc A W B W f W c 0 f u I × 2 𝑜 A + c 0
114 42 adantr A W B W f W c 0 f u I × 2 𝑜 A ++ f Word I × 2 𝑜
115 ccatlen A ++ f Word I × 2 𝑜 B Word I × 2 𝑜 A ++ f ++ B = A ++ f + B
116 114 88 115 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B = A ++ f + B
117 ccatlen A Word I × 2 𝑜 f Word I × 2 𝑜 A ++ f = A + f
118 74 75 117 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f = A + f
119 elfzuz3 c 0 f f c
120 119 ad2antrl A W B W f W c 0 f u I × 2 𝑜 f c
121 107 nn0zd A W B W f W c 0 f u I × 2 𝑜 A
122 eluzadd f c A f + A c + A
123 120 121 122 syl2anc A W B W f W c 0 f u I × 2 𝑜 f + A c + A
124 lencl f Word I × 2 𝑜 f 0
125 75 124 syl A W B W f W c 0 f u I × 2 𝑜 f 0
126 125 nn0cnd A W B W f W c 0 f u I × 2 𝑜 f
127 107 nn0cnd A W B W f W c 0 f u I × 2 𝑜 A
128 126 127 addcomd A W B W f W c 0 f u I × 2 𝑜 f + A = A + f
129 111 nn0cnd A W B W f W c 0 f u I × 2 𝑜 c
130 129 127 addcomd A W B W f W c 0 f u I × 2 𝑜 c + A = A + c
131 130 fveq2d A W B W f W c 0 f u I × 2 𝑜 c + A = A + c
132 123 128 131 3eltr3d A W B W f W c 0 f u I × 2 𝑜 A + f A + c
133 118 132 eqeltrd A W B W f W c 0 f u I × 2 𝑜 A ++ f A + c
134 lencl B Word I × 2 𝑜 B 0
135 88 134 syl A W B W f W c 0 f u I × 2 𝑜 B 0
136 uzaddcl A ++ f A + c B 0 A ++ f + B A + c
137 133 135 136 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f + B A + c
138 116 137 eqeltrd A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B A + c
139 elfzuzb A + c 0 A ++ f ++ B A + c 0 A ++ f ++ B A + c
140 113 138 139 sylanbrc A W B W f W c 0 f u I × 2 𝑜 A + c 0 A ++ f ++ B
141 1 2 3 4 efgtval A ++ f ++ B W A + c 0 A ++ f ++ B u I × 2 𝑜 A + c T A ++ f ++ B u = A ++ f ++ B splice A + c A + c ⟨“ u M u ”⟩
142 72 140 70 141 syl3anc A W B W f W c 0 f u I × 2 𝑜 A + c T A ++ f ++ B u = A ++ f ++ B splice A + c A + c ⟨“ u M u ”⟩
143 wrd0 Word I × 2 𝑜
144 143 a1i A W B W f W c 0 f u I × 2 𝑜 Word I × 2 𝑜
145 ccatcl f substr c f Word I × 2 𝑜 B Word I × 2 𝑜 f substr c f ++ B Word I × 2 𝑜
146 87 88 145 syl2anc A W B W f W c 0 f u I × 2 𝑜 f substr c f ++ B Word I × 2 𝑜
147 ccatrid A ++ f prefix c Word I × 2 𝑜 A ++ f prefix c ++ = A ++ f prefix c
148 79 147 syl A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ = A ++ f prefix c
149 148 oveq1d A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ ++ f substr c f ++ B = A ++ f prefix c ++ f substr c f ++ B
150 ccatass A ++ f prefix c Word I × 2 𝑜 f substr c f Word I × 2 𝑜 B Word I × 2 𝑜 A ++ f prefix c ++ f substr c f ++ B = A ++ f prefix c ++ f substr c f ++ B
151 79 87 88 150 syl3anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ f substr c f ++ B = A ++ f prefix c ++ f substr c f ++ B
152 ccatass A Word I × 2 𝑜 f prefix c Word I × 2 𝑜 f substr c f Word I × 2 𝑜 A ++ f prefix c ++ f substr c f = A ++ f prefix c ++ f substr c f
153 74 77 87 152 syl3anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ f substr c f = A ++ f prefix c ++ f substr c f
154 125 108 eleqtrdi A W B W f W c 0 f u I × 2 𝑜 f 0
155 eluzfz2 f 0 f 0 f
156 154 155 syl A W B W f W c 0 f u I × 2 𝑜 f 0 f
157 ccatpfx f Word I × 2 𝑜 c 0 f f 0 f f prefix c ++ f substr c f = f prefix f
158 75 69 156 157 syl3anc A W B W f W c 0 f u I × 2 𝑜 f prefix c ++ f substr c f = f prefix f
159 pfxid f Word I × 2 𝑜 f prefix f = f
160 75 159 syl A W B W f W c 0 f u I × 2 𝑜 f prefix f = f
161 158 160 eqtrd A W B W f W c 0 f u I × 2 𝑜 f prefix c ++ f substr c f = f
162 161 oveq2d A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ f substr c f = A ++ f
163 153 162 eqtrd A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ f substr c f = A ++ f
164 163 oveq1d A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c ++ f substr c f ++ B = A ++ f ++ B
165 149 151 164 3eqtr2rd A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B = A ++ f prefix c ++ ++ f substr c f ++ B
166 ccatlen A Word I × 2 𝑜 f prefix c Word I × 2 𝑜 A ++ f prefix c = A + f prefix c
167 74 77 166 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f prefix c = A + f prefix c
168 pfxlen f Word I × 2 𝑜 c 0 f f prefix c = c
169 75 69 168 syl2anc A W B W f W c 0 f u I × 2 𝑜 f prefix c = c
170 169 oveq2d A W B W f W c 0 f u I × 2 𝑜 A + f prefix c = A + c
171 167 170 eqtr2d A W B W f W c 0 f u I × 2 𝑜 A + c = A ++ f prefix c
172 hash0 = 0
173 172 oveq2i A + c + = A + c + 0
174 107 111 nn0addcld A W B W f W c 0 f u I × 2 𝑜 A + c 0
175 174 nn0cnd A W B W f W c 0 f u I × 2 𝑜 A + c
176 175 addid1d A W B W f W c 0 f u I × 2 𝑜 A + c + 0 = A + c
177 173 176 eqtr2id A W B W f W c 0 f u I × 2 𝑜 A + c = A + c +
178 79 144 146 83 165 171 177 splval2 A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B splice A + c A + c ⟨“ u M u ”⟩ = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B
179 142 178 eqtrd A W B W f W c 0 f u I × 2 𝑜 A + c T A ++ f ++ B u = A ++ f prefix c ++ ⟨“ u M u ”⟩ ++ f substr c f ++ B
180 90 105 179 3eqtr4d A W B W f W c 0 f u I × 2 𝑜 A ++ c T f u ++ B = A + c T A ++ f ++ B u
181 1 2 3 4 efgtf A ++ f ++ B W T A ++ f ++ B = a 0 A ++ f ++ B , b I × 2 𝑜 A ++ f ++ B splice a a ⟨“ b M b ”⟩ T A ++ f ++ B : 0 A ++ f ++ B × I × 2 𝑜 W
182 181 simprd A ++ f ++ B W T A ++ f ++ B : 0 A ++ f ++ B × I × 2 𝑜 W
183 ffn T A ++ f ++ B : 0 A ++ f ++ B × I × 2 𝑜 W T A ++ f ++ B Fn 0 A ++ f ++ B × I × 2 𝑜
184 72 182 183 3syl A W B W f W c 0 f u I × 2 𝑜 T A ++ f ++ B Fn 0 A ++ f ++ B × I × 2 𝑜
185 fnovrn T A ++ f ++ B Fn 0 A ++ f ++ B × I × 2 𝑜 A + c 0 A ++ f ++ B u I × 2 𝑜 A + c T A ++ f ++ B u ran T A ++ f ++ B
186 184 140 70 185 syl3anc A W B W f W c 0 f u I × 2 𝑜 A + c T A ++ f ++ B u ran T A ++ f ++ B
187 180 186 eqeltrd A W B W f W c 0 f u I × 2 𝑜 A ++ c T f u ++ B ran T A ++ f ++ B
188 1 2 3 4 efgi2 A ++ f ++ B W A ++ c T f u ++ B ran T A ++ f ++ B A ++ f ++ B ˙ A ++ c T f u ++ B
189 72 187 188 syl2anc A W B W f W c 0 f u I × 2 𝑜 A ++ f ++ B ˙ A ++ c T f u ++ B
190 1 2 3 4 5 6 7 efgcpbllema f L c T f u f W c T f u W A ++ f ++ B ˙ A ++ c T f u ++ B
191 67 71 189 190 syl3anbrc A W B W f W c 0 f u I × 2 𝑜 f L c T f u
192 vex a V
193 vex f V
194 192 193 elec a f L f L a
195 breq2 a = c T f u f L a f L c T f u
196 194 195 syl5bb a = c T f u a f L f L c T f u
197 191 196 syl5ibrcom A W B W f W c 0 f u I × 2 𝑜 a = c T f u a f L
198 197 rexlimdvva A W B W f W c 0 f u I × 2 𝑜 a = c T f u a f L
199 66 198 sylbid A W B W f W a ran T f a f L
200 199 ssrdv A W B W f W ran T f f L
201 200 ralrimiva A W B W f W ran T f f L
202 1 fvexi W V
203 erex L Er W W V L V
204 60 202 203 mpisyl A W B W L V
205 ereq1 r = L r Er W L Er W
206 eceq2 r = L f r = f L
207 206 sseq2d r = L ran T f f r ran T f f L
208 207 ralbidv r = L f W ran T f f r f W ran T f f L
209 205 208 anbi12d r = L r Er W f W ran T f f r L Er W f W ran T f f L
210 209 elabg L V L r | r Er W f W ran T f f r L Er W f W ran T f f L
211 204 210 syl A W B W L r | r Er W f W ran T f f r L Er W f W ran T f f L
212 60 201 211 mpbir2and A W B W L r | r Er W f W ran T f f r
213 intss1 L r | r Er W f W ran T f f r r | r Er W f W ran T f f r L
214 212 213 syl A W B W r | r Er W f W ran T f f r L
215 8 214 eqsstrid A W B W ˙ L