Proof of Theorem 2swrd1eqwrdeq
Step | Hyp | Ref
| Expression |
1 | | lencl 13179 |
. . . . . . 7
⊢ (𝑊 ∈ Word 𝑉 → (#‘𝑊) ∈
ℕ0) |
2 | | nn0z 11277 |
. . . . . . 7
⊢
((#‘𝑊) ∈
ℕ0 → (#‘𝑊) ∈ ℤ) |
3 | | elnnz 11264 |
. . . . . . . 8
⊢
((#‘𝑊) ∈
ℕ ↔ ((#‘𝑊)
∈ ℤ ∧ 0 < (#‘𝑊))) |
4 | 3 | simplbi2 653 |
. . . . . . 7
⊢
((#‘𝑊) ∈
ℤ → (0 < (#‘𝑊) → (#‘𝑊) ∈ ℕ)) |
5 | 1, 2, 4 | 3syl 18 |
. . . . . 6
⊢ (𝑊 ∈ Word 𝑉 → (0 < (#‘𝑊) → (#‘𝑊) ∈ ℕ)) |
6 | 5 | a1d 25 |
. . . . 5
⊢ (𝑊 ∈ Word 𝑉 → (𝑈 ∈ Word 𝑉 → (0 < (#‘𝑊) → (#‘𝑊) ∈ ℕ))) |
7 | 6 | 3imp 1249 |
. . . 4
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (#‘𝑊) ∈ ℕ) |
8 | | fzo0end 12426 |
. . . 4
⊢
((#‘𝑊) ∈
ℕ → ((#‘𝑊)
− 1) ∈ (0..^(#‘𝑊))) |
9 | 7, 8 | syl 17 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → ((#‘𝑊) − 1) ∈ (0..^(#‘𝑊))) |
10 | | 2swrdeqwrdeq 13305 |
. . 3
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ ((#‘𝑊) − 1) ∈ (0..^(#‘𝑊))) → (𝑊 = 𝑈 ↔ ((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉))))) |
11 | 9, 10 | syld3an3 1363 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑊 = 𝑈 ↔ ((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉))))) |
12 | | hashneq0 13016 |
. . . . . . . . . . 11
⊢ (𝑊 ∈ Word 𝑉 → (0 < (#‘𝑊) ↔ 𝑊 ≠ ∅)) |
13 | 12 | biimpd 218 |
. . . . . . . . . 10
⊢ (𝑊 ∈ Word 𝑉 → (0 < (#‘𝑊) → 𝑊 ≠ ∅)) |
14 | 13 | imdistani 722 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
15 | 14 | 3adant2 1073 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
16 | 15 | adantr 480 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅)) |
17 | | swrdlsw 13304 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS ‘𝑊)”〉) |
18 | 16, 17 | syl 17 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS ‘𝑊)”〉) |
19 | | breq2 4587 |
. . . . . . . . . 10
⊢
((#‘𝑊) =
(#‘𝑈) → (0 <
(#‘𝑊) ↔ 0 <
(#‘𝑈))) |
20 | 19 | 3anbi3d 1397 |
. . . . . . . . 9
⊢
((#‘𝑊) =
(#‘𝑈) → ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ↔ (𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)))) |
21 | | hashneq0 13016 |
. . . . . . . . . . . . 13
⊢ (𝑈 ∈ Word 𝑉 → (0 < (#‘𝑈) ↔ 𝑈 ≠ ∅)) |
22 | 21 | biimpd 218 |
. . . . . . . . . . . 12
⊢ (𝑈 ∈ Word 𝑉 → (0 < (#‘𝑈) → 𝑈 ≠ ∅)) |
23 | 22 | imdistani 722 |
. . . . . . . . . . 11
⊢ ((𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
24 | 23 | 3adant1 1072 |
. . . . . . . . . 10
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → (𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅)) |
25 | | swrdlsw 13304 |
. . . . . . . . . 10
⊢ ((𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅) → (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉) = 〈“( lastS ‘𝑈)”〉) |
26 | 24, 25 | syl 17 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉) = 〈“( lastS ‘𝑈)”〉) |
27 | 20, 26 | syl6bi 242 |
. . . . . . . 8
⊢
((#‘𝑊) =
(#‘𝑈) → ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉) = 〈“( lastS ‘𝑈)”〉)) |
28 | 27 | impcom 445 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉) = 〈“( lastS ‘𝑈)”〉) |
29 | | oveq1 6556 |
. . . . . . . . . . 11
⊢
((#‘𝑊) =
(#‘𝑈) →
((#‘𝑊) − 1) =
((#‘𝑈) −
1)) |
30 | | id 22 |
. . . . . . . . . . 11
⊢
((#‘𝑊) =
(#‘𝑈) →
(#‘𝑊) =
(#‘𝑈)) |
31 | 29, 30 | opeq12d 4348 |
. . . . . . . . . 10
⊢
((#‘𝑊) =
(#‘𝑈) →
〈((#‘𝑊) −
1), (#‘𝑊)〉 =
〈((#‘𝑈) −
1), (#‘𝑈)〉) |
32 | 31 | oveq2d 6565 |
. . . . . . . . 9
⊢
((#‘𝑊) =
(#‘𝑈) → (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉)) |
33 | 32 | eqeq1d 2612 |
. . . . . . . 8
⊢
((#‘𝑊) =
(#‘𝑈) → ((𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS
‘𝑈)”〉
↔ (𝑈 substr
〈((#‘𝑈) −
1), (#‘𝑈)〉) =
〈“( lastS ‘𝑈)”〉)) |
34 | 33 | adantl 481 |
. . . . . . 7
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → ((𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS ‘𝑈)”〉 ↔ (𝑈 substr 〈((#‘𝑈) − 1), (#‘𝑈)〉) = 〈“( lastS
‘𝑈)”〉)) |
35 | 28, 34 | mpbird 246 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = 〈“( lastS ‘𝑈)”〉) |
36 | 18, 35 | eqeq12d 2625 |
. . . . 5
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → ((𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) ↔ 〈“( lastS
‘𝑊)”〉 =
〈“( lastS ‘𝑈)”〉)) |
37 | | hashgt0n0 13017 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → 𝑊 ≠ ∅) |
38 | | lswcl 13208 |
. . . . . . . . 9
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑊 ≠ ∅) → ( lastS ‘𝑊) ∈ 𝑉) |
39 | 37, 38 | syldan 486 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → ( lastS ‘𝑊) ∈ 𝑉) |
40 | 39 | 3adant2 1073 |
. . . . . . 7
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → ( lastS ‘𝑊) ∈ 𝑉) |
41 | 40 | adantr 480 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → ( lastS ‘𝑊) ∈ 𝑉) |
42 | | hashgt0n0 13017 |
. . . . . . . . . 10
⊢ ((𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → 𝑈 ≠ ∅) |
43 | | lswcl 13208 |
. . . . . . . . . 10
⊢ ((𝑈 ∈ Word 𝑉 ∧ 𝑈 ≠ ∅) → ( lastS ‘𝑈) ∈ 𝑉) |
44 | 42, 43 | syldan 486 |
. . . . . . . . 9
⊢ ((𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → ( lastS ‘𝑈) ∈ 𝑉) |
45 | 44 | 3adant1 1072 |
. . . . . . . 8
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑈)) → ( lastS ‘𝑈) ∈ 𝑉) |
46 | 20, 45 | syl6bi 242 |
. . . . . . 7
⊢
((#‘𝑊) =
(#‘𝑈) → ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → ( lastS ‘𝑈) ∈ 𝑉)) |
47 | 46 | impcom 445 |
. . . . . 6
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → ( lastS ‘𝑈) ∈ 𝑉) |
48 | | s111 13248 |
. . . . . 6
⊢ ((( lastS
‘𝑊) ∈ 𝑉 ∧ ( lastS ‘𝑈) ∈ 𝑉) → (〈“( lastS ‘𝑊)”〉 = 〈“(
lastS ‘𝑈)”〉 ↔ ( lastS ‘𝑊) = ( lastS ‘𝑈))) |
49 | 41, 47, 48 | syl2anc 691 |
. . . . 5
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (〈“( lastS ‘𝑊)”〉 = 〈“(
lastS ‘𝑈)”〉 ↔ ( lastS ‘𝑊) = ( lastS ‘𝑈))) |
50 | 36, 49 | bitrd 267 |
. . . 4
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → ((𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) ↔ ( lastS ‘𝑊) = ( lastS ‘𝑈))) |
51 | 50 | anbi2d 736 |
. . 3
⊢ (((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) ∧ (#‘𝑊) = (#‘𝑈)) → (((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉)) ↔ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ ( lastS
‘𝑊) = ( lastS
‘𝑈)))) |
52 | 51 | pm5.32da 671 |
. 2
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ (𝑊 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉) = (𝑈 substr 〈((#‘𝑊) − 1), (#‘𝑊)〉))) ↔ ((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ ( lastS
‘𝑊) = ( lastS
‘𝑈))))) |
53 | 11, 52 | bitrd 267 |
1
⊢ ((𝑊 ∈ Word 𝑉 ∧ 𝑈 ∈ Word 𝑉 ∧ 0 < (#‘𝑊)) → (𝑊 = 𝑈 ↔ ((#‘𝑊) = (#‘𝑈) ∧ ((𝑊 substr 〈0, ((#‘𝑊) − 1)〉) = (𝑈 substr 〈0, ((#‘𝑊) − 1)〉) ∧ ( lastS
‘𝑊) = ( lastS
‘𝑈))))) |