Metamath Proof Explorer


Theorem efgredlem

Description: The reduced word that forms the base of the sequence in efgsval is uniquely determined, given the ending representation. (Contributed by Mario Carneiro, 30-Sep-2015) (Proof shortened by AV, 3-Nov-2022)

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
efgredlem.1 φ a dom S b dom S S a < S A S a = S b a 0 = b 0
efgredlem.2 φ A dom S
efgredlem.3 φ B dom S
efgredlem.4 φ S A = S B
efgredlem.5 φ ¬ A 0 = B 0
Assertion efgredlem ¬ φ

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 efgredlem.1 φ a dom S b dom S S a < S A S a = S b a 0 = b 0
8 efgredlem.2 φ A dom S
9 efgredlem.3 φ B dom S
10 efgredlem.4 φ S A = S B
11 efgredlem.5 φ ¬ A 0 = B 0
12 fviss I Word I × 2 𝑜 Word I × 2 𝑜
13 1 12 eqsstri W Word I × 2 𝑜
14 1 2 3 4 5 6 efgsdm A dom S A Word W A 0 D i 1 ..^ A A i ran T A i 1
15 14 simp1bi A dom S A Word W
16 8 15 syl φ A Word W
17 16 eldifad φ A Word W
18 wrdf A Word W A : 0 ..^ A W
19 17 18 syl φ A : 0 ..^ A W
20 1 2 3 4 5 6 7 8 9 10 11 efgredlema φ A 1 B 1
21 20 simpld φ A 1
22 nnm1nn0 A 1 A - 1 - 1 0
23 21 22 syl φ A - 1 - 1 0
24 21 nnred φ A 1
25 24 lem1d φ A - 1 - 1 A 1
26 eldifsni A Word W A
27 8 15 26 3syl φ A
28 wrdfin A Word W A Fin
29 hashnncl A Fin A A
30 17 28 29 3syl φ A A
31 27 30 mpbird φ A
32 nnm1nn0 A A 1 0
33 fznn0 A 1 0 A - 1 - 1 0 A 1 A - 1 - 1 0 A - 1 - 1 A 1
34 31 32 33 3syl φ A - 1 - 1 0 A 1 A - 1 - 1 0 A - 1 - 1 A 1
35 23 25 34 mpbir2and φ A - 1 - 1 0 A 1
36 lencl A Word W A 0
37 17 36 syl φ A 0
38 37 nn0zd φ A
39 fzoval A 0 ..^ A = 0 A 1
40 38 39 syl φ 0 ..^ A = 0 A 1
41 35 40 eleqtrrd φ A - 1 - 1 0 ..^ A
42 19 41 ffvelrnd φ A A - 1 - 1 W
43 13 42 sselid φ A A - 1 - 1 Word I × 2 𝑜
44 lencl A A - 1 - 1 Word I × 2 𝑜 A A - 1 - 1 0
45 43 44 syl φ A A - 1 - 1 0
46 45 nn0red φ A A - 1 - 1
47 2rp 2 +
48 ltaddrp A A - 1 - 1 2 + A A - 1 - 1 < A A - 1 - 1 + 2
49 46 47 48 sylancl φ A A - 1 - 1 < A A - 1 - 1 + 2
50 37 nn0red φ A
51 50 lem1d φ A 1 A
52 fznn A A 1 1 A A 1 A 1 A
53 38 52 syl φ A 1 1 A A 1 A 1 A
54 21 51 53 mpbir2and φ A 1 1 A
55 1 2 3 4 5 6 efgsres A dom S A 1 1 A A 0 ..^ A 1 dom S
56 8 54 55 syl2anc φ A 0 ..^ A 1 dom S
57 1 2 3 4 5 6 efgsval A 0 ..^ A 1 dom S S A 0 ..^ A 1 = A 0 ..^ A 1 A 0 ..^ A 1 1
58 56 57 syl φ S A 0 ..^ A 1 = A 0 ..^ A 1 A 0 ..^ A 1 1
59 fz1ssfz0 1 A 0 A
60 59 54 sselid φ A 1 0 A
61 pfxres A Word W A 1 0 A A prefix A 1 = A 0 ..^ A 1
62 17 60 61 syl2anc φ A prefix A 1 = A 0 ..^ A 1
63 62 fveq2d φ A prefix A 1 = A 0 ..^ A 1
64 pfxlen A Word W A 1 0 A A prefix A 1 = A 1
65 17 60 64 syl2anc φ A prefix A 1 = A 1
66 63 65 eqtr3d φ A 0 ..^ A 1 = A 1
67 66 fvoveq1d φ A 0 ..^ A 1 A 0 ..^ A 1 1 = A 0 ..^ A 1 A - 1 - 1
68 fzo0end A 1 A - 1 - 1 0 ..^ A 1
69 fvres A - 1 - 1 0 ..^ A 1 A 0 ..^ A 1 A - 1 - 1 = A A - 1 - 1
70 21 68 69 3syl φ A 0 ..^ A 1 A - 1 - 1 = A A - 1 - 1
71 58 67 70 3eqtrd φ S A 0 ..^ A 1 = A A - 1 - 1
72 71 fveq2d φ S A 0 ..^ A 1 = A A - 1 - 1
73 1 2 3 4 5 6 efgsdmi A dom S A 1 S A ran T A A - 1 - 1
74 8 21 73 syl2anc φ S A ran T A A - 1 - 1
75 1 2 3 4 efgtlen A A - 1 - 1 W S A ran T A A - 1 - 1 S A = A A - 1 - 1 + 2
76 42 74 75 syl2anc φ S A = A A - 1 - 1 + 2
77 49 72 76 3brtr4d φ S A 0 ..^ A 1 < S A
78 1 2 3 4 efgtf A A - 1 - 1 W T A A - 1 - 1 = a 0 A A - 1 - 1 , b I × 2 𝑜 A A - 1 - 1 splice a a ⟨“ b M b ”⟩ T A A - 1 - 1 : 0 A A - 1 - 1 × I × 2 𝑜 W
79 42 78 syl φ T A A - 1 - 1 = a 0 A A - 1 - 1 , b I × 2 𝑜 A A - 1 - 1 splice a a ⟨“ b M b ”⟩ T A A - 1 - 1 : 0 A A - 1 - 1 × I × 2 𝑜 W
80 79 simprd φ T A A - 1 - 1 : 0 A A - 1 - 1 × I × 2 𝑜 W
81 ffn T A A - 1 - 1 : 0 A A - 1 - 1 × I × 2 𝑜 W T A A - 1 - 1 Fn 0 A A - 1 - 1 × I × 2 𝑜
82 ovelrn T A A - 1 - 1 Fn 0 A A - 1 - 1 × I × 2 𝑜 S A ran T A A - 1 - 1 i 0 A A - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r
83 80 81 82 3syl φ S A ran T A A - 1 - 1 i 0 A A - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r
84 74 83 mpbid φ i 0 A A - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r
85 20 simprd φ B 1
86 1 2 3 4 5 6 efgsdmi B dom S B 1 S B ran T B B - 1 - 1
87 9 85 86 syl2anc φ S B ran T B B - 1 - 1
88 1 2 3 4 5 6 efgsdm B dom S B Word W B 0 D i 1 ..^ B B i ran T B i 1
89 88 simp1bi B dom S B Word W
90 9 89 syl φ B Word W
91 90 eldifad φ B Word W
92 wrdf B Word W B : 0 ..^ B W
93 91 92 syl φ B : 0 ..^ B W
94 fzo0end B 1 B - 1 - 1 0 ..^ B 1
95 elfzofz B - 1 - 1 0 ..^ B 1 B - 1 - 1 0 B 1
96 85 94 95 3syl φ B - 1 - 1 0 B 1
97 lencl B Word W B 0
98 91 97 syl φ B 0
99 98 nn0zd φ B
100 fzoval B 0 ..^ B = 0 B 1
101 99 100 syl φ 0 ..^ B = 0 B 1
102 96 101 eleqtrrd φ B - 1 - 1 0 ..^ B
103 93 102 ffvelrnd φ B B - 1 - 1 W
104 1 2 3 4 efgtf B B - 1 - 1 W T B B - 1 - 1 = a 0 B B - 1 - 1 , b I × 2 𝑜 B B - 1 - 1 splice a a ⟨“ b M b ”⟩ T B B - 1 - 1 : 0 B B - 1 - 1 × I × 2 𝑜 W
105 103 104 syl φ T B B - 1 - 1 = a 0 B B - 1 - 1 , b I × 2 𝑜 B B - 1 - 1 splice a a ⟨“ b M b ”⟩ T B B - 1 - 1 : 0 B B - 1 - 1 × I × 2 𝑜 W
106 105 simprd φ T B B - 1 - 1 : 0 B B - 1 - 1 × I × 2 𝑜 W
107 ffn T B B - 1 - 1 : 0 B B - 1 - 1 × I × 2 𝑜 W T B B - 1 - 1 Fn 0 B B - 1 - 1 × I × 2 𝑜
108 ovelrn T B B - 1 - 1 Fn 0 B B - 1 - 1 × I × 2 𝑜 S B ran T B B - 1 - 1 j 0 B B - 1 - 1 s I × 2 𝑜 S B = j T B B - 1 - 1 s
109 106 107 108 3syl φ S B ran T B B - 1 - 1 j 0 B B - 1 - 1 s I × 2 𝑜 S B = j T B B - 1 - 1 s
110 87 109 mpbid φ j 0 B B - 1 - 1 s I × 2 𝑜 S B = j T B B - 1 - 1 s
111 reeanv i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r s I × 2 𝑜 S B = j T B B - 1 - 1 s i 0 A A - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r j 0 B B - 1 - 1 s I × 2 𝑜 S B = j T B B - 1 - 1 s
112 reeanv r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s r I × 2 𝑜 S A = i T A A - 1 - 1 r s I × 2 𝑜 S B = j T B B - 1 - 1 s
113 7 ad3antrrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 a dom S b dom S S a < S A S a = S b a 0 = b 0
114 8 ad3antrrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 A dom S
115 9 ad3antrrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 B dom S
116 10 ad3antrrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 S A = S B
117 11 ad3antrrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 ¬ A 0 = B 0
118 eqid A - 1 - 1 = A - 1 - 1
119 eqid B - 1 - 1 = B - 1 - 1
120 simpllr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 i 0 A A - 1 - 1 j 0 B B - 1 - 1
121 120 simpld φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 i 0 A A - 1 - 1
122 120 simprd φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 j 0 B B - 1 - 1
123 simplrl φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜
124 123 simpld φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 r I × 2 𝑜
125 123 simprd φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 s I × 2 𝑜
126 simplrr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s
127 126 simpld φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 S A = i T A A - 1 - 1 r
128 126 simprd φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 S B = j T B B - 1 - 1 s
129 simpr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1 ¬ A A - 1 - 1 = B B - 1 - 1
130 1 2 3 4 5 6 113 114 115 116 117 118 119 121 122 124 125 127 128 129 efgredlemb ¬ φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1
131 iman φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1 ¬ φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s ¬ A A - 1 - 1 = B B - 1 - 1
132 130 131 mpbir φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
133 132 expr φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
134 133 rexlimdvva φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 s I × 2 𝑜 S A = i T A A - 1 - 1 r S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
135 112 134 syl5bir φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r s I × 2 𝑜 S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
136 135 rexlimdvva φ i 0 A A - 1 - 1 j 0 B B - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r s I × 2 𝑜 S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
137 111 136 syl5bir φ i 0 A A - 1 - 1 r I × 2 𝑜 S A = i T A A - 1 - 1 r j 0 B B - 1 - 1 s I × 2 𝑜 S B = j T B B - 1 - 1 s A A - 1 - 1 = B B - 1 - 1
138 84 110 137 mp2and φ A A - 1 - 1 = B B - 1 - 1
139 fvres B - 1 - 1 0 ..^ B 1 B 0 ..^ B 1 B - 1 - 1 = B B - 1 - 1
140 85 94 139 3syl φ B 0 ..^ B 1 B - 1 - 1 = B B - 1 - 1
141 138 70 140 3eqtr4d φ A 0 ..^ A 1 A - 1 - 1 = B 0 ..^ B 1 B - 1 - 1
142 fz1ssfz0 1 B 0 B
143 98 nn0red φ B
144 143 lem1d φ B 1 B
145 fznn B B 1 1 B B 1 B 1 B
146 99 145 syl φ B 1 1 B B 1 B 1 B
147 85 144 146 mpbir2and φ B 1 1 B
148 142 147 sselid φ B 1 0 B
149 pfxres B Word W B 1 0 B B prefix B 1 = B 0 ..^ B 1
150 91 148 149 syl2anc φ B prefix B 1 = B 0 ..^ B 1
151 150 fveq2d φ B prefix B 1 = B 0 ..^ B 1
152 pfxlen B Word W B 1 0 B B prefix B 1 = B 1
153 91 148 152 syl2anc φ B prefix B 1 = B 1
154 151 153 eqtr3d φ B 0 ..^ B 1 = B 1
155 154 fvoveq1d φ B 0 ..^ B 1 B 0 ..^ B 1 1 = B 0 ..^ B 1 B - 1 - 1
156 141 67 155 3eqtr4d φ A 0 ..^ A 1 A 0 ..^ A 1 1 = B 0 ..^ B 1 B 0 ..^ B 1 1
157 1 2 3 4 5 6 efgsres B dom S B 1 1 B B 0 ..^ B 1 dom S
158 9 147 157 syl2anc φ B 0 ..^ B 1 dom S
159 1 2 3 4 5 6 efgsval B 0 ..^ B 1 dom S S B 0 ..^ B 1 = B 0 ..^ B 1 B 0 ..^ B 1 1
160 158 159 syl φ S B 0 ..^ B 1 = B 0 ..^ B 1 B 0 ..^ B 1 1
161 156 58 160 3eqtr4d φ S A 0 ..^ A 1 = S B 0 ..^ B 1
162 fveq2 a = A 0 ..^ A 1 S a = S A 0 ..^ A 1
163 162 fveq2d a = A 0 ..^ A 1 S a = S A 0 ..^ A 1
164 163 breq1d a = A 0 ..^ A 1 S a < S A S A 0 ..^ A 1 < S A
165 162 eqeq1d a = A 0 ..^ A 1 S a = S b S A 0 ..^ A 1 = S b
166 fveq1 a = A 0 ..^ A 1 a 0 = A 0 ..^ A 1 0
167 166 eqeq1d a = A 0 ..^ A 1 a 0 = b 0 A 0 ..^ A 1 0 = b 0
168 165 167 imbi12d a = A 0 ..^ A 1 S a = S b a 0 = b 0 S A 0 ..^ A 1 = S b A 0 ..^ A 1 0 = b 0
169 164 168 imbi12d a = A 0 ..^ A 1 S a < S A S a = S b a 0 = b 0 S A 0 ..^ A 1 < S A S A 0 ..^ A 1 = S b A 0 ..^ A 1 0 = b 0
170 fveq2 b = B 0 ..^ B 1 S b = S B 0 ..^ B 1
171 170 eqeq2d b = B 0 ..^ B 1 S A 0 ..^ A 1 = S b S A 0 ..^ A 1 = S B 0 ..^ B 1
172 fveq1 b = B 0 ..^ B 1 b 0 = B 0 ..^ B 1 0
173 172 eqeq2d b = B 0 ..^ B 1 A 0 ..^ A 1 0 = b 0 A 0 ..^ A 1 0 = B 0 ..^ B 1 0
174 171 173 imbi12d b = B 0 ..^ B 1 S A 0 ..^ A 1 = S b A 0 ..^ A 1 0 = b 0 S A 0 ..^ A 1 = S B 0 ..^ B 1 A 0 ..^ A 1 0 = B 0 ..^ B 1 0
175 174 imbi2d b = B 0 ..^ B 1 S A 0 ..^ A 1 < S A S A 0 ..^ A 1 = S b A 0 ..^ A 1 0 = b 0 S A 0 ..^ A 1 < S A S A 0 ..^ A 1 = S B 0 ..^ B 1 A 0 ..^ A 1 0 = B 0 ..^ B 1 0
176 169 175 rspc2va A 0 ..^ A 1 dom S B 0 ..^ B 1 dom S a dom S b dom S S a < S A S a = S b a 0 = b 0 S A 0 ..^ A 1 < S A S A 0 ..^ A 1 = S B 0 ..^ B 1 A 0 ..^ A 1 0 = B 0 ..^ B 1 0
177 56 158 7 176 syl21anc φ S A 0 ..^ A 1 < S A S A 0 ..^ A 1 = S B 0 ..^ B 1 A 0 ..^ A 1 0 = B 0 ..^ B 1 0
178 77 161 177 mp2d φ A 0 ..^ A 1 0 = B 0 ..^ B 1 0
179 lbfzo0 0 0 ..^ A 1 A 1
180 21 179 sylibr φ 0 0 ..^ A 1
181 180 fvresd φ A 0 ..^ A 1 0 = A 0
182 lbfzo0 0 0 ..^ B 1 B 1
183 85 182 sylibr φ 0 0 ..^ B 1
184 183 fvresd φ B 0 ..^ B 1 0 = B 0
185 178 181 184 3eqtr3d φ A 0 = B 0
186 185 11 pm2.65i ¬ φ