Metamath Proof Explorer


Theorem cycpmfv2

Description: Value of a cycle function for the last element of the orbit. (Contributed by Thierry Arnoux, 22-Sep-2023)

Ref Expression
Hypotheses tocycval.1 C=toCycD
tocycfv.d φDV
tocycfv.w φWWordD
tocycfv.1 φW:domW1-1D
cycpmfv2.1 φ0<W
cycpmfv2.2 φN=W1
Assertion cycpmfv2 φCWWN=W0

Proof

Step Hyp Ref Expression
1 tocycval.1 C=toCycD
2 tocycfv.d φDV
3 tocycfv.w φWWordD
4 tocycfv.1 φW:domW1-1D
5 cycpmfv2.1 φ0<W
6 cycpmfv2.2 φN=W1
7 lencl WWordDW0
8 3 7 syl φW0
9 elnnnn0b WW00<W
10 8 5 9 sylanbrc φW
11 elfz1end WW1W
12 10 11 sylib φW1W
13 fz1fzo0m1 W1WW10..^W
14 12 13 syl φW10..^W
15 6 14 eqeltrd φN0..^W
16 1 2 3 4 15 cycpmfvlem φCWWN=WcyclShift1W-1WN
17 df-f1 W:domW1-1DW:domWDFunW-1
18 4 17 sylib φW:domWDFunW-1
19 18 simprd φFunW-1
20 wrdfn WWordDWFn0..^W
21 3 20 syl φWFn0..^W
22 fnfvelrn WFn0..^WN0..^WWNranW
23 21 15 22 syl2anc φWNranW
24 df-rn ranW=domW-1
25 23 24 eleqtrdi φWNdomW-1
26 fvco FunW-1WNdomW-1WcyclShift1W-1WN=WcyclShift1W-1WN
27 19 25 26 syl2anc φWcyclShift1W-1WN=WcyclShift1W-1WN
28 f1f1orn W:domW1-1DW:domW1-1 ontoranW
29 4 28 syl φW:domW1-1 ontoranW
30 21 fndmd φdomW=0..^W
31 15 30 eleqtrrd φNdomW
32 f1ocnvfv1 W:domW1-1 ontoranWNdomWW-1WN=N
33 29 31 32 syl2anc φW-1WN=N
34 33 fveq2d φWcyclShift1W-1WN=WcyclShift1N
35 1zzd φ1
36 cshwidxmod WWordD1N0..^WWcyclShift1N=WN+1modW
37 3 35 15 36 syl3anc φWcyclShift1N=WN+1modW
38 fzossfz 0..^W0W
39 fzssz 0W
40 38 39 sstri 0..^W
41 40 15 sselid φN
42 41 zred φN
43 10 nnrpd φW+
44 6 oveq1d φNmodW=W1modW
45 zmodidfzoimp W10..^WW1modW=W1
46 14 45 syl φW1modW=W1
47 44 46 eqtrd φNmodW=W1
48 modm1p1mod0 NW+NmodW=W1N+1modW=0
49 48 imp NW+NmodW=W1N+1modW=0
50 42 43 47 49 syl21anc φN+1modW=0
51 50 fveq2d φWN+1modW=W0
52 34 37 51 3eqtrd φWcyclShift1W-1WN=W0
53 16 27 52 3eqtrd φCWWN=W0