MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  2cshwcshw Structured version   Visualization version   GIF version

Theorem 2cshwcshw 13856
Description: If a word is a cyclically shifted word, and a second word is the result of cyclically shifting the same word, then the second word is the result of cyclically shifting the first word. (Contributed by AV, 11-May-2018.) (Revised by AV, 12-Jun-2018.) (Proof shortened by AV, 3-Nov-2018.)
Assertion
Ref Expression
2cshwcshw ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → ((𝐾 ∈ (0...𝑁) ∧ 𝑋 = (𝑌 cyclShift 𝐾) ∧ ∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
Distinct variable groups:   𝑚,𝑛,𝐾   𝑚,𝑁,𝑛   𝑚,𝑉,𝑛   𝑚,𝑋,𝑛   𝑚,𝑌,𝑛   𝑚,𝑍,𝑛

Proof of Theorem 2cshwcshw
StepHypRef Expression
1 difelfznle 12661 . . . . . . . . . . . . . . . . . . 19 ((𝐾 ∈ (0...𝑁) ∧ 𝑚 ∈ (0...𝑁) ∧ ¬ 𝐾𝑚) → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁))
213exp 1148 . . . . . . . . . . . . . . . . . 18 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → (¬ 𝐾𝑚 → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁))))
32ad2antrr 717 . . . . . . . . . . . . . . . . 17 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑚 ∈ (0...𝑁) → (¬ 𝐾𝑚 → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁))))
43imp 395 . . . . . . . . . . . . . . . 16 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) → (¬ 𝐾𝑚 → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁)))
54adantr 472 . . . . . . . . . . . . . . 15 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → (¬ 𝐾𝑚 → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁)))
65com12 32 . . . . . . . . . . . . . 14 𝐾𝑚 → (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁)))
76adantl 473 . . . . . . . . . . . . 13 ((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) → (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁)))
87imp 395 . . . . . . . . . . . 12 (((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → ((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁))
9 simprl 787 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → 𝑌 ∈ Word 𝑉)
109ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → 𝑌 ∈ Word 𝑉)
11 elfzelz 12549 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐾 ∈ (0...𝑁) → 𝐾 ∈ ℤ)
1211adantr 472 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → 𝐾 ∈ ℤ)
1312ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → 𝐾 ∈ ℤ)
14 elfz2 12540 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (𝐾 ∈ (0...𝑁) ↔ ((0 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) ∧ (0 ≤ 𝐾𝐾𝑁)))
15 zaddcl 11664 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ((𝑚 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑚 + 𝑁) ∈ ℤ)
1615adantrr 708 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ((𝑚 ∈ ℤ ∧ (𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ)) → (𝑚 + 𝑁) ∈ ℤ)
17 simprr 789 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ((𝑚 ∈ ℤ ∧ (𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ)) → 𝐾 ∈ ℤ)
1816, 17zsubcld 11734 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 ((𝑚 ∈ ℤ ∧ (𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ)) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ)
1918ex 401 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑚 ∈ ℤ → ((𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
20 elfzelz 12549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑚 ∈ (0...𝑁) → 𝑚 ∈ ℤ)
2119, 20syl11 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝑚 ∈ (0...𝑁) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
22213adant1 1160 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((0 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝑚 ∈ (0...𝑁) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
2322adantr 472 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (((0 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) ∧ (0 ≤ 𝐾𝐾𝑁)) → (𝑚 ∈ (0...𝑁) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
2414, 23sylbi 208 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
2524ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . . 25 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑚 ∈ (0...𝑁) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ))
2625imp 395 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → ((𝑚 + 𝑁) − 𝐾) ∈ ℤ)
27 2cshw 13844 . . . . . . . . . . . . . . . . . . . . . . . 24 ((𝑌 ∈ Word 𝑉𝐾 ∈ ℤ ∧ ((𝑚 + 𝑁) − 𝐾) ∈ ℤ) → ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)) = (𝑌 cyclShift (𝐾 + ((𝑚 + 𝑁) − 𝐾))))
2810, 13, 26, 27syl3anc 1490 . . . . . . . . . . . . . . . . . . . . . . 23 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)) = (𝑌 cyclShift (𝐾 + ((𝑚 + 𝑁) − 𝐾))))
2917, 18zaddcld 11733 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 ((𝑚 ∈ ℤ ∧ (𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ)) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ)
3029ex 401 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑚 ∈ ℤ → ((𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
3130, 20syl11 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝑚 ∈ (0...𝑁) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
32313adant1 1160 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((0 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝑚 ∈ (0...𝑁) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
3332adantr 472 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (((0 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝐾 ∈ ℤ) ∧ (0 ≤ 𝐾𝐾𝑁)) → (𝑚 ∈ (0...𝑁) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
3414, 33sylbi 208 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
3534ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . . 25 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑚 ∈ (0...𝑁) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ))
3635imp 395 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ)
37 cshwsublen 13823 . . . . . . . . . . . . . . . . . . . . . . . 24 ((𝑌 ∈ Word 𝑉 ∧ (𝐾 + ((𝑚 + 𝑁) − 𝐾)) ∈ ℤ) → (𝑌 cyclShift (𝐾 + ((𝑚 + 𝑁) − 𝐾))) = (𝑌 cyclShift ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌))))
3810, 36, 37syl2anc 579 . . . . . . . . . . . . . . . . . . . . . . 23 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → (𝑌 cyclShift (𝐾 + ((𝑚 + 𝑁) − 𝐾))) = (𝑌 cyclShift ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌))))
3928, 38eqtrd 2799 . . . . . . . . . . . . . . . . . . . . . 22 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)) = (𝑌 cyclShift ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌))))
40 elfz2nn0 12638 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 (𝐾 ∈ (0...𝑁) ↔ (𝐾 ∈ ℕ0𝑁 ∈ ℕ0𝐾𝑁))
41 nn0cn 11549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 (𝑚 ∈ ℕ0𝑚 ∈ ℂ)
42 nn0cn 11549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 (𝐾 ∈ ℕ0𝐾 ∈ ℂ)
43 nn0cn 11549 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 (𝑁 ∈ ℕ0𝑁 ∈ ℂ)
4442, 43anim12i 606 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ((𝐾 ∈ ℕ0𝑁 ∈ ℕ0) → (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ))
45 simprl 787 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → 𝐾 ∈ ℂ)
46 addcl 10271 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 ((𝑚 ∈ ℂ ∧ 𝑁 ∈ ℂ) → (𝑚 + 𝑁) ∈ ℂ)
4746adantrl 707 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → (𝑚 + 𝑁) ∈ ℂ)
4845, 47pncan3d 10649 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → (𝐾 + ((𝑚 + 𝑁) − 𝐾)) = (𝑚 + 𝑁))
4948oveq1d 6857 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = ((𝑚 + 𝑁) − 𝑁))
50 pncan 10541 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 ((𝑚 ∈ ℂ ∧ 𝑁 ∈ ℂ) → ((𝑚 + 𝑁) − 𝑁) = 𝑚)
5150adantrl 707 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → ((𝑚 + 𝑁) − 𝑁) = 𝑚)
5249, 51eqtrd 2799 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ((𝑚 ∈ ℂ ∧ (𝐾 ∈ ℂ ∧ 𝑁 ∈ ℂ)) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚)
5341, 44, 52syl2an 589 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 ((𝑚 ∈ ℕ0 ∧ (𝐾 ∈ ℕ0𝑁 ∈ ℕ0)) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚)
5453ex 401 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑚 ∈ ℕ0 → ((𝐾 ∈ ℕ0𝑁 ∈ ℕ0) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
55 elfznn0 12640 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 (𝑚 ∈ (0...𝑁) → 𝑚 ∈ ℕ0)
5654, 55syl11 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝐾 ∈ ℕ0𝑁 ∈ ℕ0) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
57563adant3 1162 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝐾 ∈ ℕ0𝑁 ∈ ℕ0𝐾𝑁) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
5840, 57sylbi 208 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
5958adantr 472 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
60 oveq2 6850 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 ((♯‘𝑌) = 𝑁 → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁))
6160eqeq1d 2767 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((♯‘𝑌) = 𝑁 → (((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚 ↔ ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚))
6261imbi2d 331 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((♯‘𝑌) = 𝑁 → ((𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚) ↔ (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚)))
6362adantl 473 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → ((𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚) ↔ (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚)))
6463adantl 473 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ((𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚) ↔ (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − 𝑁) = 𝑚)))
6559, 64mpbird 248 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚))
6665adantr 472 . . . . . . . . . . . . . . . . . . . . . . . 24 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑚 ∈ (0...𝑁) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚))
6766imp 395 . . . . . . . . . . . . . . . . . . . . . . 23 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌)) = 𝑚)
6867oveq2d 6858 . . . . . . . . . . . . . . . . . . . . . 22 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → (𝑌 cyclShift ((𝐾 + ((𝑚 + 𝑁) − 𝐾)) − (♯‘𝑌))) = (𝑌 cyclShift 𝑚))
6939, 68eqtr2d 2800 . . . . . . . . . . . . . . . . . . . . 21 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) → (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)))
7069adantr 472 . . . . . . . . . . . . . . . . . . . 20 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)))
71 oveq1 6849 . . . . . . . . . . . . . . . . . . . . 21 (𝑋 = (𝑌 cyclShift 𝐾) → (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)) = ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)))
7271adantl 473 . . . . . . . . . . . . . . . . . . . 20 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)) = ((𝑌 cyclShift 𝐾) cyclShift ((𝑚 + 𝑁) − 𝐾)))
7370, 72eqtr4d 2802 . . . . . . . . . . . . . . . . . . 19 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑌 cyclShift 𝑚) = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)))
7473exp41 425 . . . . . . . . . . . . . . . . . 18 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) → (𝑚 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑌 cyclShift 𝑚) = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))))))
7574com24 95 . . . . . . . . . . . . . . . . 17 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑚 ∈ (0...𝑁) → ((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) → (𝑌 cyclShift 𝑚) = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))))))
7675imp41 416 . . . . . . . . . . . . . . . 16 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑌 cyclShift 𝑚) = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)))
7776eqeq2d 2775 . . . . . . . . . . . . . . 15 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑍 = (𝑌 cyclShift 𝑚) ↔ 𝑍 = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))))
7877biimpd 220 . . . . . . . . . . . . . 14 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ (¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚)) → (𝑍 = (𝑌 cyclShift 𝑚) → 𝑍 = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))))
7978impancom 443 . . . . . . . . . . . . 13 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) → 𝑍 = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))))
8079impcom 396 . . . . . . . . . . . 12 (((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → 𝑍 = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)))
81 oveq2 6850 . . . . . . . . . . . . 13 (𝑛 = ((𝑚 + 𝑁) − 𝐾) → (𝑋 cyclShift 𝑛) = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾)))
8281rspceeqv 3479 . . . . . . . . . . . 12 ((((𝑚 + 𝑁) − 𝐾) ∈ (0...𝑁) ∧ 𝑍 = (𝑋 cyclShift ((𝑚 + 𝑁) − 𝐾))) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
838, 80, 82syl2anc 579 . . . . . . . . . . 11 (((¬ 𝑚 = 0 ∧ ¬ 𝐾𝑚) ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
8483exp31 410 . . . . . . . . . 10 𝑚 = 0 → (¬ 𝐾𝑚 → (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))
85 oveq2 6850 . . . . . . . . . . . . . . . 16 (𝑚 = 0 → (𝑌 cyclShift 𝑚) = (𝑌 cyclShift 0))
8685eqeq2d 2775 . . . . . . . . . . . . . . 15 (𝑚 = 0 → (𝑍 = (𝑌 cyclShift 𝑚) ↔ 𝑍 = (𝑌 cyclShift 0)))
87 cshw0 13819 . . . . . . . . . . . . . . . . . . . . . 22 (𝑌 ∈ Word 𝑉 → (𝑌 cyclShift 0) = 𝑌)
8887adantr 472 . . . . . . . . . . . . . . . . . . . . 21 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝑌 cyclShift 0) = 𝑌)
8988eqeq2d 2775 . . . . . . . . . . . . . . . . . . . 20 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝑍 = (𝑌 cyclShift 0) ↔ 𝑍 = 𝑌))
90 fznn0sub2 12654 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 (𝐾 ∈ (0...𝑁) → (𝑁𝐾) ∈ (0...𝑁))
9190adantl 473 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) → (𝑁𝐾) ∈ (0...𝑁))
92 oveq1 6849 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((♯‘𝑌) = 𝑁 → ((♯‘𝑌) − 𝐾) = (𝑁𝐾))
9392eleq1d 2829 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((♯‘𝑌) = 𝑁 → (((♯‘𝑌) − 𝐾) ∈ (0...𝑁) ↔ (𝑁𝐾) ∈ (0...𝑁)))
9493ad2antlr 718 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) → (((♯‘𝑌) − 𝐾) ∈ (0...𝑁) ↔ (𝑁𝐾) ∈ (0...𝑁)))
9591, 94mpbird 248 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) → ((♯‘𝑌) − 𝐾) ∈ (0...𝑁))
9695adantr 472 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → ((♯‘𝑌) − 𝐾) ∈ (0...𝑁))
97 oveq1 6849 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (𝑋 = (𝑌 cyclShift 𝐾) → (𝑋 cyclShift ((♯‘𝑌) − 𝐾)) = ((𝑌 cyclShift 𝐾) cyclShift ((♯‘𝑌) − 𝐾)))
98 simpl 474 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → 𝑌 ∈ Word 𝑉)
99 2cshwid 13845 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑌 ∈ Word 𝑉𝐾 ∈ ℤ) → ((𝑌 cyclShift 𝐾) cyclShift ((♯‘𝑌) − 𝐾)) = 𝑌)
10098, 11, 99syl2an 589 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) → ((𝑌 cyclShift 𝐾) cyclShift ((♯‘𝑌) − 𝐾)) = 𝑌)
10197, 100sylan9eqr 2821 . . . . . . . . . . . . . . . . . . . . . . . . . 26 ((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑋 cyclShift ((♯‘𝑌) − 𝐾)) = 𝑌)
102101eqcomd 2771 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → 𝑌 = (𝑋 cyclShift ((♯‘𝑌) − 𝐾)))
103 oveq2 6850 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝑛 = ((♯‘𝑌) − 𝐾) → (𝑋 cyclShift 𝑛) = (𝑋 cyclShift ((♯‘𝑌) − 𝐾)))
104103rspceeqv 3479 . . . . . . . . . . . . . . . . . . . . . . . . 25 ((((♯‘𝑌) − 𝐾) ∈ (0...𝑁) ∧ 𝑌 = (𝑋 cyclShift ((♯‘𝑌) − 𝐾))) → ∃𝑛 ∈ (0...𝑁)𝑌 = (𝑋 cyclShift 𝑛))
10596, 102, 104syl2anc 579 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → ∃𝑛 ∈ (0...𝑁)𝑌 = (𝑋 cyclShift 𝑛))
106105adantr 472 . . . . . . . . . . . . . . . . . . . . . . 23 (((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑍 = 𝑌) → ∃𝑛 ∈ (0...𝑁)𝑌 = (𝑋 cyclShift 𝑛))
107 eqeq1 2769 . . . . . . . . . . . . . . . . . . . . . . . . 25 (𝑍 = 𝑌 → (𝑍 = (𝑋 cyclShift 𝑛) ↔ 𝑌 = (𝑋 cyclShift 𝑛)))
108107rexbidv 3199 . . . . . . . . . . . . . . . . . . . . . . . 24 (𝑍 = 𝑌 → (∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛) ↔ ∃𝑛 ∈ (0...𝑁)𝑌 = (𝑋 cyclShift 𝑛)))
109108adantl 473 . . . . . . . . . . . . . . . . . . . . . . 23 (((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑍 = 𝑌) → (∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛) ↔ ∃𝑛 ∈ (0...𝑁)𝑌 = (𝑋 cyclShift 𝑛)))
110106, 109mpbird 248 . . . . . . . . . . . . . . . . . . . . . 22 (((((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) ∧ 𝐾 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑍 = 𝑌) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
111110exp41 425 . . . . . . . . . . . . . . . . . . . . 21 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝐾 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑍 = 𝑌 → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
112111com24 95 . . . . . . . . . . . . . . . . . . . 20 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝑍 = 𝑌 → (𝑋 = (𝑌 cyclShift 𝐾) → (𝐾 ∈ (0...𝑁) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
11389, 112sylbid 231 . . . . . . . . . . . . . . . . . . 19 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝑍 = (𝑌 cyclShift 0) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝐾 ∈ (0...𝑁) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
114113com24 95 . . . . . . . . . . . . . . . . . 18 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (𝐾 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑍 = (𝑌 cyclShift 0) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
115114impcom 396 . . . . . . . . . . . . . . . . 17 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑍 = (𝑌 cyclShift 0) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))
116115com13 88 . . . . . . . . . . . . . . . 16 (𝑍 = (𝑌 cyclShift 0) → (𝑋 = (𝑌 cyclShift 𝐾) → ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))
117116a1d 25 . . . . . . . . . . . . . . 15 (𝑍 = (𝑌 cyclShift 0) → (𝑚 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
11886, 117syl6bi 244 . . . . . . . . . . . . . 14 (𝑚 = 0 → (𝑍 = (𝑌 cyclShift 𝑚) → (𝑚 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))))
119118com24 95 . . . . . . . . . . . . 13 (𝑚 = 0 → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑚 ∈ (0...𝑁) → (𝑍 = (𝑌 cyclShift 𝑚) → ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))))
120119com15 101 . . . . . . . . . . . 12 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑚 ∈ (0...𝑁) → (𝑍 = (𝑌 cyclShift 𝑚) → (𝑚 = 0 → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))))
121120imp41 416 . . . . . . . . . . 11 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → (𝑚 = 0 → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
122121com12 32 . . . . . . . . . 10 (𝑚 = 0 → (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
123 difelfzle 12660 . . . . . . . . . . . . . . . . 17 ((𝐾 ∈ (0...𝑁) ∧ 𝑚 ∈ (0...𝑁) ∧ 𝐾𝑚) → (𝑚𝐾) ∈ (0...𝑁))
1241233exp 1148 . . . . . . . . . . . . . . . 16 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → (𝐾𝑚 → (𝑚𝐾) ∈ (0...𝑁))))
125124ad2antrr 717 . . . . . . . . . . . . . . 15 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑚 ∈ (0...𝑁) → (𝐾𝑚 → (𝑚𝐾) ∈ (0...𝑁))))
126125imp 395 . . . . . . . . . . . . . 14 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) → (𝐾𝑚 → (𝑚𝐾) ∈ (0...𝑁)))
127126adantr 472 . . . . . . . . . . . . 13 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → (𝐾𝑚 → (𝑚𝐾) ∈ (0...𝑁)))
128127impcom 396 . . . . . . . . . . . 12 ((𝐾𝑚 ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → (𝑚𝐾) ∈ (0...𝑁))
1299ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → 𝑌 ∈ Word 𝑉)
13012ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → 𝐾 ∈ ℤ)
131 zsubcl 11666 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑚 ∈ ℤ ∧ 𝐾 ∈ ℤ) → (𝑚𝐾) ∈ ℤ)
132131ex 401 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (𝑚 ∈ ℤ → (𝐾 ∈ ℤ → (𝑚𝐾) ∈ ℤ))
13320, 11, 132syl2imc 41 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → (𝑚𝐾) ∈ ℤ))
134133ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . . 25 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) → (𝑚 ∈ (0...𝑁) → (𝑚𝐾) ∈ ℤ))
135134imp 395 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → (𝑚𝐾) ∈ ℤ)
136 2cshw 13844 . . . . . . . . . . . . . . . . . . . . . . . 24 ((𝑌 ∈ Word 𝑉𝐾 ∈ ℤ ∧ (𝑚𝐾) ∈ ℤ) → ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾)) = (𝑌 cyclShift (𝐾 + (𝑚𝐾))))
137129, 130, 135, 136syl3anc 1490 . . . . . . . . . . . . . . . . . . . . . . 23 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾)) = (𝑌 cyclShift (𝐾 + (𝑚𝐾))))
138 zcn 11629 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 (𝐾 ∈ ℤ → 𝐾 ∈ ℂ)
13920zcnd 11730 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 (𝑚 ∈ (0...𝑁) → 𝑚 ∈ ℂ)
140 pncan3 10543 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ((𝐾 ∈ ℂ ∧ 𝑚 ∈ ℂ) → (𝐾 + (𝑚𝐾)) = 𝑚)
141138, 139, 140syl2anr 590 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ((𝑚 ∈ (0...𝑁) ∧ 𝐾 ∈ ℤ) → (𝐾 + (𝑚𝐾)) = 𝑚)
142141ex 401 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 (𝑚 ∈ (0...𝑁) → (𝐾 ∈ ℤ → (𝐾 + (𝑚𝐾)) = 𝑚))
14311, 142syl5com 31 . . . . . . . . . . . . . . . . . . . . . . . . . 26 (𝐾 ∈ (0...𝑁) → (𝑚 ∈ (0...𝑁) → (𝐾 + (𝑚𝐾)) = 𝑚))
144143ad2antrr 717 . . . . . . . . . . . . . . . . . . . . . . . . 25 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) → (𝑚 ∈ (0...𝑁) → (𝐾 + (𝑚𝐾)) = 𝑚))
145144imp 395 . . . . . . . . . . . . . . . . . . . . . . . 24 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → (𝐾 + (𝑚𝐾)) = 𝑚)
146145oveq2d 6858 . . . . . . . . . . . . . . . . . . . . . . 23 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → (𝑌 cyclShift (𝐾 + (𝑚𝐾))) = (𝑌 cyclShift 𝑚))
147137, 146eqtr2d 2800 . . . . . . . . . . . . . . . . . . . . . 22 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) → (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾)))
148147adantr 472 . . . . . . . . . . . . . . . . . . . . 21 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾)))
149 oveq1 6849 . . . . . . . . . . . . . . . . . . . . . . 23 (𝑋 = (𝑌 cyclShift 𝐾) → (𝑋 cyclShift (𝑚𝐾)) = ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾)))
150149eqeq2d 2775 . . . . . . . . . . . . . . . . . . . . . 22 (𝑋 = (𝑌 cyclShift 𝐾) → ((𝑌 cyclShift 𝑚) = (𝑋 cyclShift (𝑚𝐾)) ↔ (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾))))
151150adantl 473 . . . . . . . . . . . . . . . . . . . . 21 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → ((𝑌 cyclShift 𝑚) = (𝑋 cyclShift (𝑚𝐾)) ↔ (𝑌 cyclShift 𝑚) = ((𝑌 cyclShift 𝐾) cyclShift (𝑚𝐾))))
152148, 151mpbird 248 . . . . . . . . . . . . . . . . . . . 20 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑌 cyclShift 𝑚) = (𝑋 cyclShift (𝑚𝐾)))
153152eqeq2d 2775 . . . . . . . . . . . . . . . . . . 19 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑍 = (𝑌 cyclShift 𝑚) ↔ 𝑍 = (𝑋 cyclShift (𝑚𝐾))))
154153biimpd 220 . . . . . . . . . . . . . . . . . 18 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝐾𝑚) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (𝑍 = (𝑌 cyclShift 𝑚) → 𝑍 = (𝑋 cyclShift (𝑚𝐾))))
155154exp41 425 . . . . . . . . . . . . . . . . 17 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝐾𝑚 → (𝑚 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑍 = (𝑌 cyclShift 𝑚) → 𝑍 = (𝑋 cyclShift (𝑚𝐾)))))))
156155com24 95 . . . . . . . . . . . . . . . 16 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑋 = (𝑌 cyclShift 𝐾) → (𝑚 ∈ (0...𝑁) → (𝐾𝑚 → (𝑍 = (𝑌 cyclShift 𝑚) → 𝑍 = (𝑋 cyclShift (𝑚𝐾)))))))
157156imp31 408 . . . . . . . . . . . . . . 15 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) → (𝐾𝑚 → (𝑍 = (𝑌 cyclShift 𝑚) → 𝑍 = (𝑋 cyclShift (𝑚𝐾)))))
158157com23 86 . . . . . . . . . . . . . 14 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) → (𝑍 = (𝑌 cyclShift 𝑚) → (𝐾𝑚𝑍 = (𝑋 cyclShift (𝑚𝐾)))))
159158imp 395 . . . . . . . . . . . . 13 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → (𝐾𝑚𝑍 = (𝑋 cyclShift (𝑚𝐾))))
160159impcom 396 . . . . . . . . . . . 12 ((𝐾𝑚 ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → 𝑍 = (𝑋 cyclShift (𝑚𝐾)))
161 oveq2 6850 . . . . . . . . . . . . 13 (𝑛 = (𝑚𝐾) → (𝑋 cyclShift 𝑛) = (𝑋 cyclShift (𝑚𝐾)))
162161rspceeqv 3479 . . . . . . . . . . . 12 (((𝑚𝐾) ∈ (0...𝑁) ∧ 𝑍 = (𝑋 cyclShift (𝑚𝐾))) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
163128, 160, 162syl2anc 579 . . . . . . . . . . 11 ((𝐾𝑚 ∧ ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚))) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
164163ex 401 . . . . . . . . . 10 (𝐾𝑚 → (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
16584, 122, 164pm2.61ii 177 . . . . . . . . 9 (((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) ∧ 𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))
166165ex 401 . . . . . . . 8 ((((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) ∧ 𝑚 ∈ (0...𝑁)) → (𝑍 = (𝑌 cyclShift 𝑚) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
167166rexlimdva 3178 . . . . . . 7 (((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) ∧ 𝑋 = (𝑌 cyclShift 𝐾)) → (∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
168167ex 401 . . . . . 6 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (𝑋 = (𝑌 cyclShift 𝐾) → (∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))
169168com23 86 . . . . 5 ((𝐾 ∈ (0...𝑁) ∧ (𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁)) → (∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚) → (𝑋 = (𝑌 cyclShift 𝐾) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛))))
170169ex 401 . . . 4 (𝐾 ∈ (0...𝑁) → ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → (∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚) → (𝑋 = (𝑌 cyclShift 𝐾) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
171170com24 95 . . 3 (𝐾 ∈ (0...𝑁) → (𝑋 = (𝑌 cyclShift 𝐾) → (∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚) → ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))))
1721713imp 1137 . 2 ((𝐾 ∈ (0...𝑁) ∧ 𝑋 = (𝑌 cyclShift 𝐾) ∧ ∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚)) → ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
173172com12 32 1 ((𝑌 ∈ Word 𝑉 ∧ (♯‘𝑌) = 𝑁) → ((𝐾 ∈ (0...𝑁) ∧ 𝑋 = (𝑌 cyclShift 𝐾) ∧ ∃𝑚 ∈ (0...𝑁)𝑍 = (𝑌 cyclShift 𝑚)) → ∃𝑛 ∈ (0...𝑁)𝑍 = (𝑋 cyclShift 𝑛)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 197  wa 384  w3a 1107   = wceq 1652  wcel 2155  wrex 3056   class class class wbr 4809  cfv 6068  (class class class)co 6842  cc 10187  0cc0 10189   + caddc 10192  cle 10329  cmin 10520  0cn0 11538  cz 11624  ...cfz 12533  chash 13321  Word cword 13486   cyclShift ccsh 13812
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1890  ax-4 1904  ax-5 2005  ax-6 2069  ax-7 2105  ax-8 2157  ax-9 2164  ax-10 2183  ax-11 2198  ax-12 2211  ax-13 2352  ax-ext 2743  ax-rep 4930  ax-sep 4941  ax-nul 4949  ax-pow 5001  ax-pr 5062  ax-un 7147  ax-cnex 10245  ax-resscn 10246  ax-1cn 10247  ax-icn 10248  ax-addcl 10249  ax-addrcl 10250  ax-mulcl 10251  ax-mulrcl 10252  ax-mulcom 10253  ax-addass 10254  ax-mulass 10255  ax-distr 10256  ax-i2m1 10257  ax-1ne0 10258  ax-1rid 10259  ax-rnegex 10260  ax-rrecex 10261  ax-cnre 10262  ax-pre-lttri 10263  ax-pre-lttrn 10264  ax-pre-ltadd 10265  ax-pre-mulgt0 10266  ax-pre-sup 10267
This theorem depends on definitions:  df-bi 198  df-an 385  df-or 874  df-3or 1108  df-3an 1109  df-tru 1656  df-ex 1875  df-nf 1879  df-sb 2062  df-mo 2565  df-eu 2582  df-clab 2752  df-cleq 2758  df-clel 2761  df-nfc 2896  df-ne 2938  df-nel 3041  df-ral 3060  df-rex 3061  df-reu 3062  df-rmo 3063  df-rab 3064  df-v 3352  df-sbc 3597  df-csb 3692  df-dif 3735  df-un 3737  df-in 3739  df-ss 3746  df-pss 3748  df-nul 4080  df-if 4244  df-pw 4317  df-sn 4335  df-pr 4337  df-tp 4339  df-op 4341  df-uni 4595  df-int 4634  df-iun 4678  df-br 4810  df-opab 4872  df-mpt 4889  df-tr 4912  df-id 5185  df-eprel 5190  df-po 5198  df-so 5199  df-fr 5236  df-we 5238  df-xp 5283  df-rel 5284  df-cnv 5285  df-co 5286  df-dm 5287  df-rn 5288  df-res 5289  df-ima 5290  df-pred 5865  df-ord 5911  df-on 5912  df-lim 5913  df-suc 5914  df-iota 6031  df-fun 6070  df-fn 6071  df-f 6072  df-f1 6073  df-fo 6074  df-f1o 6075  df-fv 6076  df-riota 6803  df-ov 6845  df-oprab 6846  df-mpt2 6847  df-om 7264  df-1st 7366  df-2nd 7367  df-wrecs 7610  df-recs 7672  df-rdg 7710  df-1o 7764  df-oadd 7768  df-er 7947  df-en 8161  df-dom 8162  df-sdom 8163  df-fin 8164  df-sup 8555  df-inf 8556  df-card 9016  df-pnf 10330  df-mnf 10331  df-xr 10332  df-ltxr 10333  df-le 10334  df-sub 10522  df-neg 10523  df-div 10939  df-nn 11275  df-2 11335  df-n0 11539  df-z 11625  df-uz 11887  df-rp 12029  df-fz 12534  df-fzo 12674  df-fl 12801  df-mod 12877  df-hash 13322  df-word 13487  df-concat 13542  df-substr 13617  df-pfx 13662  df-csh 13813
This theorem is referenced by:  eleclclwwlknlem1  27274
  Copyright terms: Public domain W3C validator