Metamath Proof Explorer


Theorem cshwsublen

Description: Cyclically shifting a word is invariant regarding subtraction of the word's length. (Contributed by AV, 3-Nov-2018)

Ref Expression
Assertion cshwsublen WWordVNWcyclShiftN=WcyclShiftNW

Proof

Step Hyp Ref Expression
1 oveq2 W=0NW=N0
2 zcn NN
3 2 subid1d NN0=N
4 3 adantl WWordVNN0=N
5 1 4 sylan9eq W=0WWordVNNW=N
6 5 eqcomd W=0WWordVNN=NW
7 6 oveq2d W=0WWordVNWcyclShiftN=WcyclShiftNW
8 7 ex W=0WWordVNWcyclShiftN=WcyclShiftNW
9 zre NN
10 9 adantl WWordVNN
11 lencl WWordVW0
12 elnnne0 WW0W0
13 nnrp WW+
14 12 13 sylbir W0W0W+
15 14 ex W0W0W+
16 11 15 syl WWordVW0W+
17 16 adantr WWordVNW0W+
18 17 impcom W0WWordVNW+
19 modeqmodmin NW+NmodW=NWmodW
20 10 18 19 syl2an2 W0WWordVNNmodW=NWmodW
21 20 oveq2d W0WWordVNWcyclShiftNmodW=WcyclShiftNWmodW
22 cshwmodn WWordVNWcyclShiftN=WcyclShiftNmodW
23 22 adantl W0WWordVNWcyclShiftN=WcyclShiftNmodW
24 simpl WWordVNWWordV
25 11 nn0zd WWordVW
26 zsubcl NWNW
27 25 26 sylan2 NWWordVNW
28 27 ancoms WWordVNNW
29 24 28 jca WWordVNWWordVNW
30 29 adantl W0WWordVNWWordVNW
31 cshwmodn WWordVNWWcyclShiftNW=WcyclShiftNWmodW
32 30 31 syl W0WWordVNWcyclShiftNW=WcyclShiftNWmodW
33 21 23 32 3eqtr4d W0WWordVNWcyclShiftN=WcyclShiftNW
34 33 ex W0WWordVNWcyclShiftN=WcyclShiftNW
35 8 34 pm2.61ine WWordVNWcyclShiftN=WcyclShiftNW