Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
Mirrors > Home > MPE Home > Th. List > cshwshash | Structured version Visualization version GIF version |
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 |
---|---|
cshwrepswhash1.m | ⊢ 𝑀 = {𝑤 ∈ Word 𝑉 ∣ ∃𝑛 ∈ (0..^(♯‘𝑊))(𝑊 cyclShift 𝑛) = 𝑤} |
Ref | Expression |
---|---|
cshwshash | ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1)) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | repswsymballbi 14483 | . . . . 5 ⊢ (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (♯‘𝑊)) ↔ ∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0))) | |
2 | 1 | adantr 481 | . . . 4 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → (𝑊 = ((𝑊‘0) repeatS (♯‘𝑊)) ↔ ∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0))) |
3 | prmnn 16369 | . . . . . . . . 9 ⊢ ((♯‘𝑊) ∈ ℙ → (♯‘𝑊) ∈ ℕ) | |
4 | 3 | nnge1d 12013 | . . . . . . . 8 ⊢ ((♯‘𝑊) ∈ ℙ → 1 ≤ (♯‘𝑊)) |
5 | wrdsymb1 14246 | . . . . . . . 8 ⊢ ((𝑊 ∈ Word 𝑉 ∧ 1 ≤ (♯‘𝑊)) → (𝑊‘0) ∈ 𝑉) | |
6 | 4, 5 | sylan2 593 | . . . . . . 7 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → (𝑊‘0) ∈ 𝑉) |
7 | 6 | adantr 481 | . . . . . 6 ⊢ (((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) ∧ 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) → (𝑊‘0) ∈ 𝑉) |
8 | 3 | ad2antlr 724 | . . . . . 6 ⊢ (((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) ∧ 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) → (♯‘𝑊) ∈ ℕ) |
9 | simpr 485 | . . . . . 6 ⊢ (((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) ∧ 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) → 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) | |
10 | cshwrepswhash1.m | . . . . . . 7 ⊢ 𝑀 = {𝑤 ∈ Word 𝑉 ∣ ∃𝑛 ∈ (0..^(♯‘𝑊))(𝑊 cyclShift 𝑛) = 𝑤} | |
11 | 10 | cshwrepswhash1 16794 | . . . . . 6 ⊢ (((𝑊‘0) ∈ 𝑉 ∧ (♯‘𝑊) ∈ ℕ ∧ 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) → (♯‘𝑀) = 1) |
12 | 7, 8, 9, 11 | syl3anc 1370 | . . . . 5 ⊢ (((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) ∧ 𝑊 = ((𝑊‘0) repeatS (♯‘𝑊))) → (♯‘𝑀) = 1) |
13 | 12 | ex 413 | . . . 4 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → (𝑊 = ((𝑊‘0) repeatS (♯‘𝑊)) → (♯‘𝑀) = 1)) |
14 | 2, 13 | sylbird 259 | . . 3 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → (∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0) → (♯‘𝑀) = 1)) |
15 | olc 865 | . . 3 ⊢ ((♯‘𝑀) = 1 → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1)) | |
16 | 14, 15 | syl6com 37 | . 2 ⊢ (∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0) → ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1))) |
17 | rexnal 3168 | . . . 4 ⊢ (∃𝑖 ∈ (0..^(♯‘𝑊)) ¬ (𝑊‘𝑖) = (𝑊‘0) ↔ ¬ ∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0)) | |
18 | df-ne 2946 | . . . . . 6 ⊢ ((𝑊‘𝑖) ≠ (𝑊‘0) ↔ ¬ (𝑊‘𝑖) = (𝑊‘0)) | |
19 | 18 | bicomi 223 | . . . . 5 ⊢ (¬ (𝑊‘𝑖) = (𝑊‘0) ↔ (𝑊‘𝑖) ≠ (𝑊‘0)) |
20 | 19 | rexbii 3180 | . . . 4 ⊢ (∃𝑖 ∈ (0..^(♯‘𝑊)) ¬ (𝑊‘𝑖) = (𝑊‘0) ↔ ∃𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) ≠ (𝑊‘0)) |
21 | 17, 20 | bitr3i 276 | . . 3 ⊢ (¬ ∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0) ↔ ∃𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) ≠ (𝑊‘0)) |
22 | 10 | cshwshashnsame 16795 | . . . 4 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → (∃𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) ≠ (𝑊‘0) → (♯‘𝑀) = (♯‘𝑊))) |
23 | orc 864 | . . . 4 ⊢ ((♯‘𝑀) = (♯‘𝑊) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1)) | |
24 | 22, 23 | syl6com 37 | . . 3 ⊢ (∃𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) ≠ (𝑊‘0) → ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1))) |
25 | 21, 24 | sylbi 216 | . 2 ⊢ (¬ ∀𝑖 ∈ (0..^(♯‘𝑊))(𝑊‘𝑖) = (𝑊‘0) → ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1))) |
26 | 16, 25 | pm2.61i 182 | 1 ⊢ ((𝑊 ∈ Word 𝑉 ∧ (♯‘𝑊) ∈ ℙ) → ((♯‘𝑀) = (♯‘𝑊) ∨ (♯‘𝑀) = 1)) |
Colors of variables: wff setvar class |
Syntax hints: ¬ wn 3 → wi 4 ↔ wb 205 ∧ wa 396 ∨ wo 844 = wceq 1542 ∈ wcel 2110 ≠ wne 2945 ∀wral 3066 ∃wrex 3067 {crab 3070 class class class wbr 5079 ‘cfv 6431 (class class class)co 7269 0cc0 10864 1c1 10865 ≤ cle 11003 ℕcn 11965 ..^cfzo 13373 ♯chash 14034 Word cword 14207 repeatS creps 14471 cyclShift ccsh 14491 ℙcprime 16366 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1802 ax-4 1816 ax-5 1917 ax-6 1975 ax-7 2015 ax-8 2112 ax-9 2120 ax-10 2141 ax-11 2158 ax-12 2175 ax-ext 2711 ax-rep 5214 ax-sep 5227 ax-nul 5234 ax-pow 5292 ax-pr 5356 ax-un 7580 ax-inf2 9369 ax-cnex 10920 ax-resscn 10921 ax-1cn 10922 ax-icn 10923 ax-addcl 10924 ax-addrcl 10925 ax-mulcl 10926 ax-mulrcl 10927 ax-mulcom 10928 ax-addass 10929 ax-mulass 10930 ax-distr 10931 ax-i2m1 10932 ax-1ne0 10933 ax-1rid 10934 ax-rnegex 10935 ax-rrecex 10936 ax-cnre 10937 ax-pre-lttri 10938 ax-pre-lttrn 10939 ax-pre-ltadd 10940 ax-pre-mulgt0 10941 ax-pre-sup 10942 |
This theorem depends on definitions: df-bi 206 df-an 397 df-or 845 df-3or 1087 df-3an 1088 df-tru 1545 df-fal 1555 df-ex 1787 df-nf 1791 df-sb 2072 df-mo 2542 df-eu 2571 df-clab 2718 df-cleq 2732 df-clel 2818 df-nfc 2891 df-ne 2946 df-nel 3052 df-ral 3071 df-rex 3072 df-reu 3073 df-rmo 3074 df-rab 3075 df-v 3433 df-sbc 3721 df-csb 3838 df-dif 3895 df-un 3897 df-in 3899 df-ss 3909 df-pss 3911 df-nul 4263 df-if 4466 df-pw 4541 df-sn 4568 df-pr 4570 df-tp 4572 df-op 4574 df-uni 4846 df-int 4886 df-iun 4932 df-disj 5045 df-br 5080 df-opab 5142 df-mpt 5163 df-tr 5197 df-id 5489 df-eprel 5495 df-po 5503 df-so 5504 df-fr 5544 df-se 5545 df-we 5546 df-xp 5595 df-rel 5596 df-cnv 5597 df-co 5598 df-dm 5599 df-rn 5600 df-res 5601 df-ima 5602 df-pred 6200 df-ord 6267 df-on 6268 df-lim 6269 df-suc 6270 df-iota 6389 df-fun 6433 df-fn 6434 df-f 6435 df-f1 6436 df-fo 6437 df-f1o 6438 df-fv 6439 df-isom 6440 df-riota 7226 df-ov 7272 df-oprab 7273 df-mpo 7274 df-om 7702 df-1st 7818 df-2nd 7819 df-frecs 8082 df-wrecs 8113 df-recs 8187 df-rdg 8226 df-1o 8282 df-2o 8283 df-oadd 8286 df-er 8473 df-map 8592 df-en 8709 df-dom 8710 df-sdom 8711 df-fin 8712 df-sup 9171 df-inf 9172 df-oi 9239 df-dju 9652 df-card 9690 df-pnf 11004 df-mnf 11005 df-xr 11006 df-ltxr 11007 df-le 11008 df-sub 11199 df-neg 11200 df-div 11625 df-nn 11966 df-2 12028 df-3 12029 df-n0 12226 df-xnn0 12298 df-z 12312 df-uz 12574 df-rp 12722 df-fz 13231 df-fzo 13374 df-fl 13502 df-mod 13580 df-seq 13712 df-exp 13773 df-hash 14035 df-word 14208 df-concat 14264 df-substr 14344 df-pfx 14374 df-reps 14472 df-csh 14492 df-cj 14800 df-re 14801 df-im 14802 df-sqrt 14936 df-abs 14937 df-clim 15187 df-sum 15388 df-dvds 15954 df-gcd 16192 df-prm 16367 df-phi 16457 |
This theorem is referenced by: hashecclwwlkn1 28429 |
Copyright terms: Public domain | W3C validator |