Metamath Proof Explorer


Theorem 2cshw

Description: Cyclically shifting a word two times. (Contributed by AV, 7-Apr-2018) (Revised by AV, 4-Jun-2018) (Revised by AV, 31-Oct-2018)

Ref Expression
Assertion 2cshw WWordVMNWcyclShiftMcyclShiftN=WcyclShiftM+N

Proof

Step Hyp Ref Expression
1 cshwlen WWordVMWcyclShiftM=W
2 1 3adant3 WWordVMNWcyclShiftM=W
3 cshwcl WWordVWcyclShiftMWordV
4 cshwlen WcyclShiftMWordVNWcyclShiftMcyclShiftN=WcyclShiftM
5 3 4 sylan WWordVNWcyclShiftMcyclShiftN=WcyclShiftM
6 5 3adant2 WWordVMNWcyclShiftMcyclShiftN=WcyclShiftM
7 simp1 WWordVMNWWordV
8 zaddcl MNM+N
9 8 3adant1 WWordVMNM+N
10 cshwlen WWordVM+NWcyclShiftM+N=W
11 7 9 10 syl2anc WWordVMNWcyclShiftM+N=W
12 2 6 11 3eqtr4d WWordVMNWcyclShiftMcyclShiftN=WcyclShiftM+N
13 6 2 eqtrd WWordVMNWcyclShiftMcyclShiftN=W
14 13 oveq2d WWordVMN0..^WcyclShiftMcyclShiftN=0..^W
15 14 eleq2d WWordVMNi0..^WcyclShiftMcyclShiftNi0..^W
16 3 3ad2ant1 WWordVMNWcyclShiftMWordV
17 16 adantr WWordVMNi0..^WWcyclShiftMWordV
18 simpl3 WWordVMNi0..^WN
19 2 oveq2d WWordVMN0..^WcyclShiftM=0..^W
20 19 eleq2d WWordVMNi0..^WcyclShiftMi0..^W
21 20 biimpar WWordVMNi0..^Wi0..^WcyclShiftM
22 cshwidxmod WcyclShiftMWordVNi0..^WcyclShiftMWcyclShiftMcyclShiftNi=WcyclShiftMi+NmodWcyclShiftM
23 17 18 21 22 syl3anc WWordVMNi0..^WWcyclShiftMcyclShiftNi=WcyclShiftMi+NmodWcyclShiftM
24 simpl1 WWordVMNi0..^WWWordV
25 simpl2 WWordVMNi0..^WM
26 elfzo0 i0..^Wi0Wi<W
27 nn0z i0i
28 27 ad2antrr i0WWWordVMNi
29 simpr3 i0WWWordVMNN
30 28 29 zaddcld i0WWWordVMNi+N
31 simplr i0WWWordVMNW
32 30 31 jca i0WWWordVMNi+NW
33 32 ex i0WWWordVMNi+NW
34 33 3adant3 i0Wi<WWWordVMNi+NW
35 26 34 sylbi i0..^WWWordVMNi+NW
36 35 impcom WWordVMNi0..^Wi+NW
37 zmodfzo i+NWi+NmodW0..^W
38 36 37 syl WWordVMNi0..^Wi+NmodW0..^W
39 1 oveq2d WWordVMi+NmodWcyclShiftM=i+NmodW
40 39 eleq1d WWordVMi+NmodWcyclShiftM0..^Wi+NmodW0..^W
41 40 3adant3 WWordVMNi+NmodWcyclShiftM0..^Wi+NmodW0..^W
42 41 adantr WWordVMNi0..^Wi+NmodWcyclShiftM0..^Wi+NmodW0..^W
43 38 42 mpbird WWordVMNi0..^Wi+NmodWcyclShiftM0..^W
44 cshwidxmod WWordVMi+NmodWcyclShiftM0..^WWcyclShiftMi+NmodWcyclShiftM=Wi+NmodWcyclShiftM+MmodW
45 24 25 43 44 syl3anc WWordVMNi0..^WWcyclShiftMi+NmodWcyclShiftM=Wi+NmodWcyclShiftM+MmodW
46 nn0re i0i
47 46 ad2antrr i0WMNi
48 zre NN
49 48 ad2antll i0WMNN
50 47 49 readdcld i0WMNi+N
51 zre MM
52 51 ad2antrl i0WMNM
53 nnrp WW+
54 53 ad2antlr i0WMNW+
55 modaddmod i+NMW+i+NmodW+MmodW=i+N+MmodW
56 50 52 54 55 syl3anc i0WMNi+NmodW+MmodW=i+N+MmodW
57 nn0cn i0i
58 57 ad2antrr i0WMNi
59 zcn MM
60 59 ad2antrl i0WMNM
61 zcn NN
62 61 ad2antll i0WMNN
63 add32r iMNi+M+N=i+N+M
64 58 60 62 63 syl3anc i0WMNi+M+N=i+N+M
65 64 oveq1d i0WMNi+M+NmodW=i+N+MmodW
66 56 65 eqtr4d i0WMNi+NmodW+MmodW=i+M+NmodW
67 66 ex i0WMNi+NmodW+MmodW=i+M+NmodW
68 67 3adant3 i0Wi<WMNi+NmodW+MmodW=i+M+NmodW
69 26 68 sylbi i0..^WMNi+NmodW+MmodW=i+M+NmodW
70 69 impcom MNi0..^Wi+NmodW+MmodW=i+M+NmodW
71 70 3adantl1 WWordVMNi0..^Wi+NmodW+MmodW=i+M+NmodW
72 71 fveq2d WWordVMNi0..^WWi+NmodW+MmodW=Wi+M+NmodW
73 2 adantr WWordVMNi0..^WWcyclShiftM=W
74 73 oveq2d WWordVMNi0..^Wi+NmodWcyclShiftM=i+NmodW
75 74 oveq1d WWordVMNi0..^Wi+NmodWcyclShiftM+M=i+NmodW+M
76 75 fvoveq1d WWordVMNi0..^WWi+NmodWcyclShiftM+MmodW=Wi+NmodW+MmodW
77 9 adantr WWordVMNi0..^WM+N
78 simpr WWordVMNi0..^Wi0..^W
79 cshwidxmod WWordVM+Ni0..^WWcyclShiftM+Ni=Wi+M+NmodW
80 24 77 78 79 syl3anc WWordVMNi0..^WWcyclShiftM+Ni=Wi+M+NmodW
81 72 76 80 3eqtr4d WWordVMNi0..^WWi+NmodWcyclShiftM+MmodW=WcyclShiftM+Ni
82 23 45 81 3eqtrd WWordVMNi0..^WWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
83 82 ex WWordVMNi0..^WWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
84 15 83 sylbid WWordVMNi0..^WcyclShiftMcyclShiftNWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
85 84 ralrimiv WWordVMNi0..^WcyclShiftMcyclShiftNWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
86 cshwcl WcyclShiftMWordVWcyclShiftMcyclShiftNWordV
87 3 86 syl WWordVWcyclShiftMcyclShiftNWordV
88 cshwcl WWordVWcyclShiftM+NWordV
89 eqwrd WcyclShiftMcyclShiftNWordVWcyclShiftM+NWordVWcyclShiftMcyclShiftN=WcyclShiftM+NWcyclShiftMcyclShiftN=WcyclShiftM+Ni0..^WcyclShiftMcyclShiftNWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
90 87 88 89 syl2anc WWordVWcyclShiftMcyclShiftN=WcyclShiftM+NWcyclShiftMcyclShiftN=WcyclShiftM+Ni0..^WcyclShiftMcyclShiftNWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
91 90 3ad2ant1 WWordVMNWcyclShiftMcyclShiftN=WcyclShiftM+NWcyclShiftMcyclShiftN=WcyclShiftM+Ni0..^WcyclShiftMcyclShiftNWcyclShiftMcyclShiftNi=WcyclShiftM+Ni
92 12 85 91 mpbir2and WWordVMNWcyclShiftMcyclShiftN=WcyclShiftM+N