Proof of Theorem cshwmodn
Step | Hyp | Ref
| Expression |
1 | | 0csh0 14434 |
. . . 4
⊢ (∅
cyclShift 𝑁) =
∅ |
2 | | oveq1 7262 |
. . . 4
⊢ (𝑊 = ∅ → (𝑊 cyclShift 𝑁) = (∅ cyclShift 𝑁)) |
3 | | oveq1 7262 |
. . . . 5
⊢ (𝑊 = ∅ → (𝑊 cyclShift (𝑁 mod (♯‘𝑊))) = (∅ cyclShift (𝑁 mod (♯‘𝑊)))) |
4 | | 0csh0 14434 |
. . . . 5
⊢ (∅
cyclShift (𝑁 mod
(♯‘𝑊))) =
∅ |
5 | 3, 4 | eqtrdi 2795 |
. . . 4
⊢ (𝑊 = ∅ → (𝑊 cyclShift (𝑁 mod (♯‘𝑊))) = ∅) |
6 | 1, 2, 5 | 3eqtr4a 2805 |
. . 3
⊢ (𝑊 = ∅ → (𝑊 cyclShift 𝑁) = (𝑊 cyclShift (𝑁 mod (♯‘𝑊)))) |
7 | 6 | a1d 25 |
. 2
⊢ (𝑊 = ∅ → ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = (𝑊 cyclShift (𝑁 mod (♯‘𝑊))))) |
8 | | lennncl 14165 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (♯‘𝑊) ∈
ℕ) |
9 | 8 | ex 412 |
. . . . . . 7
⊢ (𝑊 ∈ Word 𝑉 → (𝑊 ≠ ∅ → (♯‘𝑊) ∈
ℕ)) |
10 | 9 | adantr 480 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ) → (𝑊 ≠ ∅ → (♯‘𝑊) ∈
ℕ)) |
11 | 10 | impcom 407 |
. . . . 5
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) →
(♯‘𝑊) ∈
ℕ) |
12 | | simprr 769 |
. . . . 5
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → 𝑁 ∈ ℤ) |
13 | | zre 12253 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℝ) |
14 | | nnrp 12670 |
. . . . . . . . 9
⊢
((♯‘𝑊)
∈ ℕ → (♯‘𝑊) ∈
ℝ+) |
15 | | modabs2 13553 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℝ ∧
(♯‘𝑊) ∈
ℝ+) → ((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)) = (𝑁 mod (♯‘𝑊))) |
16 | 13, 14, 15 | syl2anr 596 |
. . . . . . . 8
⊢
(((♯‘𝑊)
∈ ℕ ∧ 𝑁
∈ ℤ) → ((𝑁
mod (♯‘𝑊)) mod
(♯‘𝑊)) = (𝑁 mod (♯‘𝑊))) |
17 | 16 | opeq1d 4807 |
. . . . . . 7
⊢
(((♯‘𝑊)
∈ ℕ ∧ 𝑁
∈ ℤ) → 〈((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)), (♯‘𝑊)〉 = 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) |
18 | 17 | oveq2d 7271 |
. . . . . 6
⊢
(((♯‘𝑊)
∈ ℕ ∧ 𝑁
∈ ℤ) → (𝑊
substr 〈((𝑁 mod
(♯‘𝑊)) mod
(♯‘𝑊)),
(♯‘𝑊)〉) =
(𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉)) |
19 | 16 | oveq2d 7271 |
. . . . . 6
⊢
(((♯‘𝑊)
∈ ℕ ∧ 𝑁
∈ ℤ) → (𝑊
prefix ((𝑁 mod
(♯‘𝑊)) mod
(♯‘𝑊))) =
(𝑊 prefix (𝑁 mod (♯‘𝑊)))) |
20 | 18, 19 | oveq12d 7273 |
. . . . 5
⊢
(((♯‘𝑊)
∈ ℕ ∧ 𝑁
∈ ℤ) → ((𝑊
substr 〈((𝑁 mod
(♯‘𝑊)) mod
(♯‘𝑊)),
(♯‘𝑊)〉) ++
(𝑊 prefix ((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
21 | 11, 12, 20 | syl2anc 583 |
. . . 4
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → ((𝑊 substr 〈((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix ((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)))) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
22 | | simprl 767 |
. . . . 5
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → 𝑊 ∈ Word 𝑉) |
23 | 12, 11 | zmodcld 13540 |
. . . . . 6
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → (𝑁 mod (♯‘𝑊)) ∈
ℕ0) |
24 | 23 | nn0zd 12353 |
. . . . 5
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → (𝑁 mod (♯‘𝑊)) ∈ ℤ) |
25 | | cshword 14432 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ (𝑁 mod (♯‘𝑊)) ∈ ℤ) → (𝑊 cyclShift (𝑁 mod (♯‘𝑊))) = ((𝑊 substr 〈((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix ((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊))))) |
26 | 22, 24, 25 | syl2anc 583 |
. . . 4
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → (𝑊 cyclShift (𝑁 mod (♯‘𝑊))) = ((𝑊 substr 〈((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix ((𝑁 mod (♯‘𝑊)) mod (♯‘𝑊))))) |
27 | | cshword 14432 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
28 | 27 | adantl 481 |
. . . 4
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → (𝑊 cyclShift 𝑁) = ((𝑊 substr 〈(𝑁 mod (♯‘𝑊)), (♯‘𝑊)〉) ++ (𝑊 prefix (𝑁 mod (♯‘𝑊))))) |
29 | 21, 26, 28 | 3eqtr4rd 2789 |
. . 3
⊢ ((𝑊 ≠ ∅ ∧ (𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ)) → (𝑊 cyclShift 𝑁) = (𝑊 cyclShift (𝑁 mod (♯‘𝑊)))) |
30 | 29 | ex 412 |
. 2
⊢ (𝑊 ≠ ∅ → ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = (𝑊 cyclShift (𝑁 mod (♯‘𝑊))))) |
31 | 7, 30 | pm2.61ine 3027 |
1
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑁 ∈ ℤ) → (𝑊 cyclShift 𝑁) = (𝑊 cyclShift (𝑁 mod (♯‘𝑊)))) |