Metamath Proof Explorer


Theorem cshwidx0mod

Description: The symbol at index 0 of a cyclically shifted nonempty word is the symbol at index N (modulo the length of the word) of the original word. (Contributed by AV, 30-Oct-2018)

Ref Expression
Assertion cshwidx0mod
|- ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> ( ( W cyclShift N ) ` 0 ) = ( W ` ( N mod ( # ` W ) ) ) )

Proof

Step Hyp Ref Expression
1 simp1
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> W e. Word V )
2 simp3
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> N e. ZZ )
3 lennncl
 |-  ( ( W e. Word V /\ W =/= (/) ) -> ( # ` W ) e. NN )
4 lbfzo0
 |-  ( 0 e. ( 0 ..^ ( # ` W ) ) <-> ( # ` W ) e. NN )
5 3 4 sylibr
 |-  ( ( W e. Word V /\ W =/= (/) ) -> 0 e. ( 0 ..^ ( # ` W ) ) )
6 5 3adant3
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> 0 e. ( 0 ..^ ( # ` W ) ) )
7 cshwidxmod
 |-  ( ( W e. Word V /\ N e. ZZ /\ 0 e. ( 0 ..^ ( # ` W ) ) ) -> ( ( W cyclShift N ) ` 0 ) = ( W ` ( ( 0 + N ) mod ( # ` W ) ) ) )
8 1 2 6 7 syl3anc
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> ( ( W cyclShift N ) ` 0 ) = ( W ` ( ( 0 + N ) mod ( # ` W ) ) ) )
9 zcn
 |-  ( N e. ZZ -> N e. CC )
10 9 addid2d
 |-  ( N e. ZZ -> ( 0 + N ) = N )
11 10 3ad2ant3
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> ( 0 + N ) = N )
12 11 fvoveq1d
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> ( W ` ( ( 0 + N ) mod ( # ` W ) ) ) = ( W ` ( N mod ( # ` W ) ) ) )
13 8 12 eqtrd
 |-  ( ( W e. Word V /\ W =/= (/) /\ N e. ZZ ) -> ( ( W cyclShift N ) ` 0 ) = ( W ` ( N mod ( # ` W ) ) ) )