Metamath Proof Explorer


Theorem efgsfo

Description: For any word, there is a sequence of extensions starting at a reduced word and ending at the target word, such that each word in the chain is an extension of the previous (inserting an element and its inverse at adjacent indices somewhere in the sequence). (Contributed by Mario Carneiro, 27-Sep-2015)

Ref Expression
Hypotheses efgval.w W=IWordI×2𝑜
efgval.r ˙=~FGI
efgval2.m M=yI,z2𝑜y1𝑜z
efgval2.t T=vWn0v,wI×2𝑜vsplicenn⟨“wMw”⟩
efgred.d D=WxWranTx
efgred.s S=mtWordW|t0Dk1..^ttkranTtk1mm1
Assertion efgsfo S:domSontoW

Proof

Step Hyp Ref Expression
1 efgval.w W=IWordI×2𝑜
2 efgval.r ˙=~FGI
3 efgval2.m M=yI,z2𝑜y1𝑜z
4 efgval2.t T=vWn0v,wI×2𝑜vsplicenn⟨“wMw”⟩
5 efgred.d D=WxWranTx
6 efgred.s S=mtWordW|t0Dk1..^ttkranTtk1mm1
7 1 2 3 4 5 6 efgsf S:tWordW|t0Dk1..^ttkranTtk1W
8 7 fdmi domS=tWordW|t0Dk1..^ttkranTtk1
9 8 feq2i S:domSWS:tWordW|t0Dk1..^ttkranTtk1W
10 7 9 mpbir S:domSW
11 frn S:domSWranSW
12 10 11 ax-mp ranSW
13 fviss IWordI×2𝑜WordI×2𝑜
14 1 13 eqsstri WWordI×2𝑜
15 14 sseli cWcWordI×2𝑜
16 lencl cWordI×2𝑜c0
17 15 16 syl cWc0
18 peano2nn0 c0c+10
19 14 sseli aWaWordI×2𝑜
20 lencl aWordI×2𝑜a0
21 19 20 syl aWa0
22 nn0nlt0 a0¬a<0
23 breq2 b=0a<ba<0
24 23 notbid b=0¬a<b¬a<0
25 22 24 imbitrrid b=0a0¬a<b
26 21 25 syl5 b=0aW¬a<b
27 26 ralrimiv b=0aW¬a<b
28 rabeq0 aW|a<b=aW¬a<b
29 27 28 sylibr b=0aW|a<b=
30 29 sseq1d b=0aW|a<branSranS
31 breq2 b=da<ba<d
32 31 rabbidv b=daW|a<b=aW|a<d
33 32 sseq1d b=daW|a<branSaW|a<dranS
34 breq2 b=d+1a<ba<d+1
35 34 rabbidv b=d+1aW|a<b=aW|a<d+1
36 35 sseq1d b=d+1aW|a<branSaW|a<d+1ranS
37 breq2 b=c+1a<ba<c+1
38 37 rabbidv b=c+1aW|a<b=aW|a<c+1
39 38 sseq1d b=c+1aW|a<branSaW|a<c+1ranS
40 0ss ranS
41 simpr d0aW|a<dranSaW|a<dranS
42 fveqeq2 a=ca=dc=d
43 42 cbvrabv aW|a=d=cW|c=d
44 eliun cxWranTxxWcranTx
45 fveq2 x=bTx=Tb
46 45 rneqd x=branTx=ranTb
47 46 eleq2d x=bcranTxcranTb
48 47 cbvrexvw xWcranTxbWcranTb
49 44 48 bitri cxWranTxbWcranTb
50 simpl1r d0aW|a<dranScWc=dbWcranTbaW|a<dranS
51 fveq2 a=ba=b
52 51 breq1d a=ba<db<d
53 simprl d0aW|a<dranScWc=dbWcranTbbW
54 14 53 sselid d0aW|a<dranScWc=dbWcranTbbWordI×2𝑜
55 lencl bWordI×2𝑜b0
56 54 55 syl d0aW|a<dranScWc=dbWcranTbb0
57 56 nn0red d0aW|a<dranScWc=dbWcranTbb
58 2rp 2+
59 ltaddrp b2+b<b+2
60 57 58 59 sylancl d0aW|a<dranScWc=dbWcranTbb<b+2
61 1 2 3 4 efgtlen bWcranTbc=b+2
62 61 adantl d0aW|a<dranScWc=dbWcranTbc=b+2
63 simpl3 d0aW|a<dranScWc=dbWcranTbc=d
64 62 63 eqtr3d d0aW|a<dranScWc=dbWcranTbb+2=d
65 60 64 breqtrd d0aW|a<dranScWc=dbWcranTbb<d
66 52 53 65 elrabd d0aW|a<dranScWc=dbWcranTbbaW|a<d
67 50 66 sseldd d0aW|a<dranScWc=dbWcranTbbranS
68 ffn S:domSWSFndomS
69 10 68 ax-mp SFndomS
70 fvelrnb SFndomSbranSodomSSo=b
71 69 70 ax-mp branSodomSSo=b
72 67 71 sylib d0aW|a<dranScWc=dbWcranTbodomSSo=b
73 simprrl d0aW|a<dranScWc=dbWcranTbodomSSo=bodomS
74 1 2 3 4 5 6 efgsdm odomSoWordWo0Di1..^ooiranToi1
75 74 simp1bi odomSoWordW
76 eldifi oWordWoWordW
77 73 75 76 3syl d0aW|a<dranScWc=dbWcranTbodomSSo=boWordW
78 simpl2 d0aW|a<dranScWc=dbWcranTbodomSSo=bcW
79 simprlr d0aW|a<dranScWc=dbWcranTbodomSSo=bcranTb
80 simprrr d0aW|a<dranScWc=dbWcranTbodomSSo=bSo=b
81 80 fveq2d d0aW|a<dranScWc=dbWcranTbodomSSo=bTSo=Tb
82 81 rneqd d0aW|a<dranScWc=dbWcranTbodomSSo=branTSo=ranTb
83 79 82 eleqtrrd d0aW|a<dranScWc=dbWcranTbodomSSo=bcranTSo
84 1 2 3 4 5 6 efgsp1 odomScranTSoo++⟨“c”⟩domS
85 73 83 84 syl2anc d0aW|a<dranScWc=dbWcranTbodomSSo=bo++⟨“c”⟩domS
86 1 2 3 4 5 6 efgsval2 oWordWcWo++⟨“c”⟩domSSo++⟨“c”⟩=c
87 77 78 85 86 syl3anc d0aW|a<dranScWc=dbWcranTbodomSSo=bSo++⟨“c”⟩=c
88 fnfvelrn SFndomSo++⟨“c”⟩domSSo++⟨“c”⟩ranS
89 69 85 88 sylancr d0aW|a<dranScWc=dbWcranTbodomSSo=bSo++⟨“c”⟩ranS
90 87 89 eqeltrrd d0aW|a<dranScWc=dbWcranTbodomSSo=bcranS
91 90 anassrs d0aW|a<dranScWc=dbWcranTbodomSSo=bcranS
92 72 91 rexlimddv d0aW|a<dranScWc=dbWcranTbcranS
93 92 rexlimdvaa d0aW|a<dranScWc=dbWcranTbcranS
94 49 93 biimtrid d0aW|a<dranScWc=dcxWranTxcranS
95 eldif cWxWranTxcW¬cxWranTx
96 5 eleq2i cDcWxWranTx
97 1 2 3 4 5 6 efgs1 cD⟨“c”⟩domS
98 96 97 sylbir cWxWranTx⟨“c”⟩domS
99 95 98 sylbir cW¬cxWranTx⟨“c”⟩domS
100 1 2 3 4 5 6 efgsval ⟨“c”⟩domSS⟨“c”⟩=⟨“c”⟩⟨“c”⟩1
101 99 100 syl cW¬cxWranTxS⟨“c”⟩=⟨“c”⟩⟨“c”⟩1
102 s1len ⟨“c”⟩=1
103 102 oveq1i ⟨“c”⟩1=11
104 1m1e0 11=0
105 103 104 eqtri ⟨“c”⟩1=0
106 105 fveq2i ⟨“c”⟩⟨“c”⟩1=⟨“c”⟩0
107 106 a1i cW¬cxWranTx⟨“c”⟩⟨“c”⟩1=⟨“c”⟩0
108 s1fv cW⟨“c”⟩0=c
109 108 adantr cW¬cxWranTx⟨“c”⟩0=c
110 101 107 109 3eqtrd cW¬cxWranTxS⟨“c”⟩=c
111 fnfvelrn SFndomS⟨“c”⟩domSS⟨“c”⟩ranS
112 69 99 111 sylancr cW¬cxWranTxS⟨“c”⟩ranS
113 110 112 eqeltrrd cW¬cxWranTxcranS
114 113 ex cW¬cxWranTxcranS
115 114 3ad2ant2 d0aW|a<dranScWc=d¬cxWranTxcranS
116 94 115 pm2.61d d0aW|a<dranScWc=dcranS
117 116 rabssdv d0aW|a<dranScW|c=dranS
118 43 117 eqsstrid d0aW|a<dranSaW|a=dranS
119 41 118 unssd d0aW|a<dranSaW|a<daW|a=dranS
120 119 ex d0aW|a<dranSaW|a<daW|a=dranS
121 id d0d0
122 nn0leltp1 a0d0ada<d+1
123 21 121 122 syl2anr d0aWada<d+1
124 21 nn0red aWa
125 nn0re d0d
126 leloe adada<da=d
127 124 125 126 syl2anr d0aWada<da=d
128 123 127 bitr3d d0aWa<d+1a<da=d
129 128 rabbidva d0aW|a<d+1=aW|a<da=d
130 unrab aW|a<daW|a=d=aW|a<da=d
131 129 130 eqtr4di d0aW|a<d+1=aW|a<daW|a=d
132 131 sseq1d d0aW|a<d+1ranSaW|a<daW|a=dranS
133 120 132 sylibrd d0aW|a<dranSaW|a<d+1ranS
134 30 33 36 39 40 133 nn0ind c+10aW|a<c+1ranS
135 17 18 134 3syl cWaW|a<c+1ranS
136 fveq2 a=ca=c
137 136 breq1d a=ca<c+1c<c+1
138 id cWcW
139 17 nn0red cWc
140 139 ltp1d cWc<c+1
141 137 138 140 elrabd cWcaW|a<c+1
142 135 141 sseldd cWcranS
143 142 ssriv WranS
144 12 143 eqssi ranS=W
145 dffo2 S:domSontoWS:domSWranS=W
146 10 144 145 mpbir2an S:domSontoW