Metamath Proof Explorer


Theorem eucrctshift

Description: Cyclically shifting the indices of an Eulerian circuit <. F , P >. results in an Eulerian circuit <. H , Q >. . (Contributed by AV, 15-Mar-2021) (Proof shortened by AV, 30-Oct-2021)

Ref Expression
Hypotheses eucrctshift.v V=VtxG
eucrctshift.i I=iEdgG
eucrctshift.c φFCircuitsGP
eucrctshift.n N=F
eucrctshift.s φS0..^N
eucrctshift.h H=FcyclShiftS
eucrctshift.q Q=x0NifxNSPx+SPx+S-N
eucrctshift.e φFEulerPathsGP
Assertion eucrctshift φHEulerPathsGQHCircuitsGQ

Proof

Step Hyp Ref Expression
1 eucrctshift.v V=VtxG
2 eucrctshift.i I=iEdgG
3 eucrctshift.c φFCircuitsGP
4 eucrctshift.n N=F
5 eucrctshift.s φS0..^N
6 eucrctshift.h H=FcyclShiftS
7 eucrctshift.q Q=x0NifxNSPx+SPx+S-N
8 eucrctshift.e φFEulerPathsGP
9 1 2 3 4 5 6 7 crctcshtrl φHTrailsGQ
10 simpr φHTrailsGQHTrailsGQ
11 2 eupthf1o FEulerPathsGPF:0..^F1-1 ontodomI
12 8 11 syl φF:0..^F1-1 ontodomI
13 12 adantr φHTrailsGQF:0..^F1-1 ontodomI
14 trliswlk HTrailsGQHWalksGQ
15 2 wlkf HWalksGQHWorddomI
16 wrdf HWorddomIH:0..^HdomI
17 14 15 16 3syl HTrailsGQH:0..^HdomI
18 df-f1o F:0..^F1-1 ontodomIF:0..^F1-1domIF:0..^FontodomI
19 dffo3 F:0..^FontodomIF:0..^FdomIidomIy0..^Fi=Fy
20 crctiswlk FCircuitsGPFWalksGP
21 2 wlkf FWalksGPFWorddomI
22 lencl FWorddomIF0
23 4 oveq2i 0..^N=0..^F
24 23 eleq2i S0..^NS0..^F
25 elfzonn0 S0..^FS0
26 25 adantl F0S0..^FS0
27 elfzonn0 y0..^Fy0
28 nn0sub S0y0SyyS0
29 26 27 28 syl2an F0S0..^Fy0..^FSyyS0
30 29 biimpac SyF0S0..^Fy0..^FyS0
31 elfzo0 y0..^Fy0Fy<F
32 simp2 y0Fy<FF
33 31 32 sylbi y0..^FF
34 33 ad2antll SyF0S0..^Fy0..^FF
35 nn0re y0y
36 35 ad2antrr y0FS0..^Fy
37 nnre FF
38 37 adantl y0FF
39 38 adantr y0FS0..^FF
40 elfzoelz S0..^FS
41 40 zred S0..^FS
42 readdcl FSF+S
43 38 41 42 syl2an y0FS0..^FF+S
44 36 39 43 3jca y0FS0..^FyFF+S
45 elfzole1 S0..^F0S
46 45 adantl y0FS0..^F0S
47 addge01 FS0SFF+S
48 38 41 47 syl2an y0FS0..^F0SFF+S
49 46 48 mpbid y0FS0..^FFF+S
50 44 49 lelttrdi y0FS0..^Fy<Fy<F+S
51 50 ex y0FS0..^Fy<Fy<F+S
52 51 com23 y0Fy<FS0..^Fy<F+S
53 52 3impia y0Fy<FS0..^Fy<F+S
54 53 adantld y0Fy<FF0S0..^Fy<F+S
55 54 imp y0Fy<FF0S0..^Fy<F+S
56 35 3ad2ant1 y0Fy<Fy
57 56 adantr y0Fy<FF0S0..^Fy
58 41 ad2antll y0Fy<FF0S0..^FS
59 elfzoel2 S0..^FF
60 59 zred S0..^FF
61 60 ad2antll y0Fy<FF0S0..^FF
62 57 58 61 ltsubaddd y0Fy<FF0S0..^FyS<Fy<F+S
63 55 62 mpbird y0Fy<FF0S0..^FyS<F
64 63 ex y0Fy<FF0S0..^FyS<F
65 31 64 sylbi y0..^FF0S0..^FyS<F
66 65 impcom F0S0..^Fy0..^FyS<F
67 66 adantl SyF0S0..^Fy0..^FyS<F
68 elfzo0 yS0..^FyS0FyS<F
69 30 34 67 68 syl3anbrc SyF0S0..^Fy0..^FyS0..^F
70 oveq1 z=ySz+S=y-S+S
71 70 oveq1d z=ySz+SmodF=y-S+SmodF
72 40 zcnd S0..^FS
73 72 adantl F0S0..^FS
74 elfzoelz y0..^Fy
75 74 zcnd y0..^Fy
76 73 75 anim12ci F0S0..^Fy0..^FyS
77 76 adantl SyF0S0..^Fy0..^FyS
78 npcan ySy-S+S=y
79 77 78 syl SyF0S0..^Fy0..^Fy-S+S=y
80 79 oveq1d SyF0S0..^Fy0..^Fy-S+SmodF=ymodF
81 zmodidfzoimp y0..^FymodF=y
82 81 ad2antll SyF0S0..^Fy0..^FymodF=y
83 80 82 eqtrd SyF0S0..^Fy0..^Fy-S+SmodF=y
84 71 83 sylan9eqr SyF0S0..^Fy0..^Fz=ySz+SmodF=y
85 84 eqcomd SyF0S0..^Fy0..^Fz=ySy=z+SmodF
86 69 85 rspcedeq2vd SyF0S0..^Fy0..^Fz0..^Fy=z+SmodF
87 elfzo0 S0..^FS0FS<F
88 nn0cn y0y
89 88 ad2antrr y0y<FS0FS<Fy
90 nn0cn S0S
91 90 3ad2ant1 S0FS<FS
92 91 adantl y0y<FS0FS<FS
93 nncn FF
94 93 3ad2ant2 S0FS<FF
95 94 adantl y0y<FS0FS<FF
96 89 92 95 subadd23d y0y<FS0FS<Fy-S+F=y+F-S
97 simpll y0y<FS0FS<Fy0
98 nn0z S0S
99 nnz FF
100 znnsub SFS<FFS
101 98 99 100 syl2an S0FS<FFS
102 101 biimp3a S0FS<FFS
103 102 adantl y0y<FS0FS<FFS
104 103 nnnn0d y0y<FS0FS<FFS0
105 97 104 nn0addcld y0y<FS0FS<Fy+F-S0
106 96 105 eqeltrd y0y<FS0FS<Fy-S+F0
107 106 adantr y0y<FS0FS<F¬Syy-S+F0
108 simplr2 y0y<FS0FS<F¬SyF
109 88 adantr y0y<Fy
110 subcl ySyS
111 109 91 110 syl2an y0y<FS0FS<FyS
112 95 111 jca y0y<FS0FS<FFyS
113 112 adantr y0y<FS0FS<F¬SyFyS
114 addcom FySF+y-S=y-S+F
115 113 114 syl y0y<FS0FS<F¬SyF+y-S=y-S+F
116 35 adantr y0y<Fy
117 nn0re S0S
118 117 3ad2ant1 S0FS<FS
119 ltnle ySy<S¬Sy
120 simpl ySy
121 simpr ySS
122 120 121 sublt0d ySyS<0y<S
123 122 biimprd ySy<SyS<0
124 119 123 sylbird yS¬SyyS<0
125 116 118 124 syl2an y0y<FS0FS<F¬SyyS<0
126 125 imp y0y<FS0FS<F¬SyyS<0
127 resubcl ySyS
128 116 118 127 syl2an y0y<FS0FS<FyS
129 37 3ad2ant2 S0FS<FF
130 129 adantl y0y<FS0FS<FF
131 128 130 jca y0y<FS0FS<FySF
132 131 adantr y0y<FS0FS<F¬SyySF
133 ltaddneg ySFyS<0F+y-S<F
134 132 133 syl y0y<FS0FS<F¬SyyS<0F+y-S<F
135 126 134 mpbid y0y<FS0FS<F¬SyF+y-S<F
136 115 135 eqbrtrrd y0y<FS0FS<F¬Syy-S+F<F
137 107 108 136 3jca y0y<FS0FS<F¬Syy-S+F0Fy-S+F<F
138 137 exp31 y0y<FS0FS<F¬Syy-S+F0Fy-S+F<F
139 138 3adant2 y0Fy<FS0FS<F¬Syy-S+F0Fy-S+F<F
140 87 139 biimtrid y0Fy<FS0..^F¬Syy-S+F0Fy-S+F<F
141 140 adantld y0Fy<FF0S0..^F¬Syy-S+F0Fy-S+F<F
142 31 141 sylbi y0..^FF0S0..^F¬Syy-S+F0Fy-S+F<F
143 142 impcom F0S0..^Fy0..^F¬Syy-S+F0Fy-S+F<F
144 143 impcom ¬SyF0S0..^Fy0..^Fy-S+F0Fy-S+F<F
145 elfzo0 y-S+F0..^Fy-S+F0Fy-S+F<F
146 144 145 sylibr ¬SyF0S0..^Fy0..^Fy-S+F0..^F
147 oveq1 z=y-S+Fz+S=yS+F+S
148 147 oveq1d z=y-S+Fz+SmodF=yS+F+SmodF
149 73 adantr F0S0..^Fy0..^FS
150 75 adantl F0S0..^Fy0..^Fy
151 nn0cn F0F
152 151 ad2antrr F0S0..^Fy0..^FF
153 149 150 152 3jca F0S0..^Fy0..^FSyF
154 153 adantl ¬SyF0S0..^Fy0..^FSyF
155 simp2 SyFy
156 simp3 SyFF
157 simp1 SyFS
158 155 157 156 nppcand SyFyS+F+S=y+F
159 155 156 158 comraddd SyFyS+F+S=F+y
160 154 159 syl ¬SyF0S0..^Fy0..^FyS+F+S=F+y
161 160 oveq1d ¬SyF0S0..^Fy0..^FyS+F+SmodF=F+ymodF
162 31 biimpi y0..^Fy0Fy<F
163 162 ad2antll ¬SyF0S0..^Fy0..^Fy0Fy<F
164 addmodid y0Fy<FF+ymodF=y
165 163 164 syl ¬SyF0S0..^Fy0..^FF+ymodF=y
166 161 165 eqtrd ¬SyF0S0..^Fy0..^FyS+F+SmodF=y
167 148 166 sylan9eqr ¬SyF0S0..^Fy0..^Fz=y-S+Fz+SmodF=y
168 167 eqcomd ¬SyF0S0..^Fy0..^Fz=y-S+Fy=z+SmodF
169 146 168 rspcedeq2vd ¬SyF0S0..^Fy0..^Fz0..^Fy=z+SmodF
170 86 169 pm2.61ian F0S0..^Fy0..^Fz0..^Fy=z+SmodF
171 23 rexeqi z0..^Ny=z+SmodFz0..^Fy=z+SmodF
172 170 171 sylibr F0S0..^Fy0..^Fz0..^Ny=z+SmodF
173 172 exp31 F0S0..^Fy0..^Fz0..^Ny=z+SmodF
174 24 173 biimtrid F0S0..^Ny0..^Fz0..^Ny=z+SmodF
175 22 174 syl FWorddomIS0..^Ny0..^Fz0..^Ny=z+SmodF
176 20 21 175 3syl FCircuitsGPS0..^Ny0..^Fz0..^Ny=z+SmodF
177 3 5 176 sylc φy0..^Fz0..^Ny=z+SmodF
178 177 adantr φidomIy0..^Fz0..^Ny=z+SmodF
179 178 imp φidomIy0..^Fz0..^Ny=z+SmodF
180 179 adantr φidomIy0..^Fi=Fyz0..^Ny=z+SmodF
181 fveq2 y=z+SmodFFy=Fz+SmodF
182 181 reximi z0..^Ny=z+SmodFz0..^NFy=Fz+SmodF
183 180 182 syl φidomIy0..^Fi=Fyz0..^NFy=Fz+SmodF
184 3 20 21 3syl φFWorddomI
185 184 ad3antrrr φidomIy0..^Fi=FyFWorddomI
186 elfzoelz S0..^NS
187 5 186 syl φS
188 187 ad3antrrr φidomIy0..^Fi=FyS
189 23 eleq2i z0..^Nz0..^F
190 189 biimpi z0..^Nz0..^F
191 cshwidxmod FWorddomISz0..^FFcyclShiftSz=Fz+SmodF
192 185 188 190 191 syl2an3an φidomIy0..^Fi=Fyz0..^NFcyclShiftSz=Fz+SmodF
193 192 eqeq2d φidomIy0..^Fi=Fyz0..^NFy=FcyclShiftSzFy=Fz+SmodF
194 193 rexbidva φidomIy0..^Fi=Fyz0..^NFy=FcyclShiftSzz0..^NFy=Fz+SmodF
195 183 194 mpbird φidomIy0..^Fi=Fyz0..^NFy=FcyclShiftSz
196 1 2 3 4 5 6 crctcshlem2 φH=N
197 196 oveq2d φ0..^H=0..^N
198 197 ad3antrrr φidomIy0..^Fi=Fy0..^H=0..^N
199 simpr φidomIy0..^Fi=Fyi=Fy
200 6 fveq1i Hz=FcyclShiftSz
201 200 a1i φidomIy0..^Fi=FyHz=FcyclShiftSz
202 199 201 eqeq12d φidomIy0..^Fi=Fyi=HzFy=FcyclShiftSz
203 198 202 rexeqbidv φidomIy0..^Fi=Fyz0..^Hi=Hzz0..^NFy=FcyclShiftSz
204 195 203 mpbird φidomIy0..^Fi=Fyz0..^Hi=Hz
205 204 rexlimdva2 φidomIy0..^Fi=Fyz0..^Hi=Hz
206 205 ralimdva φidomIy0..^Fi=FyidomIz0..^Hi=Hz
207 206 impcom idomIy0..^Fi=FyφidomIz0..^Hi=Hz
208 207 anim1ci idomIy0..^Fi=FyφH:0..^HdomIH:0..^HdomIidomIz0..^Hi=Hz
209 dffo3 H:0..^HontodomIH:0..^HdomIidomIz0..^Hi=Hz
210 208 209 sylibr idomIy0..^Fi=FyφH:0..^HdomIH:0..^HontodomI
211 210 exp31 idomIy0..^Fi=FyφH:0..^HdomIH:0..^HontodomI
212 19 211 simplbiim F:0..^FontodomIφH:0..^HdomIH:0..^HontodomI
213 18 212 simplbiim F:0..^F1-1 ontodomIφH:0..^HdomIH:0..^HontodomI
214 213 com13 H:0..^HdomIφF:0..^F1-1 ontodomIH:0..^HontodomI
215 17 214 syl HTrailsGQφF:0..^F1-1 ontodomIH:0..^HontodomI
216 215 impcom φHTrailsGQF:0..^F1-1 ontodomIH:0..^HontodomI
217 13 216 mpd φHTrailsGQH:0..^HontodomI
218 10 217 jca φHTrailsGQHTrailsGQH:0..^HontodomI
219 9 218 mpdan φHTrailsGQH:0..^HontodomI
220 2 iseupth HEulerPathsGQHTrailsGQH:0..^HontodomI
221 219 220 sylibr φHEulerPathsGQ
222 1 2 3 4 5 6 7 crctcsh φHCircuitsGQ
223 221 222 jca φHEulerPathsGQHCircuitsGQ