Proof of Theorem swrdrevpfx
Step | Hyp | Ref
| Expression |
1 | | fznn0sub2 13363 |
. . . . . 6
⊢ (𝐹 ∈ (0...𝐿) → (𝐿 − 𝐹) ∈ (0...𝐿)) |
2 | | pfxcl 14390 |
. . . . . . . . 9
⊢ (𝑊 ∈ Word 𝑉 → (𝑊 prefix 𝐿) ∈ Word 𝑉) |
3 | | revcl 14474 |
. . . . . . . . 9
⊢ ((𝑊 prefix 𝐿) ∈ Word 𝑉 → (reverse‘(𝑊 prefix 𝐿)) ∈ Word 𝑉) |
4 | 2, 3 | syl 17 |
. . . . . . . 8
⊢ (𝑊 ∈ Word 𝑉 → (reverse‘(𝑊 prefix 𝐿)) ∈ Word 𝑉) |
5 | 4 | 3ad2ant1 1132 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) → (reverse‘(𝑊 prefix 𝐿)) ∈ Word 𝑉) |
6 | | simp3 1137 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) → (𝐿 − 𝐹) ∈ (0...𝐿)) |
7 | | revlen 14475 |
. . . . . . . . . . . . 13
⊢ ((𝑊 prefix 𝐿) ∈ Word 𝑉 → (♯‘(reverse‘(𝑊 prefix 𝐿))) = (♯‘(𝑊 prefix 𝐿))) |
8 | 2, 7 | syl 17 |
. . . . . . . . . . . 12
⊢ (𝑊 ∈ Word 𝑉 → (♯‘(reverse‘(𝑊 prefix 𝐿))) = (♯‘(𝑊 prefix 𝐿))) |
9 | 8 | adantr 481 |
. . . . . . . . . . 11
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
(♯‘(reverse‘(𝑊 prefix 𝐿))) = (♯‘(𝑊 prefix 𝐿))) |
10 | | pfxlen 14396 |
. . . . . . . . . . 11
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) → (♯‘(𝑊 prefix 𝐿)) = 𝐿) |
11 | 9, 10 | eqtrd 2778 |
. . . . . . . . . 10
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
(♯‘(reverse‘(𝑊 prefix 𝐿))) = 𝐿) |
12 | 11 | 3adant3 1131 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) →
(♯‘(reverse‘(𝑊 prefix 𝐿))) = 𝐿) |
13 | 12 | oveq2d 7291 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) →
(0...(♯‘(reverse‘(𝑊 prefix 𝐿)))) = (0...𝐿)) |
14 | 6, 13 | eleqtrrd 2842 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) → (𝐿 − 𝐹) ∈
(0...(♯‘(reverse‘(𝑊 prefix 𝐿))))) |
15 | 5, 14 | jca 512 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ (𝐿 − 𝐹) ∈ (0...𝐿)) → ((reverse‘(𝑊 prefix 𝐿)) ∈ Word 𝑉 ∧ (𝐿 − 𝐹) ∈
(0...(♯‘(reverse‘(𝑊 prefix 𝐿)))))) |
16 | 1, 15 | syl3an3 1164 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊)) ∧ 𝐹 ∈ (0...𝐿)) → ((reverse‘(𝑊 prefix 𝐿)) ∈ Word 𝑉 ∧ (𝐿 − 𝐹) ∈
(0...(♯‘(reverse‘(𝑊 prefix 𝐿)))))) |
17 | 16 | 3com23 1125 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
((reverse‘(𝑊 prefix
𝐿)) ∈ Word 𝑉 ∧ (𝐿 − 𝐹) ∈
(0...(♯‘(reverse‘(𝑊 prefix 𝐿)))))) |
18 | | revpfxsfxrev 33077 |
. . . 4
⊢
(((reverse‘(𝑊
prefix 𝐿)) ∈ Word
𝑉 ∧ (𝐿 − 𝐹) ∈
(0...(♯‘(reverse‘(𝑊 prefix 𝐿))))) →
(reverse‘((reverse‘(𝑊 prefix 𝐿)) prefix (𝐿 − 𝐹))) = ((reverse‘(reverse‘(𝑊 prefix 𝐿))) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉)) |
19 | 17, 18 | syl 17 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
(reverse‘((reverse‘(𝑊 prefix 𝐿)) prefix (𝐿 − 𝐹))) = ((reverse‘(reverse‘(𝑊 prefix 𝐿))) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉)) |
20 | | revrev 14480 |
. . . . . 6
⊢ ((𝑊 prefix 𝐿) ∈ Word 𝑉 → (reverse‘(reverse‘(𝑊 prefix 𝐿))) = (𝑊 prefix 𝐿)) |
21 | 2, 20 | syl 17 |
. . . . 5
⊢ (𝑊 ∈ Word 𝑉 → (reverse‘(reverse‘(𝑊 prefix 𝐿))) = (𝑊 prefix 𝐿)) |
22 | 21 | oveq1d 7290 |
. . . 4
⊢ (𝑊 ∈ Word 𝑉 →
((reverse‘(reverse‘(𝑊 prefix 𝐿))) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉) = ((𝑊 prefix 𝐿) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉)) |
23 | 22 | 3ad2ant1 1132 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
((reverse‘(reverse‘(𝑊 prefix 𝐿))) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉) = ((𝑊 prefix 𝐿) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉)) |
24 | 11 | oveq1d 7290 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)) = (𝐿 − (𝐿 − 𝐹))) |
25 | 24 | 3adant2 1130 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)) = (𝐿 − (𝐿 − 𝐹))) |
26 | | elfzel2 13254 |
. . . . . . . . 9
⊢ (𝐹 ∈ (0...𝐿) → 𝐿 ∈ ℤ) |
27 | 26 | zcnd 12427 |
. . . . . . . 8
⊢ (𝐹 ∈ (0...𝐿) → 𝐿 ∈ ℂ) |
28 | | elfzelz 13256 |
. . . . . . . . 9
⊢ (𝐹 ∈ (0...𝐿) → 𝐹 ∈ ℤ) |
29 | 28 | zcnd 12427 |
. . . . . . . 8
⊢ (𝐹 ∈ (0...𝐿) → 𝐹 ∈ ℂ) |
30 | 27, 29 | nncand 11337 |
. . . . . . 7
⊢ (𝐹 ∈ (0...𝐿) → (𝐿 − (𝐿 − 𝐹)) = 𝐹) |
31 | 30 | 3ad2ant2 1133 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → (𝐿 − (𝐿 − 𝐹)) = 𝐹) |
32 | 25, 31 | eqtrd 2778 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)) = 𝐹) |
33 | 11 | 3adant2 1130 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
(♯‘(reverse‘(𝑊 prefix 𝐿))) = 𝐿) |
34 | 32, 33 | opeq12d 4812 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉 = 〈𝐹, 𝐿〉) |
35 | 34 | oveq2d 7291 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝐿) substr
〈((♯‘(reverse‘(𝑊 prefix 𝐿))) − (𝐿 − 𝐹)), (♯‘(reverse‘(𝑊 prefix 𝐿)))〉) = ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉)) |
36 | 19, 23, 35 | 3eqtrd 2782 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) →
(reverse‘((reverse‘(𝑊 prefix 𝐿)) prefix (𝐿 − 𝐹))) = ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉)) |
37 | | elfzuz3 13253 |
. . . . . . . 8
⊢ (𝐹 ∈ (0...𝐿) → 𝐿 ∈ (ℤ≥‘𝐹)) |
38 | | eluzfz2 13264 |
. . . . . . . 8
⊢ (𝐿 ∈
(ℤ≥‘𝐹) → 𝐿 ∈ (𝐹...𝐿)) |
39 | 37, 38 | syl 17 |
. . . . . . 7
⊢ (𝐹 ∈ (0...𝐿) → 𝐿 ∈ (𝐹...𝐿)) |
40 | 39 | ancli 549 |
. . . . . 6
⊢ (𝐹 ∈ (0...𝐿) → (𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (𝐹...𝐿))) |
41 | 40 | 3ad2ant2 1133 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → (𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (𝐹...𝐿))) |
42 | | swrdpfx 14420 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (𝐹...𝐿)) → ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉) = (𝑊 substr 〈𝐹, 𝐿〉))) |
43 | 41, 42 | syl5 34 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉) = (𝑊 substr 〈𝐹, 𝐿〉))) |
44 | 43 | 3adant2 1130 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉) = (𝑊 substr 〈𝐹, 𝐿〉))) |
45 | 44 | pm2.43i 52 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → ((𝑊 prefix 𝐿) substr 〈𝐹, 𝐿〉) = (𝑊 substr 〈𝐹, 𝐿〉)) |
46 | 36, 45 | eqtr2d 2779 |
1
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝐹 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝑊))) → (𝑊 substr 〈𝐹, 𝐿〉) =
(reverse‘((reverse‘(𝑊 prefix 𝐿)) prefix (𝐿 − 𝐹)))) |