Metamath Proof Explorer


Theorem crctcshwlkn0lem4

Description: Lemma for crctcshwlkn0 . (Contributed by AV, 12-Mar-2021)

Ref Expression
Hypotheses crctcshwlkn0lem.s φ S 1 ..^ N
crctcshwlkn0lem.q Q = x 0 N if x N S P x + S P x + S - N
crctcshwlkn0lem.h H = F cyclShift S
crctcshwlkn0lem.n N = F
crctcshwlkn0lem.f φ F Word A
crctcshwlkn0lem.p φ i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i
Assertion crctcshwlkn0lem4 φ j 0 ..^ N S if- Q j = Q j + 1 I H j = Q j Q j Q j + 1 I H j

Proof

Step Hyp Ref Expression
1 crctcshwlkn0lem.s φ S 1 ..^ N
2 crctcshwlkn0lem.q Q = x 0 N if x N S P x + S P x + S - N
3 crctcshwlkn0lem.h H = F cyclShift S
4 crctcshwlkn0lem.n N = F
5 crctcshwlkn0lem.f φ F Word A
6 crctcshwlkn0lem.p φ i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i
7 elfzoelz j 0 ..^ N S j
8 7 zcnd j 0 ..^ N S j
9 8 adantl S 1 ..^ N j 0 ..^ N S j
10 elfzoelz S 1 ..^ N S
11 10 zcnd S 1 ..^ N S
12 11 adantr S 1 ..^ N j 0 ..^ N S S
13 1cnd S 1 ..^ N j 0 ..^ N S 1
14 9 12 13 add32d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S
15 elfzo1 S 1 ..^ N S N S < N
16 elfzonn0 j 0 ..^ N S j 0
17 nnnn0 S S 0
18 nn0addcl j 0 S 0 j + S 0
19 18 ex j 0 S 0 j + S 0
20 16 17 19 syl2imc S j 0 ..^ N S j + S 0
21 20 3ad2ant1 S N S < N j 0 ..^ N S j + S 0
22 15 21 sylbi S 1 ..^ N j 0 ..^ N S j + S 0
23 22 imp S 1 ..^ N j 0 ..^ N S j + S 0
24 fzo0ss1 1 ..^ N 0 ..^ N
25 24 sseli S 1 ..^ N S 0 ..^ N
26 elfzo0 S 0 ..^ N S 0 N S < N
27 26 simp2bi S 0 ..^ N N
28 25 27 syl S 1 ..^ N N
29 28 adantr S 1 ..^ N j 0 ..^ N S N
30 elfzo0 j 0 ..^ N S j 0 N S j < N S
31 nn0re j 0 j
32 nnre S S
33 nnre N N
34 32 33 anim12i S N S N
35 34 3adant3 S N S < N S N
36 15 35 sylbi S 1 ..^ N S N
37 31 36 anim12i j 0 S 1 ..^ N j S N
38 3anass j S N j S N
39 37 38 sylibr j 0 S 1 ..^ N j S N
40 ltaddsub j S N j + S < N j < N S
41 40 bicomd j S N j < N S j + S < N
42 39 41 syl j 0 S 1 ..^ N j < N S j + S < N
43 42 biimpd j 0 S 1 ..^ N j < N S j + S < N
44 43 ex j 0 S 1 ..^ N j < N S j + S < N
45 44 com23 j 0 j < N S S 1 ..^ N j + S < N
46 45 a1d j 0 N S j < N S S 1 ..^ N j + S < N
47 46 3imp j 0 N S j < N S S 1 ..^ N j + S < N
48 30 47 sylbi j 0 ..^ N S S 1 ..^ N j + S < N
49 48 impcom S 1 ..^ N j 0 ..^ N S j + S < N
50 elfzo0 j + S 0 ..^ N j + S 0 N j + S < N
51 23 29 49 50 syl3anbrc S 1 ..^ N j 0 ..^ N S j + S 0 ..^ N
52 51 adantr S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S j + S 0 ..^ N
53 fveq2 i = j + S P i = P j + S
54 53 adantl S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S P i = P j + S
55 fvoveq1 i = j + S P i + 1 = P j + S + 1
56 simpr S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S j + S + 1 = j + 1 + S
57 56 fveq2d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S P j + S + 1 = P j + 1 + S
58 55 57 sylan9eqr S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S P i + 1 = P j + 1 + S
59 54 58 eqeq12d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S P i = P i + 1 P j + S = P j + 1 + S
60 2fveq3 i = j + S I F i = I F j + S
61 53 sneqd i = j + S P i = P j + S
62 60 61 eqeq12d i = j + S I F i = P i I F j + S = P j + S
63 62 adantl S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S I F i = P i I F j + S = P j + S
64 54 58 preq12d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S P i P i + 1 = P j + S P j + 1 + S
65 60 adantl S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S I F i = I F j + S
66 64 65 sseq12d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S P i P i + 1 I F i P j + S P j + 1 + S I F j + S
67 59 63 66 ifpbi123d S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i = j + S if- P i = P i + 1 I F i = P i P i P i + 1 I F i if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
68 52 67 rspcdv S 1 ..^ N j 0 ..^ N S j + S + 1 = j + 1 + S i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
69 14 68 mpdan S 1 ..^ N j 0 ..^ N S i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
70 1 69 sylan φ j 0 ..^ N S i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
71 70 ex φ j 0 ..^ N S i 0 ..^ N if- P i = P i + 1 I F i = P i P i P i + 1 I F i if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
72 6 71 mpid φ j 0 ..^ N S if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
73 72 imp φ j 0 ..^ N S if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
74 elfzofz j 0 ..^ N S j 0 N S
75 1 2 crctcshwlkn0lem2 φ j 0 N S Q j = P j + S
76 74 75 sylan2 φ j 0 ..^ N S Q j = P j + S
77 fzofzp1 j 0 ..^ N S j + 1 0 N S
78 1 2 crctcshwlkn0lem2 φ j + 1 0 N S Q j + 1 = P j + 1 + S
79 77 78 sylan2 φ j 0 ..^ N S Q j + 1 = P j + 1 + S
80 3 fveq1i H j = F cyclShift S j
81 5 adantr φ j 0 ..^ N S F Word A
82 1 10 syl φ S
83 82 adantr φ j 0 ..^ N S S
84 nnz N N
85 84 adantl S N N
86 nnz S S
87 86 adantr S N S
88 85 87 zsubcld S N N S
89 17 nn0ge0d S 0 S
90 89 adantr S N 0 S
91 subge02 N S 0 S N S N
92 33 32 91 syl2anr S N 0 S N S N
93 90 92 mpbid S N N S N
94 88 85 93 3jca S N N S N N S N
95 94 3adant3 S N S < N N S N N S N
96 15 95 sylbi S 1 ..^ N N S N N S N
97 eluz2 N N S N S N N S N
98 96 97 sylibr S 1 ..^ N N N S
99 fzoss2 N N S 0 ..^ N S 0 ..^ N
100 1 98 99 3syl φ 0 ..^ N S 0 ..^ N
101 100 sselda φ j 0 ..^ N S j 0 ..^ N
102 4 oveq2i 0 ..^ N = 0 ..^ F
103 101 102 eleqtrdi φ j 0 ..^ N S j 0 ..^ F
104 cshwidxmod F Word A S j 0 ..^ F F cyclShift S j = F j + S mod F
105 81 83 103 104 syl3anc φ j 0 ..^ N S F cyclShift S j = F j + S mod F
106 4 eqcomi F = N
107 106 oveq2i j + S mod F = j + S mod N
108 21 imp S N S < N j 0 ..^ N S j + S 0
109 nnm1nn0 N N 1 0
110 109 3ad2ant2 S N S < N N 1 0
111 110 adantr S N S < N j 0 ..^ N S N 1 0
112 31 35 anim12i j 0 S N S < N j S N
113 112 38 sylibr j 0 S N S < N j S N
114 113 41 syl j 0 S N S < N j < N S j + S < N
115 17 3ad2ant1 S N S < N S 0
116 115 18 sylan2 j 0 S N S < N j + S 0
117 116 nn0zd j 0 S N S < N j + S
118 84 3ad2ant2 S N S < N N
119 118 adantl j 0 S N S < N N
120 zltlem1 j + S N j + S < N j + S N 1
121 117 119 120 syl2anc j 0 S N S < N j + S < N j + S N 1
122 121 biimpd j 0 S N S < N j + S < N j + S N 1
123 114 122 sylbid j 0 S N S < N j < N S j + S N 1
124 123 impancom j 0 j < N S S N S < N j + S N 1
125 124 3adant2 j 0 N S j < N S S N S < N j + S N 1
126 30 125 sylbi j 0 ..^ N S S N S < N j + S N 1
127 126 impcom S N S < N j 0 ..^ N S j + S N 1
128 108 111 127 3jca S N S < N j 0 ..^ N S j + S 0 N 1 0 j + S N 1
129 15 128 sylanb S 1 ..^ N j 0 ..^ N S j + S 0 N 1 0 j + S N 1
130 elfz2nn0 j + S 0 N 1 j + S 0 N 1 0 j + S N 1
131 129 130 sylibr S 1 ..^ N j 0 ..^ N S j + S 0 N 1
132 zaddcl j S j + S
133 7 10 132 syl2anr S 1 ..^ N j 0 ..^ N S j + S
134 zmodid2 j + S N j + S mod N = j + S j + S 0 N 1
135 133 29 134 syl2anc S 1 ..^ N j 0 ..^ N S j + S mod N = j + S j + S 0 N 1
136 131 135 mpbird S 1 ..^ N j 0 ..^ N S j + S mod N = j + S
137 1 136 sylan φ j 0 ..^ N S j + S mod N = j + S
138 107 137 syl5eq φ j 0 ..^ N S j + S mod F = j + S
139 138 fveq2d φ j 0 ..^ N S F j + S mod F = F j + S
140 105 139 eqtrd φ j 0 ..^ N S F cyclShift S j = F j + S
141 80 140 syl5eq φ j 0 ..^ N S H j = F j + S
142 141 fveq2d φ j 0 ..^ N S I H j = I F j + S
143 simp1 Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j = P j + S
144 simp2 Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j + 1 = P j + 1 + S
145 143 144 eqeq12d Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j = Q j + 1 P j + S = P j + 1 + S
146 simp3 Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S I H j = I F j + S
147 143 sneqd Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j = P j + S
148 146 147 eqeq12d Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S I H j = Q j I F j + S = P j + S
149 143 144 preq12d Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j Q j + 1 = P j + S P j + 1 + S
150 149 146 sseq12d Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S Q j Q j + 1 I H j P j + S P j + 1 + S I F j + S
151 145 148 150 ifpbi123d Q j = P j + S Q j + 1 = P j + 1 + S I H j = I F j + S if- Q j = Q j + 1 I H j = Q j Q j Q j + 1 I H j if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
152 76 79 142 151 syl3anc φ j 0 ..^ N S if- Q j = Q j + 1 I H j = Q j Q j Q j + 1 I H j if- P j + S = P j + 1 + S I F j + S = P j + S P j + S P j + 1 + S I F j + S
153 73 152 mpbird φ j 0 ..^ N S if- Q j = Q j + 1 I H j = Q j Q j Q j + 1 I H j
154 153 ralrimiva φ j 0 ..^ N S if- Q j = Q j + 1 I H j = Q j Q j Q j + 1 I H j