Metamath Proof Explorer < Previous   Next > Nearby theorems Mirrors  >  Home  >  MPE Home  >  Th. List  >  pfxccatin12 Structured version   Visualization version   GIF version

Theorem pfxccatin12 14147
 Description: The subword of a concatenation of two words within both of the concatenated words. (Contributed by Alexander van der Vekens, 5-Apr-2018.) (Revised by AV, 9-May-2020.)
Hypothesis
Ref Expression
swrdccatin2.l 𝐿 = (♯‘𝐴)
Assertion
Ref Expression
pfxccatin12 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))))

Proof of Theorem pfxccatin12
Dummy variable 𝑘 is distinct from all other variables.
StepHypRef Expression
1 swrdccatin2.l . . . . 5 𝐿 = (♯‘𝐴)
21pfxccatin12lem2c 14144 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) ∈ Word 𝑉𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(♯‘(𝐴 ++ 𝐵)))))
3 swrdvalfn 14065 . . . 4 (((𝐴 ++ 𝐵) ∈ Word 𝑉𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(♯‘(𝐴 ++ 𝐵)))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
42, 3syl 17 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
5 swrdcl 14059 . . . . . 6 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
6 pfxcl 14091 . . . . . 6 (𝐵 ∈ Word 𝑉 → (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉)
7 ccatvalfn 13987 . . . . . 6 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
85, 6, 7syl2an 598 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
98adantr 484 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
10 simpll 766 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝐴 ∈ Word 𝑉)
11 simprl 770 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝑀 ∈ (0...𝐿))
12 lencl 13937 . . . . . . . . . . . 12 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
13 nn0fz0 13059 . . . . . . . . . . . 12 ((♯‘𝐴) ∈ ℕ0 ↔ (♯‘𝐴) ∈ (0...(♯‘𝐴)))
1412, 13sylib 221 . . . . . . . . . . 11 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ (0...(♯‘𝐴)))
151, 14eqeltrid 2856 . . . . . . . . . 10 (𝐴 ∈ Word 𝑉𝐿 ∈ (0...(♯‘𝐴)))
1615ad2antrr 725 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝐿 ∈ (0...(♯‘𝐴)))
17 swrdlen 14061 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝐴))) → (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) = (𝐿𝑀))
1810, 11, 16, 17syl3anc 1368 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) = (𝐿𝑀))
19 lencl 13937 . . . . . . . . . . . 12 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2019nn0zd 12129 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℤ)
21 elfzmlbp 13072 . . . . . . . . . . 11 (((♯‘𝐵) ∈ ℤ ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝑁𝐿) ∈ (0...(♯‘𝐵)))
2220, 21sylan 583 . . . . . . . . . 10 ((𝐵 ∈ Word 𝑉𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝑁𝐿) ∈ (0...(♯‘𝐵)))
23 pfxlen 14097 . . . . . . . . . 10 ((𝐵 ∈ Word 𝑉 ∧ (𝑁𝐿) ∈ (0...(♯‘𝐵))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2422, 23syldan 594 . . . . . . . . 9 ((𝐵 ∈ Word 𝑉𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2524ad2ant2l 745 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2618, 25oveq12d 7173 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))) = ((𝐿𝑀) + (𝑁𝐿)))
27 elfz2nn0 13052 . . . . . . . . . . 11 (𝑀 ∈ (0...𝐿) ↔ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿))
28 nn0cn 11949 . . . . . . . . . . . . . . . 16 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
2928ad2antll 728 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝐿 ∈ ℂ)
30 nn0cn 11949 . . . . . . . . . . . . . . . 16 (𝑀 ∈ ℕ0𝑀 ∈ ℂ)
3130ad2antrl 727 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝑀 ∈ ℂ)
32 zcn 12030 . . . . . . . . . . . . . . . 16 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
3332adantr 484 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝑁 ∈ ℂ)
3429, 31, 333jca 1125 . . . . . . . . . . . . . 14 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ))
3534ex 416 . . . . . . . . . . . . 13 (𝑁 ∈ ℤ → ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
36 elfzelz 12961 . . . . . . . . . . . . 13 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → 𝑁 ∈ ℤ)
3735, 36syl11 33 . . . . . . . . . . . 12 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
38373adant3 1129 . . . . . . . . . . 11 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
3927, 38sylbi 220 . . . . . . . . . 10 (𝑀 ∈ (0...𝐿) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
4039imp 410 . . . . . . . . 9 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ))
41 npncan3 10967 . . . . . . . . 9 ((𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4240, 41syl 17 . . . . . . . 8 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4342adantl 485 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4426, 43eqtr2d 2794 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (𝑁𝑀) = ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))
4544oveq2d 7171 . . . . 5 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (0..^(𝑁𝑀)) = (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
4645fneq2d 6432 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^(𝑁𝑀)) ↔ ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
479, 46mpbird 260 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^(𝑁𝑀)))
48 simprl 770 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))))
49 simpr 488 . . . . . . . 8 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀))) → 𝑘 ∈ (0..^(𝑁𝑀)))
5049anim2i 619 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝐿𝑀)) ∧ 𝑘 ∈ (0..^(𝑁𝑀))))
5150ancomd 465 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝑁𝑀)) ∧ 𝑘 ∈ (0..^(𝐿𝑀))))
521pfxccatin12lem3 14146 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ 𝑘 ∈ (0..^(𝐿𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘)))
5348, 51, 52sylc 65 . . . . 5 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
545, 6anim12i 615 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
5554adantr 484 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
5655ad2antrl 727 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
57 simpl 486 . . . . . . . 8 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ (0..^(𝐿𝑀)))
5818oveq2d 7171 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))) = (0..^(𝐿𝑀)))
5958ad2antrl 727 . . . . . . . 8 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))) = (0..^(𝐿𝑀)))
6057, 59eleqtrrd 2855 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))))
61 df-3an 1086 . . . . . . 7 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))) ↔ (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) ∧ 𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
6256, 60, 61sylanbrc 586 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
63 ccatval1 13982 . . . . . 6 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
6462, 63syl 17 . . . . 5 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
6553, 64eqtr4d 2796 . . . 4 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
66 simprl 770 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))))
6749anim2i 619 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ 𝑘 ∈ (0..^(𝑁𝑀))))
6867ancomd 465 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))))
691pfxccatin12lem2 14145 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))))))
7066, 68, 69sylc 65 . . . . 5 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
7155ad2antrl 727 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
72 elfzuz 12957 . . . . . . . . . . . . 13 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → 𝑁 ∈ (ℤ𝐿))
73 eluzelz 12297 . . . . . . . . . . . . . 14 (𝑁 ∈ (ℤ𝐿) → 𝑁 ∈ ℤ)
74 id 22 . . . . . . . . . . . . . . . . . 18 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
75743expia 1118 . . . . . . . . . . . . . . . . 17 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7675ancoms 462 . . . . . . . . . . . . . . . 16 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
77763adant3 1129 . . . . . . . . . . . . . . 15 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7827, 77sylbi 220 . . . . . . . . . . . . . 14 (𝑀 ∈ (0...𝐿) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7973, 78syl5com 31 . . . . . . . . . . . . 13 (𝑁 ∈ (ℤ𝐿) → (𝑀 ∈ (0...𝐿) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
8072, 79syl 17 . . . . . . . . . . . 12 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝑀 ∈ (0...𝐿) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
8180impcom 411 . . . . . . . . . . 11 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
8281adantl 485 . . . . . . . . . 10 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
8382ad2antrl 727 . . . . . . . . 9 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
84 pfxccatin12lem4 14140 . . . . . . . . 9 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))) → 𝑘 ∈ ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿)))))
8583, 68, 84sylc 65 . . . . . . . 8 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8618, 26oveq12d 7173 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))) = ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8786ad2antrl 727 . . . . . . . 8 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))) = ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8885, 87eleqtrrd 2855 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
89 df-3an 1086 . . . . . . 7 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))) ↔ (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) ∧ 𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
9071, 88, 89sylanbrc 586 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
91 ccatval2 13984 . . . . . 6 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
9290, 91syl 17 . . . . 5 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
9370, 92eqtr4d 2796 . . . 4 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
9465, 93pm2.61ian 811 . . 3 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
954, 47, 94eqfnfvd 6800 . 2 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))))
9695ex 416 1 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))))
 Colors of variables: wff setvar class Syntax hints:  ¬ wn 3   → wi 4   ∧ wa 399   ∧ w3a 1084   = wceq 1538   ∈ wcel 2111  ⟨cop 4531   class class class wbr 5035   Fn wfn 6334  ‘cfv 6339  (class class class)co 7155  ℂcc 10578  0cc0 10580   + caddc 10583   ≤ cle 10719   − cmin 10913  ℕ0cn0 11939  ℤcz 12025  ℤ≥cuz 12287  ...cfz 12944  ..^cfzo 13087  ♯chash 13745  Word cword 13918   ++ cconcat 13974   substr csubstr 14054   prefix cpfx 14084 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2729  ax-rep 5159  ax-sep 5172  ax-nul 5179  ax-pow 5237  ax-pr 5301  ax-un 7464  ax-cnex 10636  ax-resscn 10637  ax-1cn 10638  ax-icn 10639  ax-addcl 10640  ax-addrcl 10641  ax-mulcl 10642  ax-mulrcl 10643  ax-mulcom 10644  ax-addass 10645  ax-mulass 10646  ax-distr 10647  ax-i2m1 10648  ax-1ne0 10649  ax-1rid 10650  ax-rnegex 10651  ax-rrecex 10652  ax-cnre 10653  ax-pre-lttri 10654  ax-pre-lttrn 10655  ax-pre-ltadd 10656  ax-pre-mulgt0 10657 This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-fal 1551  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2557  df-eu 2588  df-clab 2736  df-cleq 2750  df-clel 2830  df-nfc 2901  df-ne 2952  df-nel 3056  df-ral 3075  df-rex 3076  df-reu 3077  df-rab 3079  df-v 3411  df-sbc 3699  df-csb 3808  df-dif 3863  df-un 3865  df-in 3867  df-ss 3877  df-pss 3879  df-nul 4228  df-if 4424  df-pw 4499  df-sn 4526  df-pr 4528  df-tp 4530  df-op 4532  df-uni 4802  df-int 4842  df-iun 4888  df-br 5036  df-opab 5098  df-mpt 5116  df-tr 5142  df-id 5433  df-eprel 5438  df-po 5446  df-so 5447  df-fr 5486  df-we 5488  df-xp 5533  df-rel 5534  df-cnv 5535  df-co 5536  df-dm 5537  df-rn 5538  df-res 5539  df-ima 5540  df-pred 6130  df-ord 6176  df-on 6177  df-lim 6178  df-suc 6179  df-iota 6298  df-fun 6341  df-fn 6342  df-f 6343  df-f1 6344  df-fo 6345  df-f1o 6346  df-fv 6347  df-riota 7113  df-ov 7158  df-oprab 7159  df-mpo 7160  df-om 7585  df-1st 7698  df-2nd 7699  df-wrecs 7962  df-recs 8023  df-rdg 8061  df-1o 8117  df-er 8304  df-en 8533  df-dom 8534  df-sdom 8535  df-fin 8536  df-card 9406  df-pnf 10720  df-mnf 10721  df-xr 10722  df-ltxr 10723  df-le 10724  df-sub 10915  df-neg 10916  df-nn 11680  df-n0 11940  df-z 12026  df-uz 12288  df-fz 12945  df-fzo 13088  df-hash 13746  df-word 13919  df-concat 13975  df-substr 14055  df-pfx 14085 This theorem is referenced by:  pfxccat3  14148  pfxccatpfx2  14151  pfxccatin12d  14159
 Copyright terms: Public domain W3C validator