Metamath Proof Explorer


Theorem signstfval

Description: Value of the zero-skipping sign word. (Contributed by Thierry Arnoux, 8-Oct-2018)

Ref Expression
Hypotheses signsv.p = ( 𝑎 ∈ { - 1 , 0 , 1 } , 𝑏 ∈ { - 1 , 0 , 1 } ↦ if ( 𝑏 = 0 , 𝑎 , 𝑏 ) )
signsv.w 𝑊 = { ⟨ ( Base ‘ ndx ) , { - 1 , 0 , 1 } ⟩ , ⟨ ( +g ‘ ndx ) , ⟩ }
signsv.t 𝑇 = ( 𝑓 ∈ Word ℝ ↦ ( 𝑛 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) ↦ ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝑓𝑖 ) ) ) ) ) )
signsv.v 𝑉 = ( 𝑓 ∈ Word ℝ ↦ Σ 𝑗 ∈ ( 1 ..^ ( ♯ ‘ 𝑓 ) ) if ( ( ( 𝑇𝑓 ) ‘ 𝑗 ) ≠ ( ( 𝑇𝑓 ) ‘ ( 𝑗 − 1 ) ) , 1 , 0 ) )
Assertion signstfval ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → ( ( 𝑇𝐹 ) ‘ 𝑁 ) = ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑁 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) )

Proof

Step Hyp Ref Expression
1 signsv.p = ( 𝑎 ∈ { - 1 , 0 , 1 } , 𝑏 ∈ { - 1 , 0 , 1 } ↦ if ( 𝑏 = 0 , 𝑎 , 𝑏 ) )
2 signsv.w 𝑊 = { ⟨ ( Base ‘ ndx ) , { - 1 , 0 , 1 } ⟩ , ⟨ ( +g ‘ ndx ) , ⟩ }
3 signsv.t 𝑇 = ( 𝑓 ∈ Word ℝ ↦ ( 𝑛 ∈ ( 0 ..^ ( ♯ ‘ 𝑓 ) ) ↦ ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝑓𝑖 ) ) ) ) ) )
4 signsv.v 𝑉 = ( 𝑓 ∈ Word ℝ ↦ Σ 𝑗 ∈ ( 1 ..^ ( ♯ ‘ 𝑓 ) ) if ( ( ( 𝑇𝑓 ) ‘ 𝑗 ) ≠ ( ( 𝑇𝑓 ) ‘ ( 𝑗 − 1 ) ) , 1 , 0 ) )
5 1 2 3 4 signstfv ( 𝐹 ∈ Word ℝ → ( 𝑇𝐹 ) = ( 𝑛 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ↦ ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) ) )
6 5 adantr ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → ( 𝑇𝐹 ) = ( 𝑛 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ↦ ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) ) )
7 simpr ( ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) ∧ 𝑛 = 𝑁 ) → 𝑛 = 𝑁 )
8 7 oveq2d ( ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) ∧ 𝑛 = 𝑁 ) → ( 0 ... 𝑛 ) = ( 0 ... 𝑁 ) )
9 8 mpteq1d ( ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) ∧ 𝑛 = 𝑁 ) → ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) = ( 𝑖 ∈ ( 0 ... 𝑁 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) )
10 9 oveq2d ( ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) ∧ 𝑛 = 𝑁 ) → ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑛 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) = ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑁 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) )
11 simpr ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) )
12 ovexd ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑁 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) ∈ V )
13 6 10 11 12 fvmptd ( ( 𝐹 ∈ Word ℝ ∧ 𝑁 ∈ ( 0 ..^ ( ♯ ‘ 𝐹 ) ) ) → ( ( 𝑇𝐹 ) ‘ 𝑁 ) = ( 𝑊 Σg ( 𝑖 ∈ ( 0 ... 𝑁 ) ↦ ( sgn ‘ ( 𝐹𝑖 ) ) ) ) )