Metamath Proof Explorer


Theorem cshwidxm

Description: The symbol at index (n-N) of a word of length n (not 0) cyclically shifted by N positions (not 0) is the symbol at index 0 of the original word. (Contributed by AV, 18-May-2018) (Revised by AV, 21-May-2018) (Revised by AV, 30-Oct-2018)

Ref Expression
Assertion cshwidxm WWordVN1WWcyclShiftNWN=W0

Proof

Step Hyp Ref Expression
1 simpl WWordVN1WWWordV
2 elfzelz N1WN
3 2 adantl WWordVN1WN
4 ubmelfzo N1WWN0..^W
5 4 adantl WWordVN1WWN0..^W
6 cshwidxmod WWordVNWN0..^WWcyclShiftNWN=WW-N+NmodW
7 1 3 5 6 syl3anc WWordVN1WWcyclShiftNWN=WW-N+NmodW
8 elfz1b N1WNWNW
9 nncn NN
10 nncn WW
11 9 10 anim12ci NWWN
12 11 3adant3 NWNWWN
13 8 12 sylbi N1WWN
14 npcan WNW-N+N=W
15 13 14 syl N1WW-N+N=W
16 15 oveq1d N1WW-N+NmodW=WmodW
17 16 adantl WWordVN1WW-N+NmodW=WmodW
18 nnrp WW+
19 modid0 W+WmodW=0
20 18 19 syl WWmodW=0
21 20 3ad2ant2 NWNWWmodW=0
22 8 21 sylbi N1WWmodW=0
23 22 adantl WWordVN1WWmodW=0
24 17 23 eqtrd WWordVN1WW-N+NmodW=0
25 24 fveq2d WWordVN1WWW-N+NmodW=W0
26 7 25 eqtrd WWordVN1WWcyclShiftNWN=W0