Metamath Proof Explorer


Theorem cshco

Description: Mapping of words commutes with the "cyclical shift" operation. (Contributed by AV, 12-Nov-2018)

Ref Expression
Assertion cshco W Word A N F : A B F W cyclShift N = F W cyclShift N

Proof

Step Hyp Ref Expression
1 ffn F : A B F Fn A
2 1 3ad2ant3 W Word A N F : A B F Fn A
3 cshwfn W Word A N W cyclShift N Fn 0 ..^ W
4 3 3adant3 W Word A N F : A B W cyclShift N Fn 0 ..^ W
5 cshwrn W Word A N ran W cyclShift N A
6 5 3adant3 W Word A N F : A B ran W cyclShift N A
7 fnco F Fn A W cyclShift N Fn 0 ..^ W ran W cyclShift N A F W cyclShift N Fn 0 ..^ W
8 2 4 6 7 syl3anc W Word A N F : A B F W cyclShift N Fn 0 ..^ W
9 wrdco W Word A F : A B F W Word B
10 9 3adant2 W Word A N F : A B F W Word B
11 simp2 W Word A N F : A B N
12 cshwfn F W Word B N F W cyclShift N Fn 0 ..^ F W
13 10 11 12 syl2anc W Word A N F : A B F W cyclShift N Fn 0 ..^ F W
14 lenco W Word A F : A B F W = W
15 14 3adant2 W Word A N F : A B F W = W
16 15 oveq2d W Word A N F : A B 0 ..^ F W = 0 ..^ W
17 16 fneq2d W Word A N F : A B F W cyclShift N Fn 0 ..^ F W F W cyclShift N Fn 0 ..^ W
18 13 17 mpbid W Word A N F : A B F W cyclShift N Fn 0 ..^ W
19 15 adantr W Word A N F : A B i 0 ..^ W F W = W
20 19 oveq2d W Word A N F : A B i 0 ..^ W i + N mod F W = i + N mod W
21 20 fveq2d W Word A N F : A B i 0 ..^ W W i + N mod F W = W i + N mod W
22 21 fveq2d W Word A N F : A B i 0 ..^ W F W i + N mod F W = F W i + N mod W
23 wrdfn W Word A W Fn 0 ..^ W
24 23 3ad2ant1 W Word A N F : A B W Fn 0 ..^ W
25 24 adantr W Word A N F : A B i 0 ..^ W W Fn 0 ..^ W
26 elfzoelz i 0 ..^ W i
27 zaddcl i N i + N
28 26 11 27 syl2anr W Word A N F : A B i 0 ..^ W i + N
29 elfzo0 i 0 ..^ W i 0 W i < W
30 29 simp2bi i 0 ..^ W W
31 30 adantl W Word A N F : A B i 0 ..^ W W
32 zmodfzo i + N W i + N mod W 0 ..^ W
33 28 31 32 syl2anc W Word A N F : A B i 0 ..^ W i + N mod W 0 ..^ W
34 15 oveq2d W Word A N F : A B i + N mod F W = i + N mod W
35 34 eleq1d W Word A N F : A B i + N mod F W 0 ..^ W i + N mod W 0 ..^ W
36 35 adantr W Word A N F : A B i 0 ..^ W i + N mod F W 0 ..^ W i + N mod W 0 ..^ W
37 33 36 mpbird W Word A N F : A B i 0 ..^ W i + N mod F W 0 ..^ W
38 fvco2 W Fn 0 ..^ W i + N mod F W 0 ..^ W F W i + N mod F W = F W i + N mod F W
39 25 37 38 syl2anc W Word A N F : A B i 0 ..^ W F W i + N mod F W = F W i + N mod F W
40 simpl1 W Word A N F : A B i 0 ..^ W W Word A
41 11 adantr W Word A N F : A B i 0 ..^ W N
42 simpr W Word A N F : A B i 0 ..^ W i 0 ..^ W
43 cshwidxmod W Word A N i 0 ..^ W W cyclShift N i = W i + N mod W
44 43 fveq2d W Word A N i 0 ..^ W F W cyclShift N i = F W i + N mod W
45 40 41 42 44 syl3anc W Word A N F : A B i 0 ..^ W F W cyclShift N i = F W i + N mod W
46 22 39 45 3eqtr4rd W Word A N F : A B i 0 ..^ W F W cyclShift N i = F W i + N mod F W
47 fvco2 W cyclShift N Fn 0 ..^ W i 0 ..^ W F W cyclShift N i = F W cyclShift N i
48 4 47 sylan W Word A N F : A B i 0 ..^ W F W cyclShift N i = F W cyclShift N i
49 10 adantr W Word A N F : A B i 0 ..^ W F W Word B
50 15 eqcomd W Word A N F : A B W = F W
51 50 oveq2d W Word A N F : A B 0 ..^ W = 0 ..^ F W
52 51 eleq2d W Word A N F : A B i 0 ..^ W i 0 ..^ F W
53 52 biimpa W Word A N F : A B i 0 ..^ W i 0 ..^ F W
54 cshwidxmod F W Word B N i 0 ..^ F W F W cyclShift N i = F W i + N mod F W
55 49 41 53 54 syl3anc W Word A N F : A B i 0 ..^ W F W cyclShift N i = F W i + N mod F W
56 46 48 55 3eqtr4d W Word A N F : A B i 0 ..^ W F W cyclShift N i = F W cyclShift N i
57 8 18 56 eqfnfvd W Word A N F : A B F W cyclShift N = F W cyclShift N