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
|- .+^ = ( a e. { -u 1 , 0 , 1 } , b e. { -u 1 , 0 , 1 } |-> if ( b = 0 , a , b ) )
signsv.w
|- W = { <. ( Base ` ndx ) , { -u 1 , 0 , 1 } >. , <. ( +g ` ndx ) , .+^ >. }
signsv.t
|- T = ( f e. Word RR |-> ( n e. ( 0 ..^ ( # ` f ) ) |-> ( W gsum ( i e. ( 0 ... n ) |-> ( sgn ` ( f ` i ) ) ) ) ) )
signsv.v
|- V = ( f e. Word RR |-> sum_ j e. ( 1 ..^ ( # ` f ) ) if ( ( ( T ` f ) ` j ) =/= ( ( T ` f ) ` ( j - 1 ) ) , 1 , 0 ) )
Assertion signstfval
|- ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) -> ( ( T ` F ) ` N ) = ( W gsum ( i e. ( 0 ... N ) |-> ( sgn ` ( F ` i ) ) ) ) )

Proof

Step Hyp Ref Expression
1 signsv.p
 |-  .+^ = ( a e. { -u 1 , 0 , 1 } , b e. { -u 1 , 0 , 1 } |-> if ( b = 0 , a , b ) )
2 signsv.w
 |-  W = { <. ( Base ` ndx ) , { -u 1 , 0 , 1 } >. , <. ( +g ` ndx ) , .+^ >. }
3 signsv.t
 |-  T = ( f e. Word RR |-> ( n e. ( 0 ..^ ( # ` f ) ) |-> ( W gsum ( i e. ( 0 ... n ) |-> ( sgn ` ( f ` i ) ) ) ) ) )
4 signsv.v
 |-  V = ( f e. Word RR |-> sum_ j e. ( 1 ..^ ( # ` f ) ) if ( ( ( T ` f ) ` j ) =/= ( ( T ` f ) ` ( j - 1 ) ) , 1 , 0 ) )
5 1 2 3 4 signstfv
 |-  ( F e. Word RR -> ( T ` F ) = ( n e. ( 0 ..^ ( # ` F ) ) |-> ( W gsum ( i e. ( 0 ... n ) |-> ( sgn ` ( F ` i ) ) ) ) ) )
6 5 adantr
 |-  ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) -> ( T ` F ) = ( n e. ( 0 ..^ ( # ` F ) ) |-> ( W gsum ( i e. ( 0 ... n ) |-> ( sgn ` ( F ` i ) ) ) ) ) )
7 simpr
 |-  ( ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) /\ n = N ) -> n = N )
8 7 oveq2d
 |-  ( ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) /\ n = N ) -> ( 0 ... n ) = ( 0 ... N ) )
9 8 mpteq1d
 |-  ( ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) /\ n = N ) -> ( i e. ( 0 ... n ) |-> ( sgn ` ( F ` i ) ) ) = ( i e. ( 0 ... N ) |-> ( sgn ` ( F ` i ) ) ) )
10 9 oveq2d
 |-  ( ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) /\ n = N ) -> ( W gsum ( i e. ( 0 ... n ) |-> ( sgn ` ( F ` i ) ) ) ) = ( W gsum ( i e. ( 0 ... N ) |-> ( sgn ` ( F ` i ) ) ) ) )
11 simpr
 |-  ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) -> N e. ( 0 ..^ ( # ` F ) ) )
12 ovexd
 |-  ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) -> ( W gsum ( i e. ( 0 ... N ) |-> ( sgn ` ( F ` i ) ) ) ) e. _V )
13 6 10 11 12 fvmptd
 |-  ( ( F e. Word RR /\ N e. ( 0 ..^ ( # ` F ) ) ) -> ( ( T ` F ) ` N ) = ( W gsum ( i e. ( 0 ... N ) |-> ( sgn ` ( F ` i ) ) ) ) )