Metamath Proof Explorer


Theorem efgsf

Description: Value of the auxiliary function S defining a sequence of extensions starting at some irreducible word. (Contributed by Mario Carneiro, 1-Oct-2015)

Ref Expression
Hypotheses efgval.w 𝑊 = ( I ‘ Word ( 𝐼 × 2o ) )
efgval.r = ( ~FG𝐼 )
efgval2.m 𝑀 = ( 𝑦𝐼 , 𝑧 ∈ 2o ↦ ⟨ 𝑦 , ( 1o𝑧 ) ⟩ )
efgval2.t 𝑇 = ( 𝑣𝑊 ↦ ( 𝑛 ∈ ( 0 ... ( ♯ ‘ 𝑣 ) ) , 𝑤 ∈ ( 𝐼 × 2o ) ↦ ( 𝑣 splice ⟨ 𝑛 , 𝑛 , ⟨“ 𝑤 ( 𝑀𝑤 ) ”⟩ ⟩ ) ) )
efgred.d 𝐷 = ( 𝑊 𝑥𝑊 ran ( 𝑇𝑥 ) )
efgred.s 𝑆 = ( 𝑚 ∈ { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ↦ ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) )
Assertion efgsf 𝑆 : { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ⟶ 𝑊

Proof

Step Hyp Ref Expression
1 efgval.w 𝑊 = ( I ‘ Word ( 𝐼 × 2o ) )
2 efgval.r = ( ~FG𝐼 )
3 efgval2.m 𝑀 = ( 𝑦𝐼 , 𝑧 ∈ 2o ↦ ⟨ 𝑦 , ( 1o𝑧 ) ⟩ )
4 efgval2.t 𝑇 = ( 𝑣𝑊 ↦ ( 𝑛 ∈ ( 0 ... ( ♯ ‘ 𝑣 ) ) , 𝑤 ∈ ( 𝐼 × 2o ) ↦ ( 𝑣 splice ⟨ 𝑛 , 𝑛 , ⟨“ 𝑤 ( 𝑀𝑤 ) ”⟩ ⟩ ) ) )
5 efgred.d 𝐷 = ( 𝑊 𝑥𝑊 ran ( 𝑇𝑥 ) )
6 efgred.s 𝑆 = ( 𝑚 ∈ { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ↦ ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) )
7 id ( 𝑚 = 𝑡𝑚 = 𝑡 )
8 fveq2 ( 𝑚 = 𝑡 → ( ♯ ‘ 𝑚 ) = ( ♯ ‘ 𝑡 ) )
9 8 oveq1d ( 𝑚 = 𝑡 → ( ( ♯ ‘ 𝑚 ) − 1 ) = ( ( ♯ ‘ 𝑡 ) − 1 ) )
10 7 9 fveq12d ( 𝑚 = 𝑡 → ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) = ( 𝑡 ‘ ( ( ♯ ‘ 𝑡 ) − 1 ) ) )
11 10 eleq1d ( 𝑚 = 𝑡 → ( ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) ∈ 𝑊 ↔ ( 𝑡 ‘ ( ( ♯ ‘ 𝑡 ) − 1 ) ) ∈ 𝑊 ) )
12 11 ralrab2 ( ∀ 𝑚 ∈ { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) ∈ 𝑊 ↔ ∀ 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ( ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) → ( 𝑡 ‘ ( ( ♯ ‘ 𝑡 ) − 1 ) ) ∈ 𝑊 ) )
13 eldifi ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → 𝑡 ∈ Word 𝑊 )
14 wrdf ( 𝑡 ∈ Word 𝑊𝑡 : ( 0 ..^ ( ♯ ‘ 𝑡 ) ) ⟶ 𝑊 )
15 13 14 syl ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → 𝑡 : ( 0 ..^ ( ♯ ‘ 𝑡 ) ) ⟶ 𝑊 )
16 eldifsn ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ↔ ( 𝑡 ∈ Word 𝑊𝑡 ≠ ∅ ) )
17 lennncl ( ( 𝑡 ∈ Word 𝑊𝑡 ≠ ∅ ) → ( ♯ ‘ 𝑡 ) ∈ ℕ )
18 16 17 sylbi ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → ( ♯ ‘ 𝑡 ) ∈ ℕ )
19 fzo0end ( ( ♯ ‘ 𝑡 ) ∈ ℕ → ( ( ♯ ‘ 𝑡 ) − 1 ) ∈ ( 0 ..^ ( ♯ ‘ 𝑡 ) ) )
20 18 19 syl ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → ( ( ♯ ‘ 𝑡 ) − 1 ) ∈ ( 0 ..^ ( ♯ ‘ 𝑡 ) ) )
21 15 20 ffvelrnd ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → ( 𝑡 ‘ ( ( ♯ ‘ 𝑡 ) − 1 ) ) ∈ 𝑊 )
22 21 a1d ( 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) → ( ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) → ( 𝑡 ‘ ( ( ♯ ‘ 𝑡 ) − 1 ) ) ∈ 𝑊 ) )
23 12 22 mprgbir 𝑚 ∈ { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) ∈ 𝑊
24 6 fmpt ( ∀ 𝑚 ∈ { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ( 𝑚 ‘ ( ( ♯ ‘ 𝑚 ) − 1 ) ) ∈ 𝑊𝑆 : { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ⟶ 𝑊 )
25 23 24 mpbi 𝑆 : { 𝑡 ∈ ( Word 𝑊 ∖ { ∅ } ) ∣ ( ( 𝑡 ‘ 0 ) ∈ 𝐷 ∧ ∀ 𝑘 ∈ ( 1 ..^ ( ♯ ‘ 𝑡 ) ) ( 𝑡𝑘 ) ∈ ran ( 𝑇 ‘ ( 𝑡 ‘ ( 𝑘 − 1 ) ) ) ) } ⟶ 𝑊