Metamath Proof Explorer


Theorem cshwcsh2id

Description: A cyclically shifted word can be reconstructed by cyclically shifting it again twice. Lemma for erclwwlktr and erclwwlkntr . (Contributed by AV, 9-Apr-2018) (Revised by AV, 11-Jun-2018) (Proof shortened by AV, 3-Nov-2018)

Ref Expression
Hypotheses cshwcsh2id.1 φ z Word V
cshwcsh2id.2 φ y = z x = y
Assertion cshwcsh2id φ m 0 y x = y cyclShift m k 0 z y = z cyclShift k n 0 z x = z cyclShift n

Proof

Step Hyp Ref Expression
1 cshwcsh2id.1 φ z Word V
2 cshwcsh2id.2 φ y = z x = y
3 oveq1 y = z cyclShift k y cyclShift m = z cyclShift k cyclShift m
4 3 eqeq2d y = z cyclShift k x = y cyclShift m x = z cyclShift k cyclShift m
5 4 anbi2d y = z cyclShift k m 0 y x = y cyclShift m m 0 y x = z cyclShift k cyclShift m
6 5 adantr y = z cyclShift k k 0 z m 0 y x = y cyclShift m m 0 y x = z cyclShift k cyclShift m
7 elfznn0 k 0 z k 0
8 elfznn0 m 0 y m 0
9 nn0addcl k 0 m 0 k + m 0
10 7 8 9 syl2anr m 0 y k 0 z k + m 0
11 10 adantr m 0 y k 0 z k + m z φ k + m 0
12 elfz3nn0 k 0 z z 0
13 12 ad2antlr m 0 y k 0 z k + m z φ z 0
14 simprl m 0 y k 0 z k + m z φ k + m z
15 elfz2nn0 k + m 0 z k + m 0 z 0 k + m z
16 11 13 14 15 syl3anbrc m 0 y k 0 z k + m z φ k + m 0 z
17 16 adantr m 0 y k 0 z k + m z φ x = z cyclShift k cyclShift m k + m 0 z
18 1 adantl k + m z φ z Word V
19 18 adantl m 0 y k 0 z k + m z φ z Word V
20 elfzelz k 0 z k
21 20 ad2antlr m 0 y k 0 z k + m z φ k
22 elfzelz m 0 y m
23 22 adantr m 0 y k 0 z m
24 23 adantr m 0 y k 0 z k + m z φ m
25 2cshw z Word V k m z cyclShift k cyclShift m = z cyclShift k + m
26 19 21 24 25 syl3anc m 0 y k 0 z k + m z φ z cyclShift k cyclShift m = z cyclShift k + m
27 26 eqeq2d m 0 y k 0 z k + m z φ x = z cyclShift k cyclShift m x = z cyclShift k + m
28 27 biimpa m 0 y k 0 z k + m z φ x = z cyclShift k cyclShift m x = z cyclShift k + m
29 17 28 jca m 0 y k 0 z k + m z φ x = z cyclShift k cyclShift m k + m 0 z x = z cyclShift k + m
30 29 exp41 m 0 y k 0 z k + m z φ x = z cyclShift k cyclShift m k + m 0 z x = z cyclShift k + m
31 30 com23 m 0 y k + m z φ k 0 z x = z cyclShift k cyclShift m k + m 0 z x = z cyclShift k + m
32 31 com24 m 0 y x = z cyclShift k cyclShift m k 0 z k + m z φ k + m 0 z x = z cyclShift k + m
33 32 imp m 0 y x = z cyclShift k cyclShift m k 0 z k + m z φ k + m 0 z x = z cyclShift k + m
34 33 com12 k 0 z m 0 y x = z cyclShift k cyclShift m k + m z φ k + m 0 z x = z cyclShift k + m
35 34 adantl y = z cyclShift k k 0 z m 0 y x = z cyclShift k cyclShift m k + m z φ k + m 0 z x = z cyclShift k + m
36 6 35 sylbid y = z cyclShift k k 0 z m 0 y x = y cyclShift m k + m z φ k + m 0 z x = z cyclShift k + m
37 36 ancoms k 0 z y = z cyclShift k m 0 y x = y cyclShift m k + m z φ k + m 0 z x = z cyclShift k + m
38 37 impcom m 0 y x = y cyclShift m k 0 z y = z cyclShift k k + m z φ k + m 0 z x = z cyclShift k + m
39 oveq2 n = k + m z cyclShift n = z cyclShift k + m
40 39 rspceeqv k + m 0 z x = z cyclShift k + m n 0 z x = z cyclShift n
41 38 40 syl6com k + m z φ m 0 y x = y cyclShift m k 0 z y = z cyclShift k n 0 z x = z cyclShift n
42 elfz2 k 0 z 0 z k 0 k k z
43 nn0z m 0 m
44 zaddcl k m k + m
45 44 ex k m k + m
46 45 adantl z k m k + m
47 46 impcom m z k k + m
48 simprl m z k z
49 47 48 zsubcld m z k k + m - z
50 49 ex m z k k + m - z
51 43 50 syl m 0 z k k + m - z
52 51 com12 z k m 0 k + m - z
53 52 3adant1 0 z k m 0 k + m - z
54 53 adantr 0 z k 0 k k z m 0 k + m - z
55 42 54 sylbi k 0 z m 0 k + m - z
56 8 55 mpan9 m 0 y k 0 z k + m - z
57 56 adantr m 0 y k 0 z ¬ k + m z φ k + m - z
58 elfz2nn0 k 0 z k 0 z 0 k z
59 nn0re k 0 k
60 nn0re z 0 z
61 59 60 anim12i k 0 z 0 k z
62 nn0re m 0 m
63 61 62 anim12i k 0 z 0 m 0 k z m
64 simplr k z m z
65 readdcl k m k + m
66 65 adantlr k z m k + m
67 64 66 ltnled k z m z < k + m ¬ k + m z
68 64 66 posdifd k z m z < k + m 0 < k + m - z
69 68 biimpd k z m z < k + m 0 < k + m - z
70 67 69 sylbird k z m ¬ k + m z 0 < k + m - z
71 63 70 syl k 0 z 0 m 0 ¬ k + m z 0 < k + m - z
72 71 ex k 0 z 0 m 0 ¬ k + m z 0 < k + m - z
73 72 3adant3 k 0 z 0 k z m 0 ¬ k + m z 0 < k + m - z
74 58 73 sylbi k 0 z m 0 ¬ k + m z 0 < k + m - z
75 8 74 mpan9 m 0 y k 0 z ¬ k + m z 0 < k + m - z
76 75 com12 ¬ k + m z m 0 y k 0 z 0 < k + m - z
77 76 adantr ¬ k + m z φ m 0 y k 0 z 0 < k + m - z
78 77 impcom m 0 y k 0 z ¬ k + m z φ 0 < k + m - z
79 elnnz k + m - z k + m - z 0 < k + m - z
80 57 78 79 sylanbrc m 0 y k 0 z ¬ k + m z φ k + m - z
81 80 nnnn0d m 0 y k 0 z ¬ k + m z φ k + m - z 0
82 12 ad2antlr m 0 y k 0 z ¬ k + m z φ z 0
83 oveq2 y = z 0 y = 0 z
84 83 eleq2d y = z m 0 y m 0 z
85 84 anbi1d y = z m 0 y k 0 z m 0 z k 0 z
86 elfz2nn0 m 0 z m 0 z 0 m z
87 59 adantr k 0 z 0 k
88 87 62 anim12i k 0 z 0 m 0 k m
89 60 60 jca z 0 z z
90 89 ad2antlr k 0 z 0 m 0 z z
91 le2add k m z z k z m z k + m z + z
92 88 90 91 syl2anc k 0 z 0 m 0 k z m z k + m z + z
93 nn0readdcl k 0 m 0 k + m
94 93 adantlr k 0 z 0 m 0 k + m
95 60 ad2antlr k 0 z 0 m 0 z
96 94 95 95 lesubadd2d k 0 z 0 m 0 k + m - z z k + m z + z
97 92 96 sylibrd k 0 z 0 m 0 k z m z k + m - z z
98 97 expcomd k 0 z 0 m 0 m z k z k + m - z z
99 98 ex k 0 z 0 m 0 m z k z k + m - z z
100 99 com24 k 0 z 0 k z m z m 0 k + m - z z
101 100 3impia k 0 z 0 k z m z m 0 k + m - z z
102 101 com13 m 0 m z k 0 z 0 k z k + m - z z
103 102 imp m 0 m z k 0 z 0 k z k + m - z z
104 58 103 syl5bi m 0 m z k 0 z k + m - z z
105 104 3adant2 m 0 z 0 m z k 0 z k + m - z z
106 86 105 sylbi m 0 z k 0 z k + m - z z
107 106 imp m 0 z k 0 z k + m - z z
108 85 107 syl6bi y = z m 0 y k 0 z k + m - z z
109 108 adantr y = z x = y m 0 y k 0 z k + m - z z
110 2 109 syl φ m 0 y k 0 z k + m - z z
111 110 adantl ¬ k + m z φ m 0 y k 0 z k + m - z z
112 111 impcom m 0 y k 0 z ¬ k + m z φ k + m - z z
113 elfz2nn0 k + m - z 0 z k + m - z 0 z 0 k + m - z z
114 81 82 112 113 syl3anbrc m 0 y k 0 z ¬ k + m z φ k + m - z 0 z
115 114 adantr m 0 y k 0 z ¬ k + m z φ x = z cyclShift k cyclShift m k + m - z 0 z
116 1 adantl ¬ k + m z φ z Word V
117 116 adantl m 0 y k 0 z ¬ k + m z φ z Word V
118 20 ad2antlr m 0 y k 0 z ¬ k + m z φ k
119 23 adantr m 0 y k 0 z ¬ k + m z φ m
120 117 118 119 25 syl3anc m 0 y k 0 z ¬ k + m z φ z cyclShift k cyclShift m = z cyclShift k + m
121 20 22 44 syl2anr m 0 y k 0 z k + m
122 cshwsublen z Word V k + m z cyclShift k + m = z cyclShift k + m - z
123 116 121 122 syl2anr m 0 y k 0 z ¬ k + m z φ z cyclShift k + m = z cyclShift k + m - z
124 120 123 eqtrd m 0 y k 0 z ¬ k + m z φ z cyclShift k cyclShift m = z cyclShift k + m - z
125 124 eqeq2d m 0 y k 0 z ¬ k + m z φ x = z cyclShift k cyclShift m x = z cyclShift k + m - z
126 125 biimpa m 0 y k 0 z ¬ k + m z φ x = z cyclShift k cyclShift m x = z cyclShift k + m - z
127 115 126 jca m 0 y k 0 z ¬ k + m z φ x = z cyclShift k cyclShift m k + m - z 0 z x = z cyclShift k + m - z
128 127 exp41 m 0 y k 0 z ¬ k + m z φ x = z cyclShift k cyclShift m k + m - z 0 z x = z cyclShift k + m - z
129 128 com23 m 0 y ¬ k + m z φ k 0 z x = z cyclShift k cyclShift m k + m - z 0 z x = z cyclShift k + m - z
130 129 com24 m 0 y x = z cyclShift k cyclShift m k 0 z ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
131 130 imp m 0 y x = z cyclShift k cyclShift m k 0 z ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
132 5 131 syl6bi y = z cyclShift k m 0 y x = y cyclShift m k 0 z ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
133 132 com23 y = z cyclShift k k 0 z m 0 y x = y cyclShift m ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
134 133 impcom k 0 z y = z cyclShift k m 0 y x = y cyclShift m ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
135 134 impcom m 0 y x = y cyclShift m k 0 z y = z cyclShift k ¬ k + m z φ k + m - z 0 z x = z cyclShift k + m - z
136 oveq2 n = k + m - z z cyclShift n = z cyclShift k + m - z
137 136 rspceeqv k + m - z 0 z x = z cyclShift k + m - z n 0 z x = z cyclShift n
138 135 137 syl6com ¬ k + m z φ m 0 y x = y cyclShift m k 0 z y = z cyclShift k n 0 z x = z cyclShift n
139 41 138 pm2.61ian φ m 0 y x = y cyclShift m k 0 z y = z cyclShift k n 0 z x = z cyclShift n