Metamath Proof Explorer


Theorem wrdt2ind

Description: Perform an induction over the structure of a word of even length. (Contributed by Thierry Arnoux, 26-Sep-2023)

Ref Expression
Hypotheses wrdt2ind.1
|- ( x = (/) -> ( ph <-> ps ) )
wrdt2ind.2
|- ( x = y -> ( ph <-> ch ) )
wrdt2ind.3
|- ( x = ( y ++ <" i j "> ) -> ( ph <-> th ) )
wrdt2ind.4
|- ( x = A -> ( ph <-> ta ) )
wrdt2ind.5
|- ps
wrdt2ind.6
|- ( ( y e. Word B /\ i e. B /\ j e. B ) -> ( ch -> th ) )
Assertion wrdt2ind
|- ( ( A e. Word B /\ 2 || ( # ` A ) ) -> ta )

Proof

Step Hyp Ref Expression
1 wrdt2ind.1
 |-  ( x = (/) -> ( ph <-> ps ) )
2 wrdt2ind.2
 |-  ( x = y -> ( ph <-> ch ) )
3 wrdt2ind.3
 |-  ( x = ( y ++ <" i j "> ) -> ( ph <-> th ) )
4 wrdt2ind.4
 |-  ( x = A -> ( ph <-> ta ) )
5 wrdt2ind.5
 |-  ps
6 wrdt2ind.6
 |-  ( ( y e. Word B /\ i e. B /\ j e. B ) -> ( ch -> th ) )
7 oveq2
 |-  ( n = 0 -> ( 2 x. n ) = ( 2 x. 0 ) )
8 7 eqeq1d
 |-  ( n = 0 -> ( ( 2 x. n ) = ( # ` x ) <-> ( 2 x. 0 ) = ( # ` x ) ) )
9 8 imbi1d
 |-  ( n = 0 -> ( ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> ( ( 2 x. 0 ) = ( # ` x ) -> ph ) ) )
10 9 ralbidv
 |-  ( n = 0 -> ( A. x e. Word B ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> A. x e. Word B ( ( 2 x. 0 ) = ( # ` x ) -> ph ) ) )
11 oveq2
 |-  ( n = k -> ( 2 x. n ) = ( 2 x. k ) )
12 11 eqeq1d
 |-  ( n = k -> ( ( 2 x. n ) = ( # ` x ) <-> ( 2 x. k ) = ( # ` x ) ) )
13 12 imbi1d
 |-  ( n = k -> ( ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> ( ( 2 x. k ) = ( # ` x ) -> ph ) ) )
14 13 ralbidv
 |-  ( n = k -> ( A. x e. Word B ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> A. x e. Word B ( ( 2 x. k ) = ( # ` x ) -> ph ) ) )
15 oveq2
 |-  ( n = ( k + 1 ) -> ( 2 x. n ) = ( 2 x. ( k + 1 ) ) )
16 15 eqeq1d
 |-  ( n = ( k + 1 ) -> ( ( 2 x. n ) = ( # ` x ) <-> ( 2 x. ( k + 1 ) ) = ( # ` x ) ) )
17 16 imbi1d
 |-  ( n = ( k + 1 ) -> ( ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) ) )
18 17 ralbidv
 |-  ( n = ( k + 1 ) -> ( A. x e. Word B ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> A. x e. Word B ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) ) )
19 oveq2
 |-  ( n = m -> ( 2 x. n ) = ( 2 x. m ) )
20 19 eqeq1d
 |-  ( n = m -> ( ( 2 x. n ) = ( # ` x ) <-> ( 2 x. m ) = ( # ` x ) ) )
21 20 imbi1d
 |-  ( n = m -> ( ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> ( ( 2 x. m ) = ( # ` x ) -> ph ) ) )
22 21 ralbidv
 |-  ( n = m -> ( A. x e. Word B ( ( 2 x. n ) = ( # ` x ) -> ph ) <-> A. x e. Word B ( ( 2 x. m ) = ( # ` x ) -> ph ) ) )
23 2t0e0
 |-  ( 2 x. 0 ) = 0
24 23 eqeq1i
 |-  ( ( 2 x. 0 ) = ( # ` x ) <-> 0 = ( # ` x ) )
25 eqcom
 |-  ( 0 = ( # ` x ) <-> ( # ` x ) = 0 )
26 24 25 bitri
 |-  ( ( 2 x. 0 ) = ( # ` x ) <-> ( # ` x ) = 0 )
27 hasheq0
 |-  ( x e. Word B -> ( ( # ` x ) = 0 <-> x = (/) ) )
28 26 27 syl5bb
 |-  ( x e. Word B -> ( ( 2 x. 0 ) = ( # ` x ) <-> x = (/) ) )
29 5 1 mpbiri
 |-  ( x = (/) -> ph )
30 28 29 syl6bi
 |-  ( x e. Word B -> ( ( 2 x. 0 ) = ( # ` x ) -> ph ) )
31 30 rgen
 |-  A. x e. Word B ( ( 2 x. 0 ) = ( # ` x ) -> ph )
32 fveq2
 |-  ( x = y -> ( # ` x ) = ( # ` y ) )
33 32 eqeq2d
 |-  ( x = y -> ( ( 2 x. k ) = ( # ` x ) <-> ( 2 x. k ) = ( # ` y ) ) )
34 33 2 imbi12d
 |-  ( x = y -> ( ( ( 2 x. k ) = ( # ` x ) -> ph ) <-> ( ( 2 x. k ) = ( # ` y ) -> ch ) ) )
35 34 cbvralvw
 |-  ( A. x e. Word B ( ( 2 x. k ) = ( # ` x ) -> ph ) <-> A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) )
36 simprl
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> x e. Word B )
37 0zd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 e. ZZ )
38 lencl
 |-  ( x e. Word B -> ( # ` x ) e. NN0 )
39 36 38 syl
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) e. NN0 )
40 39 nn0zd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) e. ZZ )
41 2z
 |-  2 e. ZZ
42 41 a1i
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 e. ZZ )
43 40 42 zsubcld
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) e. ZZ )
44 2re
 |-  2 e. RR
45 44 a1i
 |-  ( k e. NN0 -> 2 e. RR )
46 nn0re
 |-  ( k e. NN0 -> k e. RR )
47 0le2
 |-  0 <_ 2
48 47 a1i
 |-  ( k e. NN0 -> 0 <_ 2 )
49 nn0ge0
 |-  ( k e. NN0 -> 0 <_ k )
50 45 46 48 49 mulge0d
 |-  ( k e. NN0 -> 0 <_ ( 2 x. k ) )
51 50 adantr
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 <_ ( 2 x. k ) )
52 2cnd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 e. CC )
53 simpl
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> k e. NN0 )
54 53 nn0cnd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> k e. CC )
55 1cnd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 1 e. CC )
56 52 54 55 adddid
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. ( k + 1 ) ) = ( ( 2 x. k ) + ( 2 x. 1 ) ) )
57 simprr
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. ( k + 1 ) ) = ( # ` x ) )
58 2t1e2
 |-  ( 2 x. 1 ) = 2
59 58 a1i
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. 1 ) = 2 )
60 59 oveq2d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( 2 x. k ) + ( 2 x. 1 ) ) = ( ( 2 x. k ) + 2 ) )
61 56 57 60 3eqtr3d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) = ( ( 2 x. k ) + 2 ) )
62 61 oveq1d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) = ( ( ( 2 x. k ) + 2 ) - 2 ) )
63 52 54 mulcld
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. k ) e. CC )
64 63 52 pncand
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( ( 2 x. k ) + 2 ) - 2 ) = ( 2 x. k ) )
65 62 64 eqtrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) = ( 2 x. k ) )
66 51 65 breqtrrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 <_ ( ( # ` x ) - 2 ) )
67 43 zred
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) e. RR )
68 39 nn0red
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) e. RR )
69 2pos
 |-  0 < 2
70 44 a1i
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 e. RR )
71 70 68 ltsubposd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 0 < 2 <-> ( ( # ` x ) - 2 ) < ( # ` x ) ) )
72 69 71 mpbii
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) < ( # ` x ) )
73 67 68 72 ltled
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) <_ ( # ` x ) )
74 37 40 43 66 73 elfzd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) e. ( 0 ... ( # ` x ) ) )
75 pfxlen
 |-  ( ( x e. Word B /\ ( ( # ` x ) - 2 ) e. ( 0 ... ( # ` x ) ) ) -> ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) = ( ( # ` x ) - 2 ) )
76 36 74 75 syl2anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) = ( ( # ` x ) - 2 ) )
77 76 65 eqtr2d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. k ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) )
78 77 adantlr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. k ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) )
79 fveq2
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( # ` y ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) )
80 79 eqeq2d
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( ( 2 x. k ) = ( # ` y ) <-> ( 2 x. k ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) ) )
81 vex
 |-  y e. _V
82 81 2 sbcie
 |-  ( [. y / x ]. ph <-> ch )
83 dfsbcq
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( [. y / x ]. ph <-> [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph ) )
84 82 83 bitr3id
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( ch <-> [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph ) )
85 80 84 imbi12d
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( ( ( 2 x. k ) = ( # ` y ) -> ch ) <-> ( ( 2 x. k ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) -> [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph ) ) )
86 simplr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) )
87 pfxcl
 |-  ( x e. Word B -> ( x prefix ( ( # ` x ) - 2 ) ) e. Word B )
88 87 ad2antrl
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( x prefix ( ( # ` x ) - 2 ) ) e. Word B )
89 85 86 88 rspcdva
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( 2 x. k ) = ( # ` ( x prefix ( ( # ` x ) - 2 ) ) ) -> [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph ) )
90 78 89 mpd
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph )
91 2nn0
 |-  2 e. NN0
92 91 a1i
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 e. NN0 )
93 52 addid2d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 0 + 2 ) = 2 )
94 0red
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 e. RR )
95 65 67 eqeltrrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. k ) e. RR )
96 94 95 70 51 leadd1dd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 0 + 2 ) <_ ( ( 2 x. k ) + 2 ) )
97 93 96 eqbrtrrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 <_ ( ( 2 x. k ) + 2 ) )
98 97 61 breqtrrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 <_ ( # ` x ) )
99 nn0sub
 |-  ( ( 2 e. NN0 /\ ( # ` x ) e. NN0 ) -> ( 2 <_ ( # ` x ) <-> ( ( # ` x ) - 2 ) e. NN0 ) )
100 99 biimpa
 |-  ( ( ( 2 e. NN0 /\ ( # ` x ) e. NN0 ) /\ 2 <_ ( # ` x ) ) -> ( ( # ` x ) - 2 ) e. NN0 )
101 92 39 98 100 syl21anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) e. NN0 )
102 68 recnd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) e. CC )
103 102 52 55 subsubd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - ( 2 - 1 ) ) = ( ( ( # ` x ) - 2 ) + 1 ) )
104 2m1e1
 |-  ( 2 - 1 ) = 1
105 104 a1i
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 - 1 ) = 1 )
106 105 oveq2d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - ( 2 - 1 ) ) = ( ( # ` x ) - 1 ) )
107 103 106 eqtr3d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( ( # ` x ) - 2 ) + 1 ) = ( ( # ` x ) - 1 ) )
108 68 lem1d
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 1 ) <_ ( # ` x ) )
109 107 108 eqbrtrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( ( # ` x ) - 2 ) + 1 ) <_ ( # ` x ) )
110 nn0p1elfzo
 |-  ( ( ( ( # ` x ) - 2 ) e. NN0 /\ ( # ` x ) e. NN0 /\ ( ( ( # ` x ) - 2 ) + 1 ) <_ ( # ` x ) ) -> ( ( # ` x ) - 2 ) e. ( 0 ..^ ( # ` x ) ) )
111 101 39 109 110 syl3anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 2 ) e. ( 0 ..^ ( # ` x ) ) )
112 wrdsymbcl
 |-  ( ( x e. Word B /\ ( ( # ` x ) - 2 ) e. ( 0 ..^ ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 2 ) ) e. B )
113 36 111 112 syl2anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 2 ) ) e. B )
114 113 adantlr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 2 ) ) e. B )
115 nn0ge2m1nn0
 |-  ( ( ( # ` x ) e. NN0 /\ 2 <_ ( # ` x ) ) -> ( ( # ` x ) - 1 ) e. NN0 )
116 39 98 115 syl2anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 1 ) e. NN0 )
117 102 55 npcand
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( ( # ` x ) - 1 ) + 1 ) = ( # ` x ) )
118 68 leidd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( # ` x ) <_ ( # ` x ) )
119 117 118 eqbrtrd
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( ( # ` x ) - 1 ) + 1 ) <_ ( # ` x ) )
120 nn0p1elfzo
 |-  ( ( ( ( # ` x ) - 1 ) e. NN0 /\ ( # ` x ) e. NN0 /\ ( ( ( # ` x ) - 1 ) + 1 ) <_ ( # ` x ) ) -> ( ( # ` x ) - 1 ) e. ( 0 ..^ ( # ` x ) ) )
121 116 39 119 120 syl3anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ( # ` x ) - 1 ) e. ( 0 ..^ ( # ` x ) ) )
122 wrdsymbcl
 |-  ( ( x e. Word B /\ ( ( # ` x ) - 1 ) e. ( 0 ..^ ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 1 ) ) e. B )
123 36 121 122 syl2anc
 |-  ( ( k e. NN0 /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 1 ) ) e. B )
124 123 adantlr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( x ` ( ( # ` x ) - 1 ) ) e. B )
125 oveq1
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( y ++ <" i j "> ) = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) )
126 125 sbceq1d
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( [. ( y ++ <" i j "> ) / x ]. ph <-> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) / x ]. ph ) )
127 83 126 imbi12d
 |-  ( y = ( x prefix ( ( # ` x ) - 2 ) ) -> ( ( [. y / x ]. ph -> [. ( y ++ <" i j "> ) / x ]. ph ) <-> ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) / x ]. ph ) ) )
128 id
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> i = ( x ` ( ( # ` x ) - 2 ) ) )
129 eqidd
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> j = j )
130 128 129 s2eqd
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> <" i j "> = <" ( x ` ( ( # ` x ) - 2 ) ) j "> )
131 130 oveq2d
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) )
132 131 sbceq1d
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> ( [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) / x ]. ph <-> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) / x ]. ph ) )
133 132 imbi2d
 |-  ( i = ( x ` ( ( # ` x ) - 2 ) ) -> ( ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" i j "> ) / x ]. ph ) <-> ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) / x ]. ph ) ) )
134 eqidd
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> ( x ` ( ( # ` x ) - 2 ) ) = ( x ` ( ( # ` x ) - 2 ) ) )
135 id
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> j = ( x ` ( ( # ` x ) - 1 ) ) )
136 134 135 s2eqd
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> <" ( x ` ( ( # ` x ) - 2 ) ) j "> = <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> )
137 136 oveq2d
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) )
138 137 sbceq1d
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> ( [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) / x ]. ph <-> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) )
139 138 imbi2d
 |-  ( j = ( x ` ( ( # ` x ) - 1 ) ) -> ( ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) j "> ) / x ]. ph ) <-> ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) ) )
140 ovex
 |-  ( y ++ <" i j "> ) e. _V
141 140 3 sbcie
 |-  ( [. ( y ++ <" i j "> ) / x ]. ph <-> th )
142 6 82 141 3imtr4g
 |-  ( ( y e. Word B /\ i e. B /\ j e. B ) -> ( [. y / x ]. ph -> [. ( y ++ <" i j "> ) / x ]. ph ) )
143 127 133 139 142 vtocl3ga
 |-  ( ( ( x prefix ( ( # ` x ) - 2 ) ) e. Word B /\ ( x ` ( ( # ` x ) - 2 ) ) e. B /\ ( x ` ( ( # ` x ) - 1 ) ) e. B ) -> ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) )
144 88 114 124 143 syl3anc
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( [. ( x prefix ( ( # ` x ) - 2 ) ) / x ]. ph -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) )
145 90 144 mpd
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph )
146 simprl
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> x e. Word B )
147 1red
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 1 e. RR )
148 simpll
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> k e. NN0 )
149 148 nn0red
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> k e. RR )
150 149 147 readdcld
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( k + 1 ) e. RR )
151 44 a1i
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 e. RR )
152 47 a1i
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 <_ 2 )
153 0p1e1
 |-  ( 0 + 1 ) = 1
154 0red
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 e. RR )
155 148 nn0ge0d
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 0 <_ k )
156 147 leidd
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 1 <_ 1 )
157 154 147 149 147 155 156 le2addd
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 0 + 1 ) <_ ( k + 1 ) )
158 153 157 eqbrtrrid
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 1 <_ ( k + 1 ) )
159 147 150 151 152 158 lemul2ad
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. 1 ) <_ ( 2 x. ( k + 1 ) ) )
160 58 159 eqbrtrrid
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 <_ ( 2 x. ( k + 1 ) ) )
161 simprr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( 2 x. ( k + 1 ) ) = ( # ` x ) )
162 160 161 breqtrd
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> 2 <_ ( # ` x ) )
163 eqid
 |-  ( # ` x ) = ( # ` x )
164 163 pfxlsw2ccat
 |-  ( ( x e. Word B /\ 2 <_ ( # ` x ) ) -> x = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) )
165 164 eqcomd
 |-  ( ( x e. Word B /\ 2 <_ ( # ` x ) ) -> ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) = x )
166 165 eqcomd
 |-  ( ( x e. Word B /\ 2 <_ ( # ` x ) ) -> x = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) )
167 146 162 166 syl2anc
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> x = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) )
168 sbceq1a
 |-  ( x = ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) -> ( ph <-> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) )
169 167 168 syl
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ( ph <-> [. ( ( x prefix ( ( # ` x ) - 2 ) ) ++ <" ( x ` ( ( # ` x ) - 2 ) ) ( x ` ( ( # ` x ) - 1 ) ) "> ) / x ]. ph ) )
170 145 169 mpbird
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ ( x e. Word B /\ ( 2 x. ( k + 1 ) ) = ( # ` x ) ) ) -> ph )
171 170 expr
 |-  ( ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) /\ x e. Word B ) -> ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) )
172 171 ralrimiva
 |-  ( ( k e. NN0 /\ A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) ) -> A. x e. Word B ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) )
173 172 ex
 |-  ( k e. NN0 -> ( A. y e. Word B ( ( 2 x. k ) = ( # ` y ) -> ch ) -> A. x e. Word B ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) ) )
174 35 173 syl5bi
 |-  ( k e. NN0 -> ( A. x e. Word B ( ( 2 x. k ) = ( # ` x ) -> ph ) -> A. x e. Word B ( ( 2 x. ( k + 1 ) ) = ( # ` x ) -> ph ) ) )
175 10 14 18 22 31 174 nn0ind
 |-  ( m e. NN0 -> A. x e. Word B ( ( 2 x. m ) = ( # ` x ) -> ph ) )
176 175 adantl
 |-  ( ( A e. Word B /\ m e. NN0 ) -> A. x e. Word B ( ( 2 x. m ) = ( # ` x ) -> ph ) )
177 simpl
 |-  ( ( A e. Word B /\ m e. NN0 ) -> A e. Word B )
178 fveq2
 |-  ( x = A -> ( # ` x ) = ( # ` A ) )
179 178 eqeq2d
 |-  ( x = A -> ( ( 2 x. m ) = ( # ` x ) <-> ( 2 x. m ) = ( # ` A ) ) )
180 179 4 imbi12d
 |-  ( x = A -> ( ( ( 2 x. m ) = ( # ` x ) -> ph ) <-> ( ( 2 x. m ) = ( # ` A ) -> ta ) ) )
181 180 adantl
 |-  ( ( ( A e. Word B /\ m e. NN0 ) /\ x = A ) -> ( ( ( 2 x. m ) = ( # ` x ) -> ph ) <-> ( ( 2 x. m ) = ( # ` A ) -> ta ) ) )
182 177 181 rspcdv
 |-  ( ( A e. Word B /\ m e. NN0 ) -> ( A. x e. Word B ( ( 2 x. m ) = ( # ` x ) -> ph ) -> ( ( 2 x. m ) = ( # ` A ) -> ta ) ) )
183 176 182 mpd
 |-  ( ( A e. Word B /\ m e. NN0 ) -> ( ( 2 x. m ) = ( # ` A ) -> ta ) )
184 183 imp
 |-  ( ( ( A e. Word B /\ m e. NN0 ) /\ ( 2 x. m ) = ( # ` A ) ) -> ta )
185 184 adantllr
 |-  ( ( ( ( A e. Word B /\ 2 || ( # ` A ) ) /\ m e. NN0 ) /\ ( 2 x. m ) = ( # ` A ) ) -> ta )
186 lencl
 |-  ( A e. Word B -> ( # ` A ) e. NN0 )
187 evennn02n
 |-  ( ( # ` A ) e. NN0 -> ( 2 || ( # ` A ) <-> E. m e. NN0 ( 2 x. m ) = ( # ` A ) ) )
188 187 biimpa
 |-  ( ( ( # ` A ) e. NN0 /\ 2 || ( # ` A ) ) -> E. m e. NN0 ( 2 x. m ) = ( # ` A ) )
189 186 188 sylan
 |-  ( ( A e. Word B /\ 2 || ( # ` A ) ) -> E. m e. NN0 ( 2 x. m ) = ( # ` A ) )
190 185 189 r19.29a
 |-  ( ( A e. Word B /\ 2 || ( # ` A ) ) -> ta )