Metamath Proof Explorer


Theorem cshwshash

Description: If a word has a length being a prime number, the size of the set of (different!) words resulting by cyclically shifting the original word equals the length of the original word or 1. (Contributed by AV, 19-May-2018) (Revised by AV, 10-Nov-2018)

Ref Expression
Hypothesis cshwrepswhash1.m M=wWordV|n0..^WWcyclShiftn=w
Assertion cshwshash WWordVWM=WM=1

Proof

Step Hyp Ref Expression
1 cshwrepswhash1.m M=wWordV|n0..^WWcyclShiftn=w
2 repswsymballbi WWordVW=W0repeatSWi0..^WWi=W0
3 2 adantr WWordVWW=W0repeatSWi0..^WWi=W0
4 prmnn WW
5 4 nnge1d W1W
6 wrdsymb1 WWordV1WW0V
7 5 6 sylan2 WWordVWW0V
8 7 adantr WWordVWW=W0repeatSWW0V
9 4 ad2antlr WWordVWW=W0repeatSWW
10 simpr WWordVWW=W0repeatSWW=W0repeatSW
11 1 cshwrepswhash1 W0VWW=W0repeatSWM=1
12 8 9 10 11 syl3anc WWordVWW=W0repeatSWM=1
13 12 ex WWordVWW=W0repeatSWM=1
14 3 13 sylbird WWordVWi0..^WWi=W0M=1
15 olc M=1M=WM=1
16 14 15 syl6com i0..^WWi=W0WWordVWM=WM=1
17 rexnal i0..^W¬Wi=W0¬i0..^WWi=W0
18 df-ne WiW0¬Wi=W0
19 18 bicomi ¬Wi=W0WiW0
20 19 rexbii i0..^W¬Wi=W0i0..^WWiW0
21 17 20 bitr3i ¬i0..^WWi=W0i0..^WWiW0
22 1 cshwshashnsame WWordVWi0..^WWiW0M=W
23 orc M=WM=WM=1
24 22 23 syl6com i0..^WWiW0WWordVWM=WM=1
25 21 24 sylbi ¬i0..^WWi=W0WWordVWM=WM=1
26 16 25 pm2.61i WWordVWM=WM=1