Proof of Theorem swrdccat3b
Step | Hyp | Ref
| Expression |
1 | | simpl 482 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉)) |
2 | | simpr 484 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) |
3 | | elfzubelfz 13197 |
. . . . 5
⊢ (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) |
4 | 3 | adantl 481 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) |
5 | | swrdccatin2.l |
. . . . . 6
⊢ 𝐿 = (♯‘𝐴) |
6 | 5 | pfxccat3 14375 |
. . . . 5
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ∧ (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿))))))) |
7 | 6 | imp 406 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ∧ (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))))) |
8 | 1, 2, 4, 7 | syl12anc 833 |
. . 3
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))))) |
9 | 5 | swrdccat3blem 14380 |
. . . 4
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉)) |
10 | | iftrue 4462 |
. . . . . 6
⊢ (𝐿 ≤ 𝑀 → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉)) |
11 | 10 | 3ad2ant3 1133 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉)) |
12 | | lencl 14164 |
. . . . . . . . . . . 12
⊢ (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈
ℕ0) |
13 | 12 | nn0cnd 12225 |
. . . . . . . . . . 11
⊢ (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℂ) |
14 | | lencl 14164 |
. . . . . . . . . . . 12
⊢ (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈
ℕ0) |
15 | 14 | nn0cnd 12225 |
. . . . . . . . . . 11
⊢ (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℂ) |
16 | 5 | eqcomi 2747 |
. . . . . . . . . . . . 13
⊢
(♯‘𝐴) =
𝐿 |
17 | 16 | eleq1i 2829 |
. . . . . . . . . . . 12
⊢
((♯‘𝐴)
∈ ℂ ↔ 𝐿
∈ ℂ) |
18 | | pncan2 11158 |
. . . . . . . . . . . 12
⊢ ((𝐿 ∈ ℂ ∧
(♯‘𝐵) ∈
ℂ) → ((𝐿 +
(♯‘𝐵)) −
𝐿) = (♯‘𝐵)) |
19 | 17, 18 | sylanb 580 |
. . . . . . . . . . 11
⊢
(((♯‘𝐴)
∈ ℂ ∧ (♯‘𝐵) ∈ ℂ) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
20 | 13, 15, 19 | syl2an 595 |
. . . . . . . . . 10
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
21 | 20 | eqcomd 2744 |
. . . . . . . . 9
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
22 | 21 | adantr 480 |
. . . . . . . 8
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
23 | 22 | 3ad2ant1 1131 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
24 | 23 | opeq2d 4808 |
. . . . . 6
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → 〈(𝑀 − 𝐿), (♯‘𝐵)〉 = 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉) |
25 | 24 | oveq2d 7271 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉) = (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉)) |
26 | 11, 25 | eqtrd 2778 |
. . . 4
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉)) |
27 | | iffalse 4465 |
. . . . . 6
⊢ (¬
𝐿 ≤ 𝑀 → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) |
28 | 27 | 3ad2ant3 1133 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) |
29 | 20 | adantr 480 |
. . . . . . . . 9
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
30 | 29 | 3ad2ant1 1131 |
. . . . . . . 8
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
31 | 30 | oveq2d 7271 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)) = (𝐵 prefix (♯‘𝐵))) |
32 | | pfxid 14325 |
. . . . . . . . . 10
⊢ (𝐵 ∈ Word 𝑉 → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
33 | 32 | adantl 481 |
. . . . . . . . 9
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
34 | 33 | adantr 480 |
. . . . . . . 8
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
35 | 34 | 3ad2ant1 1131 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
36 | 31, 35 | eqtr2d 2779 |
. . . . . 6
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → 𝐵 = (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿))) |
37 | 36 | oveq2d 7271 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))) |
38 | 28, 37 | eqtrd 2778 |
. . . 4
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))) |
39 | 9, 26, 38 | 2if2 4511 |
. . 3
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))))) |
40 | 8, 39 | eqtr4d 2781 |
. 2
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵))) |
41 | 40 | ex 412 |
1
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)))) |