Metamath Proof Explorer


Theorem cshwidxm1

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

Ref Expression
Assertion cshwidxm1 WWordVN0..^WWcyclShiftNW-N-1=WW1

Proof

Step Hyp Ref Expression
1 simpl WWordVN0..^WWWordV
2 elfzoelz N0..^WN
3 2 adantl WWordVN0..^WN
4 ubmelm1fzo N0..^WW-N-10..^W
5 4 adantl WWordVN0..^WW-N-10..^W
6 cshwidxmod WWordVNW-N-10..^WWcyclShiftNW-N-1=WWN-1+NmodW
7 1 3 5 6 syl3anc WWordVN0..^WWcyclShiftNW-N-1=WWN-1+NmodW
8 elfzoel2 N0..^WW
9 8 zcnd N0..^WW
10 2 zcnd N0..^WN
11 1cnd N0..^W1
12 nnpcan WN1WN-1+N=W1
13 9 10 11 12 syl3anc N0..^WWN-1+N=W1
14 13 oveq1d N0..^WWN-1+NmodW=W1modW
15 14 adantl WWordVN0..^WWN-1+NmodW=W1modW
16 elfzo0 N0..^WN0WN<W
17 nnre WW
18 peano2rem WW1
19 17 18 syl WW1
20 nnrp WW+
21 19 20 jca WW1W+
22 21 3ad2ant2 N0WN<WW1W+
23 16 22 sylbi N0..^WW1W+
24 nnm1ge0 W0W1
25 24 3ad2ant2 N0WN<W0W1
26 16 25 sylbi N0..^W0W1
27 zre WW
28 27 ltm1d WW1<W
29 8 28 syl N0..^WW1<W
30 23 26 29 jca32 N0..^WW1W+0W1W1<W
31 30 adantl WWordVN0..^WW1W+0W1W1<W
32 modid W1W+0W1W1<WW1modW=W1
33 31 32 syl WWordVN0..^WW1modW=W1
34 15 33 eqtrd WWordVN0..^WWN-1+NmodW=W1
35 34 fveq2d WWordVN0..^WWWN-1+NmodW=WW1
36 7 35 eqtrd WWordVN0..^WWcyclShiftNW-N-1=WW1