Proof of Theorem pfxsuff1eqwrdeq
Step | Hyp | Ref
| Expression |
1 | | hashgt0n0 14080 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → 𝑊 ≠ ∅) |
2 | | lennncl 14237 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (♯‘𝑊) ∈
ℕ) |
3 | 1, 2 | syldan 591 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (♯‘𝑊) ∈
ℕ) |
4 | 3 | 3adant2 1130 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (♯‘𝑊) ∈
ℕ) |
5 | | fzo0end 13479 |
. . . 4
⊢
((♯‘𝑊)
∈ ℕ → ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊))) |
6 | 4, 5 | syl 17 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊))) |
7 | | pfxsuffeqwrdeq 14411 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊)))
→ (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉))))) |
8 | 6, 7 | syld3an3 1408 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉))))) |
9 | | hashneq0 14079 |
. . . . . . . . . . 11
⊢ (𝑊 ∈ Word 𝑉 → (0 < (♯‘𝑊) ↔ 𝑊 ≠ ∅)) |
10 | 9 | biimpd 228 |
. . . . . . . . . 10
⊢ (𝑊 ∈ Word 𝑉 → (0 < (♯‘𝑊) → 𝑊 ≠ ∅)) |
11 | 10 | imdistani 569 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
12 | 11 | 3adant2 1130 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
13 | 12 | adantr 481 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
14 | | swrdlsw 14380 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑊)”〉) |
15 | 13, 14 | syl 17 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑊)”〉) |
16 | | breq2 5078 |
. . . . . . . . . 10
⊢
((♯‘𝑊) =
(♯‘𝑈) → (0
< (♯‘𝑊)
↔ 0 < (♯‘𝑈))) |
17 | 16 | 3anbi3d 1441 |
. . . . . . . . 9
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ↔ (𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)))) |
18 | | hashneq0 14079 |
. . . . . . . . . . . . 13
⊢ (𝑈 ∈ Word 𝑉 → (0 < (♯‘𝑈) ↔ 𝑈 ≠ ∅)) |
19 | 18 | biimpd 228 |
. . . . . . . . . . . 12
⊢ (𝑈 ∈ Word 𝑉 → (0 < (♯‘𝑈) → 𝑈 ≠ ∅)) |
20 | 19 | imdistani 569 |
. . . . . . . . . . 11
⊢ ((𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
21 | 20 | 3adant1 1129 |
. . . . . . . . . 10
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
22 | | swrdlsw 14380 |
. . . . . . . . . 10
⊢ ((𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅) → (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉) |
23 | 21, 22 | syl 17 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)) → (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉) |
24 | 17, 23 | syl6bi 252 |
. . . . . . . 8
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉)) |
25 | 24 | impcom 408 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉) |
26 | | oveq1 7282 |
. . . . . . . . . . 11
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((♯‘𝑊) −
1) = ((♯‘𝑈)
− 1)) |
27 | | id 22 |
. . . . . . . . . . 11
⊢
((♯‘𝑊) =
(♯‘𝑈) →
(♯‘𝑊) =
(♯‘𝑈)) |
28 | 26, 27 | opeq12d 4812 |
. . . . . . . . . 10
⊢
((♯‘𝑊) =
(♯‘𝑈) →
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉 = 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) |
29 | 28 | oveq2d 7291 |
. . . . . . . . 9
⊢
((♯‘𝑊) =
(♯‘𝑈) →
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) = (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉)) |
30 | 29 | eqeq1d 2740 |
. . . . . . . 8
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) = 〈“(lastS‘𝑈)”〉 ↔ (𝑈 substr
〈((♯‘𝑈)
− 1), (♯‘𝑈)〉) = 〈“(lastS‘𝑈)”〉)) |
31 | 30 | adantl 482 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → ((𝑈 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑈)”〉 ↔ (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉)) |
32 | 25, 31 | mpbird 256 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑈 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑈)”〉) |
33 | 15, 32 | eqeq12d 2754 |
. . . . 5
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → ((𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) ↔
〈“(lastS‘𝑊)”〉 =
〈“(lastS‘𝑈)”〉)) |
34 | | fvexd 6789 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (lastS‘𝑊) ∈ V) |
35 | | fvex 6787 |
. . . . . 6
⊢
(lastS‘𝑈)
∈ V |
36 | | s111 14320 |
. . . . . 6
⊢
(((lastS‘𝑊)
∈ V ∧ (lastS‘𝑈) ∈ V) →
(〈“(lastS‘𝑊)”〉 =
〈“(lastS‘𝑈)”〉 ↔ (lastS‘𝑊) = (lastS‘𝑈))) |
37 | 34, 35, 36 | sylancl 586 |
. . . . 5
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) →
(〈“(lastS‘𝑊)”〉 =
〈“(lastS‘𝑈)”〉 ↔ (lastS‘𝑊) = (lastS‘𝑈))) |
38 | 33, 37 | bitrd 278 |
. . . 4
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → ((𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) ↔ (lastS‘𝑊) = (lastS‘𝑈))) |
39 | 38 | anbi2d 629 |
. . 3
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉)) ↔ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (lastS‘𝑊) = (lastS‘𝑈)))) |
40 | 39 | pm5.32da 579 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉))) ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (lastS‘𝑊) = (lastS‘𝑈))))) |
41 | 8, 40 | bitrd 278 |
1
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (lastS‘𝑊) = (lastS‘𝑈))))) |