Metamath Proof Explorer


Theorem signshlen

Description: Length of H , corresponding to the word F multiplied by ( x - C ) . (Contributed by Thierry Arnoux, 14-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 ) )
signs.h 𝐻 = ( ( ⟨“ 0 ”⟩ ++ 𝐹 ) ∘f − ( ( 𝐹 ++ ⟨“ 0 ”⟩ ) ∘f/c · 𝐶 ) )
Assertion signshlen ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ♯ ‘ 𝐻 ) = ( ( ♯ ‘ 𝐹 ) + 1 ) )

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 signs.h 𝐻 = ( ( ⟨“ 0 ”⟩ ++ 𝐹 ) ∘f − ( ( 𝐹 ++ ⟨“ 0 ”⟩ ) ∘f/c · 𝐶 ) )
6 1 2 3 4 5 signshf ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → 𝐻 : ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ⟶ ℝ )
7 ffn ( 𝐻 : ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ⟶ ℝ → 𝐻 Fn ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) )
8 hashfn ( 𝐻 Fn ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) → ( ♯ ‘ 𝐻 ) = ( ♯ ‘ ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ) )
9 6 7 8 3syl ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ♯ ‘ 𝐻 ) = ( ♯ ‘ ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ) )
10 lencl ( 𝐹 ∈ Word ℝ → ( ♯ ‘ 𝐹 ) ∈ ℕ0 )
11 10 adantr ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ♯ ‘ 𝐹 ) ∈ ℕ0 )
12 1nn0 1 ∈ ℕ0
13 12 a1i ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → 1 ∈ ℕ0 )
14 11 13 nn0addcld ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ( ♯ ‘ 𝐹 ) + 1 ) ∈ ℕ0 )
15 hashfzo0 ( ( ( ♯ ‘ 𝐹 ) + 1 ) ∈ ℕ0 → ( ♯ ‘ ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ) = ( ( ♯ ‘ 𝐹 ) + 1 ) )
16 14 15 syl ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ♯ ‘ ( 0 ..^ ( ( ♯ ‘ 𝐹 ) + 1 ) ) ) = ( ( ♯ ‘ 𝐹 ) + 1 ) )
17 9 16 eqtrd ( ( 𝐹 ∈ Word ℝ ∧ 𝐶 ∈ ℝ+ ) → ( ♯ ‘ 𝐻 ) = ( ( ♯ ‘ 𝐹 ) + 1 ) )