Metamath Proof Explorer


Theorem repswcshw

Description: A cyclically shifted "repeated symbol word". (Contributed by Alexander van der Vekens, 7-Nov-2018) (Proof shortened by AV, 16-Oct-2022)

Ref Expression
Assertion repswcshw S V N 0 I S repeatS N cyclShift I = S repeatS N

Proof

Step Hyp Ref Expression
1 0csh0 cyclShift I =
2 repsw0 S V S repeatS 0 =
3 2 oveq1d S V S repeatS 0 cyclShift I = cyclShift I
4 1 3 2 3eqtr4a S V S repeatS 0 cyclShift I = S repeatS 0
5 4 3ad2ant1 S V N 0 I S repeatS 0 cyclShift I = S repeatS 0
6 oveq2 N = 0 S repeatS N = S repeatS 0
7 6 oveq1d N = 0 S repeatS N cyclShift I = S repeatS 0 cyclShift I
8 7 6 eqeq12d N = 0 S repeatS N cyclShift I = S repeatS N S repeatS 0 cyclShift I = S repeatS 0
9 5 8 syl5ibr N = 0 S V N 0 I S repeatS N cyclShift I = S repeatS N
10 idd ¬ N = 0 S V S V
11 df-ne N 0 ¬ N = 0
12 elnnne0 N N 0 N 0
13 12 simplbi2com N 0 N 0 N
14 11 13 sylbir ¬ N = 0 N 0 N
15 idd ¬ N = 0 I I
16 10 14 15 3anim123d ¬ N = 0 S V N 0 I S V N I
17 nnnn0 N N 0
18 17 anim2i S V N S V N 0
19 repsw S V N 0 S repeatS N Word V
20 18 19 syl S V N S repeatS N Word V
21 cshword S repeatS N Word V I S repeatS N cyclShift I = S repeatS N substr I mod S repeatS N S repeatS N ++ S repeatS N prefix I mod S repeatS N
22 20 21 stoic3 S V N I S repeatS N cyclShift I = S repeatS N substr I mod S repeatS N S repeatS N ++ S repeatS N prefix I mod S repeatS N
23 repswlen S V N 0 S repeatS N = N
24 18 23 syl S V N S repeatS N = N
25 24 oveq2d S V N I mod S repeatS N = I mod N
26 25 24 opeq12d S V N I mod S repeatS N S repeatS N = I mod N N
27 26 oveq2d S V N S repeatS N substr I mod S repeatS N S repeatS N = S repeatS N substr I mod N N
28 25 oveq2d S V N S repeatS N prefix I mod S repeatS N = S repeatS N prefix I mod N
29 27 28 oveq12d S V N S repeatS N substr I mod S repeatS N S repeatS N ++ S repeatS N prefix I mod S repeatS N = S repeatS N substr I mod N N ++ S repeatS N prefix I mod N
30 29 3adant3 S V N I S repeatS N substr I mod S repeatS N S repeatS N ++ S repeatS N prefix I mod S repeatS N = S repeatS N substr I mod N N ++ S repeatS N prefix I mod N
31 18 3adant3 S V N I S V N 0
32 zmodcl I N I mod N 0
33 32 ancoms N I I mod N 0
34 17 adantr N I N 0
35 33 34 jca N I I mod N 0 N 0
36 35 3adant1 S V N I I mod N 0 N 0
37 nnre N N
38 37 leidd N N N
39 38 3ad2ant2 S V N I N N
40 repswswrd S V N 0 I mod N 0 N 0 N N S repeatS N substr I mod N N = S repeatS N I mod N
41 31 36 39 40 syl3anc S V N I S repeatS N substr I mod N N = S repeatS N I mod N
42 simp1 S V N I S V
43 17 3ad2ant2 S V N I N 0
44 zmodfzp1 I N I mod N 0 N
45 44 ancoms N I I mod N 0 N
46 45 3adant1 S V N I I mod N 0 N
47 repswpfx S V N 0 I mod N 0 N S repeatS N prefix I mod N = S repeatS I mod N
48 42 43 46 47 syl3anc S V N I S repeatS N prefix I mod N = S repeatS I mod N
49 41 48 oveq12d S V N I S repeatS N substr I mod N N ++ S repeatS N prefix I mod N = S repeatS N I mod N ++ S repeatS I mod N
50 32 nn0red I N I mod N
51 50 ancoms N I I mod N
52 37 adantr N I N
53 zre I I
54 nnrp N N +
55 modlt I N + I mod N < N
56 53 54 55 syl2anr N I I mod N < N
57 51 52 56 ltled N I I mod N N
58 57 3adant1 S V N I I mod N N
59 33 3adant1 S V N I I mod N 0
60 nn0sub I mod N 0 N 0 I mod N N N I mod N 0
61 59 43 60 syl2anc S V N I I mod N N N I mod N 0
62 58 61 mpbid S V N I N I mod N 0
63 repswccat S V N I mod N 0 I mod N 0 S repeatS N I mod N ++ S repeatS I mod N = S repeatS N - I mod N + I mod N
64 42 62 59 63 syl3anc S V N I S repeatS N I mod N ++ S repeatS I mod N = S repeatS N - I mod N + I mod N
65 nncn N N
66 65 adantl I N N
67 32 nn0cnd I N I mod N
68 66 67 npcand I N N - I mod N + I mod N = N
69 68 ancoms N I N - I mod N + I mod N = N
70 69 3adant1 S V N I N - I mod N + I mod N = N
71 70 oveq2d S V N I S repeatS N - I mod N + I mod N = S repeatS N
72 49 64 71 3eqtrd S V N I S repeatS N substr I mod N N ++ S repeatS N prefix I mod N = S repeatS N
73 22 30 72 3eqtrd S V N I S repeatS N cyclShift I = S repeatS N
74 16 73 syl6 ¬ N = 0 S V N 0 I S repeatS N cyclShift I = S repeatS N
75 9 74 pm2.61i S V N 0 I S repeatS N cyclShift I = S repeatS N