Proof of Theorem pfxsuff1eqwrdeq
Step | Hyp | Ref
| Expression |
1 | | hashgt0n0 14008 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → 𝑊 ≠ ∅) |
2 | | lennncl 14165 |
. . . . . 6
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (♯‘𝑊) ∈
ℕ) |
3 | 1, 2 | syldan 590 |
. . . . 5
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (♯‘𝑊) ∈
ℕ) |
4 | 3 | 3adant2 1129 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (♯‘𝑊) ∈
ℕ) |
5 | | fzo0end 13407 |
. . . 4
⊢
((♯‘𝑊)
∈ ℕ → ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊))) |
6 | 4, 5 | syl 17 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊))) |
7 | | pfxsuffeqwrdeq 14339 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ ((♯‘𝑊) − 1) ∈
(0..^(♯‘𝑊)))
→ (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉))))) |
8 | 6, 7 | syld3an3 1407 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 = 𝑈 ↔ ((♯‘𝑊) = (♯‘𝑈) ∧ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉))))) |
9 | | hashneq0 14007 |
. . . . . . . . . . 11
⊢ (𝑊 ∈ Word 𝑉 → (0 < (♯‘𝑊) ↔ 𝑊 ≠ ∅)) |
10 | 9 | biimpd 228 |
. . . . . . . . . 10
⊢ (𝑊 ∈ Word 𝑉 → (0 < (♯‘𝑊) → 𝑊 ≠ ∅)) |
11 | 10 | imdistani 568 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
12 | 11 | 3adant2 1129 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
13 | 12 | adantr 480 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
14 | | swrdlsw 14308 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑊)”〉) |
15 | 13, 14 | syl 17 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
〈“(lastS‘𝑊)”〉) |
16 | | breq2 5074 |
. . . . . . . . . 10
⊢
((♯‘𝑊) =
(♯‘𝑈) → (0
< (♯‘𝑊)
↔ 0 < (♯‘𝑈))) |
17 | 16 | 3anbi3d 1440 |
. . . . . . . . 9
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ↔ (𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)))) |
18 | | hashneq0 14007 |
. . . . . . . . . . . . 13
⊢ (𝑈 ∈ Word 𝑉 → (0 < (♯‘𝑈) ↔ 𝑈 ≠ ∅)) |
19 | 18 | biimpd 228 |
. . . . . . . . . . . 12
⊢ (𝑈 ∈ Word 𝑉 → (0 < (♯‘𝑈) → 𝑈 ≠ ∅)) |
20 | 19 | imdistani 568 |
. . . . . . . . . . 11
⊢ ((𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
21 | 20 | 3adant1 1128 |
. . . . . . . . . 10
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
22 | | swrdlsw 14308 |
. . . . . . . . . 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 407 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) =
〈“(lastS‘𝑈)”〉) |
26 | | oveq1 7262 |
. . . . . . . . . . 11
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((♯‘𝑊) −
1) = ((♯‘𝑈)
− 1)) |
27 | | id 22 |
. . . . . . . . . . 11
⊢
((♯‘𝑊) =
(♯‘𝑈) →
(♯‘𝑊) =
(♯‘𝑈)) |
28 | 26, 27 | opeq12d 4809 |
. . . . . . . . . 10
⊢
((♯‘𝑊) =
(♯‘𝑈) →
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉 = 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉) |
29 | 28 | oveq2d 7271 |
. . . . . . . . 9
⊢
((♯‘𝑊) =
(♯‘𝑈) →
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) = (𝑈 substr 〈((♯‘𝑈) − 1),
(♯‘𝑈)〉)) |
30 | 29 | eqeq1d 2740 |
. . . . . . . 8
⊢
((♯‘𝑊) =
(♯‘𝑈) →
((𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉) = 〈“(lastS‘𝑈)”〉 ↔ (𝑈 substr
〈((♯‘𝑈)
− 1), (♯‘𝑈)〉) = 〈“(lastS‘𝑈)”〉)) |
31 | 30 | adantl 481 |
. . . . . . 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 6771 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (lastS‘𝑊) ∈ V) |
35 | | fvex 6769 |
. . . . . 6
⊢
(lastS‘𝑈)
∈ V |
36 | | s111 14248 |
. . . . . 6
⊢
(((lastS‘𝑊)
∈ V ∧ (lastS‘𝑈) ∈ V) →
(〈“(lastS‘𝑊)”〉 =
〈“(lastS‘𝑈)”〉 ↔ (lastS‘𝑊) = (lastS‘𝑈))) |
37 | 34, 35, 36 | sylancl 585 |
. . . . 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 628 |
. . 3
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (♯‘𝑊)) ∧ (♯‘𝑊) = (♯‘𝑈)) → (((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (𝑊 substr 〈((♯‘𝑊) − 1),
(♯‘𝑊)〉) =
(𝑈 substr
〈((♯‘𝑊)
− 1), (♯‘𝑊)〉)) ↔ ((𝑊 prefix ((♯‘𝑊) − 1)) = (𝑈 prefix ((♯‘𝑊) − 1)) ∧ (lastS‘𝑊) = (lastS‘𝑈)))) |
40 | 39 | pm5.32da 578 |
. 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‘𝑈))))) |