Proof of Theorem swrdccat3b
Step | Hyp | Ref
| Expression |
1 | | simpl 483 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉)) |
2 | | simpr 485 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) |
3 | | elfzubelfz 13268 |
. . . . 5
⊢ (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) |
4 | 3 | adantl 482 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) |
5 | | swrdccatin2.l |
. . . . . 6
⊢ 𝐿 = (♯‘𝐴) |
6 | 5 | pfxccat3 14447 |
. . . . 5
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ∧ (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿))))))) |
7 | 6 | imp 407 |
. . . 4
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) ∧ (𝐿 + (♯‘𝐵)) ∈ (0...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))))) |
8 | 1, 2, 4, 7 | syl12anc 834 |
. . 3
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if((𝐿 + (♯‘𝐵)) ≤ 𝐿, (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉), if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)))))) |
9 | 5 | swrdccat3blem 14452 |
. . . 4
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ (𝐿 + (♯‘𝐵)) ≤ 𝐿) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐴 substr 〈𝑀, (𝐿 + (♯‘𝐵))〉)) |
10 | | iftrue 4465 |
. . . . . 6
⊢ (𝐿 ≤ 𝑀 → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉)) |
11 | 10 | 3ad2ant3 1134 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉)) |
12 | | lencl 14236 |
. . . . . . . . . . . 12
⊢ (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈
ℕ0) |
13 | 12 | nn0cnd 12295 |
. . . . . . . . . . 11
⊢ (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℂ) |
14 | | lencl 14236 |
. . . . . . . . . . . 12
⊢ (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈
ℕ0) |
15 | 14 | nn0cnd 12295 |
. . . . . . . . . . 11
⊢ (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℂ) |
16 | 5 | eqcomi 2747 |
. . . . . . . . . . . . 13
⊢
(♯‘𝐴) =
𝐿 |
17 | 16 | eleq1i 2829 |
. . . . . . . . . . . 12
⊢
((♯‘𝐴)
∈ ℂ ↔ 𝐿
∈ ℂ) |
18 | | pncan2 11228 |
. . . . . . . . . . . 12
⊢ ((𝐿 ∈ ℂ ∧
(♯‘𝐵) ∈
ℂ) → ((𝐿 +
(♯‘𝐵)) −
𝐿) = (♯‘𝐵)) |
19 | 17, 18 | sylanb 581 |
. . . . . . . . . . 11
⊢
(((♯‘𝐴)
∈ ℂ ∧ (♯‘𝐵) ∈ ℂ) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
20 | 13, 15, 19 | syl2an 596 |
. . . . . . . . . 10
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
21 | 20 | eqcomd 2744 |
. . . . . . . . 9
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
22 | 21 | adantr 481 |
. . . . . . . 8
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
23 | 22 | 3ad2ant1 1132 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → (♯‘𝐵) = ((𝐿 + (♯‘𝐵)) − 𝐿)) |
24 | 23 | opeq2d 4811 |
. . . . . 6
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → 〈(𝑀 − 𝐿), (♯‘𝐵)〉 = 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉) |
25 | 24 | oveq2d 7291 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉) = (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉)) |
26 | 11, 25 | eqtrd 2778 |
. . . 4
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = (𝐵 substr 〈(𝑀 − 𝐿), ((𝐿 + (♯‘𝐵)) − 𝐿)〉)) |
27 | | iffalse 4468 |
. . . . . 6
⊢ (¬
𝐿 ≤ 𝑀 → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) |
28 | 27 | 3ad2ant3 1134 |
. . . . 5
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) = ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)) |
29 | 20 | adantr 481 |
. . . . . . . . 9
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
30 | 29 | 3ad2ant1 1132 |
. . . . . . . 8
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → ((𝐿 + (♯‘𝐵)) − 𝐿) = (♯‘𝐵)) |
31 | 30 | oveq2d 7291 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿)) = (𝐵 prefix (♯‘𝐵))) |
32 | | pfxid 14397 |
. . . . . . . . . 10
⊢ (𝐵 ∈ Word 𝑉 → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
33 | 32 | adantl 482 |
. . . . . . . . 9
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
34 | 33 | adantr 481 |
. . . . . . . 8
⊢ (((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
35 | 34 | 3ad2ant1 1132 |
. . . . . . 7
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → (𝐵 prefix (♯‘𝐵)) = 𝐵) |
36 | 31, 35 | eqtr2d 2779 |
. . . . . 6
⊢ ((((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) ∧ 𝑀 ∈ (0...(𝐿 + (♯‘𝐵)))) ∧ ¬ (𝐿 + (♯‘𝐵)) ≤ 𝐿 ∧ ¬ 𝐿 ≤ 𝑀) → 𝐵 = (𝐵 prefix ((𝐿 + (♯‘𝐵)) − 𝐿))) |
37 | 36 | oveq2d 7291 |
. . . . 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 4514 |
. . 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 413 |
1
⊢ ((𝐴 ∈ Word 𝑉 ∧ 𝐵 ∈ Word 𝑉) → (𝑀 ∈ (0...(𝐿 + (♯‘𝐵))) → ((𝐴 ++ 𝐵) substr 〈𝑀, (𝐿 + (♯‘𝐵))〉) = if(𝐿 ≤ 𝑀, (𝐵 substr 〈(𝑀 − 𝐿), (♯‘𝐵)〉), ((𝐴 substr 〈𝑀, 𝐿〉) ++ 𝐵)))) |