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

Theorem pfxccatin12 14446
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 14443 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) ∈ Word 𝑉𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(♯‘(𝐴 ++ 𝐵)))))
3 swrdvalfn 14364 . . . 4 (((𝐴 ++ 𝐵) ∈ Word 𝑉𝑀 ∈ (0...𝑁) ∧ 𝑁 ∈ (0...(♯‘(𝐴 ++ 𝐵)))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
42, 3syl 17 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) Fn (0..^(𝑁𝑀)))
5 swrdcl 14358 . . . . . 6 (𝐴 ∈ Word 𝑉 → (𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉)
6 pfxcl 14390 . . . . . 6 (𝐵 ∈ Word 𝑉 → (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉)
7 ccatvalfn 14286 . . . . . 6 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
85, 6, 7syl2an 596 . . . . 5 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
98adantr 481 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
10 simpll 764 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝐴 ∈ Word 𝑉)
11 simprl 768 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝑀 ∈ (0...𝐿))
12 lencl 14236 . . . . . . . . . . . 12 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ ℕ0)
13 nn0fz0 13354 . . . . . . . . . . . 12 ((♯‘𝐴) ∈ ℕ0 ↔ (♯‘𝐴) ∈ (0...(♯‘𝐴)))
1412, 13sylib 217 . . . . . . . . . . 11 (𝐴 ∈ Word 𝑉 → (♯‘𝐴) ∈ (0...(♯‘𝐴)))
151, 14eqeltrid 2843 . . . . . . . . . 10 (𝐴 ∈ Word 𝑉𝐿 ∈ (0...(♯‘𝐴)))
1615ad2antrr 723 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → 𝐿 ∈ (0...(♯‘𝐴)))
17 swrdlen 14360 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝑀 ∈ (0...𝐿) ∧ 𝐿 ∈ (0...(♯‘𝐴))) → (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) = (𝐿𝑀))
1810, 11, 16, 17syl3anc 1370 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) = (𝐿𝑀))
19 lencl 14236 . . . . . . . . . . . 12 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℕ0)
2019nn0zd 12424 . . . . . . . . . . 11 (𝐵 ∈ Word 𝑉 → (♯‘𝐵) ∈ ℤ)
21 elfzmlbp 13367 . . . . . . . . . . 11 (((♯‘𝐵) ∈ ℤ ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝑁𝐿) ∈ (0...(♯‘𝐵)))
2220, 21sylan 580 . . . . . . . . . 10 ((𝐵 ∈ Word 𝑉𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝑁𝐿) ∈ (0...(♯‘𝐵)))
23 pfxlen 14396 . . . . . . . . . 10 ((𝐵 ∈ Word 𝑉 ∧ (𝑁𝐿) ∈ (0...(♯‘𝐵))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2422, 23syldan 591 . . . . . . . . 9 ((𝐵 ∈ Word 𝑉𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2524ad2ant2l 743 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (♯‘(𝐵 prefix (𝑁𝐿))) = (𝑁𝐿))
2618, 25oveq12d 7293 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))) = ((𝐿𝑀) + (𝑁𝐿)))
27 elfz2nn0 13347 . . . . . . . . . . 11 (𝑀 ∈ (0...𝐿) ↔ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿))
28 nn0cn 12243 . . . . . . . . . . . . . . . 16 (𝐿 ∈ ℕ0𝐿 ∈ ℂ)
2928ad2antll 726 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝐿 ∈ ℂ)
30 nn0cn 12243 . . . . . . . . . . . . . . . 16 (𝑀 ∈ ℕ0𝑀 ∈ ℂ)
3130ad2antrl 725 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝑀 ∈ ℂ)
32 zcn 12324 . . . . . . . . . . . . . . . 16 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
3332adantr 481 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → 𝑁 ∈ ℂ)
3429, 31, 333jca 1127 . . . . . . . . . . . . . 14 ((𝑁 ∈ ℤ ∧ (𝑀 ∈ ℕ0𝐿 ∈ ℕ0)) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ))
3534ex 413 . . . . . . . . . . . . 13 (𝑁 ∈ ℤ → ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
36 elfzelz 13256 . . . . . . . . . . . . 13 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → 𝑁 ∈ ℤ)
3735, 36syl11 33 . . . . . . . . . . . 12 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
38373adant3 1131 . . . . . . . . . . 11 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
3927, 38sylbi 216 . . . . . . . . . 10 (𝑀 ∈ (0...𝐿) → (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ)))
4039imp 407 . . . . . . . . 9 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ))
41 npncan3 11259 . . . . . . . . 9 ((𝐿 ∈ ℂ ∧ 𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4240, 41syl 17 . . . . . . . 8 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4342adantl 482 . . . . . . 7 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐿𝑀) + (𝑁𝐿)) = (𝑁𝑀))
4426, 43eqtr2d 2779 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (𝑁𝑀) = ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))
4544oveq2d 7291 . . . . 5 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (0..^(𝑁𝑀)) = (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
4645fneq2d 6527 . . . 4 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^(𝑁𝑀)) ↔ ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
479, 46mpbird 256 . . 3 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))) Fn (0..^(𝑁𝑀)))
48 simprl 768 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))))
49 simpr 485 . . . . . . . 8 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀))) → 𝑘 ∈ (0..^(𝑁𝑀)))
5049anim2i 617 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝐿𝑀)) ∧ 𝑘 ∈ (0..^(𝑁𝑀))))
5150ancomd 462 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝑁𝑀)) ∧ 𝑘 ∈ (0..^(𝐿𝑀))))
521pfxccatin12lem3 14445 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ 𝑘 ∈ (0..^(𝐿𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘)))
5348, 51, 52sylc 65 . . . . 5 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
545, 6anim12i 613 . . . . . . . . 9 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
5554adantr 481 . . . . . . . 8 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
5655ad2antrl 725 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
57 simpl 483 . . . . . . . 8 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ (0..^(𝐿𝑀)))
5818oveq2d 7291 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))) = (0..^(𝐿𝑀)))
5958ad2antrl 725 . . . . . . . 8 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))) = (0..^(𝐿𝑀)))
6057, 59eleqtrrd 2842 . . . . . . 7 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))))
61 df-3an 1088 . . . . . . 7 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))) ↔ (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) ∧ 𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
6256, 60, 61sylanbrc 583 . . . . . 6 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
63 ccatval1 14281 . . . . . 6 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ (0..^(♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
6462, 63syl 17 . . . . 5 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘) = ((𝐴 substr ⟨𝑀, 𝐿⟩)‘𝑘))
6553, 64eqtr4d 2781 . . . 4 ((𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
66 simprl 768 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))))
6749anim2i 617 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ 𝑘 ∈ (0..^(𝑁𝑀))))
6867ancomd 462 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))))
691pfxccatin12lem2 14444 . . . . . 6 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))))))
7066, 68, 69sylc 65 . . . . 5 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = ((𝐵 prefix (𝑁𝐿))‘(𝑘 − (♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)))))
7155ad2antrl 725 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉))
72 elfzuz 13252 . . . . . . . . . . . . 13 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → 𝑁 ∈ (ℤ𝐿))
73 eluzelz 12592 . . . . . . . . . . . . . 14 (𝑁 ∈ (ℤ𝐿) → 𝑁 ∈ ℤ)
74 id 22 . . . . . . . . . . . . . . . . . 18 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
75743expia 1120 . . . . . . . . . . . . . . . . 17 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7675ancoms 459 . . . . . . . . . . . . . . . 16 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
77763adant3 1131 . . . . . . . . . . . . . . 15 ((𝑀 ∈ ℕ0𝐿 ∈ ℕ0𝑀𝐿) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7827, 77sylbi 216 . . . . . . . . . . . . . 14 (𝑀 ∈ (0...𝐿) → (𝑁 ∈ ℤ → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
7973, 78syl5com 31 . . . . . . . . . . . . 13 (𝑁 ∈ (ℤ𝐿) → (𝑀 ∈ (0...𝐿) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
8072, 79syl 17 . . . . . . . . . . . 12 (𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))) → (𝑀 ∈ (0...𝐿) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ)))
8180impcom 408 . . . . . . . . . . 11 ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
8281adantl 482 . . . . . . . . . 10 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
8382ad2antrl 725 . . . . . . . . 9 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ))
84 pfxccatin12lem4 14439 . . . . . . . . 9 ((𝐿 ∈ ℕ0𝑀 ∈ ℕ0𝑁 ∈ ℤ) → ((𝑘 ∈ (0..^(𝑁𝑀)) ∧ ¬ 𝑘 ∈ (0..^(𝐿𝑀))) → 𝑘 ∈ ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿)))))
8583, 68, 84sylc 65 . . . . . . . 8 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8618, 26oveq12d 7293 . . . . . . . . 9 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))) = ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8786ad2antrl 725 . . . . . . . 8 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))) = ((𝐿𝑀)..^((𝐿𝑀) + (𝑁𝐿))))
8885, 87eleqtrrd 2842 . . . . . . 7 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → 𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿))))))
89 df-3an 1088 . . . . . . 7 (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))) ↔ (((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉) ∧ 𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
9071, 88, 89sylanbrc 583 . . . . . 6 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → ((𝐴 substr ⟨𝑀, 𝐿⟩) ∈ Word 𝑉 ∧ (𝐵 prefix (𝑁𝐿)) ∈ Word 𝑉𝑘 ∈ ((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩))..^((♯‘(𝐴 substr ⟨𝑀, 𝐿⟩)) + (♯‘(𝐵 prefix (𝑁𝐿)))))))
91 ccatval2 14283 . . . . . 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 2781 . . . 4 ((¬ 𝑘 ∈ (0..^(𝐿𝑀)) ∧ (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀)))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
9465, 93pm2.61ian 809 . . 3 ((((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) ∧ 𝑘 ∈ (0..^(𝑁𝑀))) → (((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩)‘𝑘) = (((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))‘𝑘))
954, 47, 94eqfnfvd 6912 . 2 (((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) ∧ (𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵))))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿))))
9695ex 413 1 ((𝐴 ∈ Word 𝑉𝐵 ∈ Word 𝑉) → ((𝑀 ∈ (0...𝐿) ∧ 𝑁 ∈ (𝐿...(𝐿 + (♯‘𝐵)))) → ((𝐴 ++ 𝐵) substr ⟨𝑀, 𝑁⟩) = ((𝐴 substr ⟨𝑀, 𝐿⟩) ++ (𝐵 prefix (𝑁𝐿)))))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 396  w3a 1086   = wceq 1539  wcel 2106  cop 4567   class class class wbr 5074   Fn wfn 6428  cfv 6433  (class class class)co 7275  cc 10869  0cc0 10871   + caddc 10874  cle 11010  cmin 11205  0cn0 12233  cz 12319  cuz 12582  ...cfz 13239  ..^cfzo 13382  chash 14044  Word cword 14217   ++ cconcat 14273   substr csubstr 14353   prefix cpfx 14383
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2709  ax-rep 5209  ax-sep 5223  ax-nul 5230  ax-pow 5288  ax-pr 5352  ax-un 7588  ax-cnex 10927  ax-resscn 10928  ax-1cn 10929  ax-icn 10930  ax-addcl 10931  ax-addrcl 10932  ax-mulcl 10933  ax-mulrcl 10934  ax-mulcom 10935  ax-addass 10936  ax-mulass 10937  ax-distr 10938  ax-i2m1 10939  ax-1ne0 10940  ax-1rid 10941  ax-rnegex 10942  ax-rrecex 10943  ax-cnre 10944  ax-pre-lttri 10945  ax-pre-lttrn 10946  ax-pre-ltadd 10947  ax-pre-mulgt0 10948
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 845  df-3or 1087  df-3an 1088  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2068  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-nfc 2889  df-ne 2944  df-nel 3050  df-ral 3069  df-rex 3070  df-reu 3072  df-rab 3073  df-v 3434  df-sbc 3717  df-csb 3833  df-dif 3890  df-un 3892  df-in 3894  df-ss 3904  df-pss 3906  df-nul 4257  df-if 4460  df-pw 4535  df-sn 4562  df-pr 4564  df-op 4568  df-uni 4840  df-int 4880  df-iun 4926  df-br 5075  df-opab 5137  df-mpt 5158  df-tr 5192  df-id 5489  df-eprel 5495  df-po 5503  df-so 5504  df-fr 5544  df-we 5546  df-xp 5595  df-rel 5596  df-cnv 5597  df-co 5598  df-dm 5599  df-rn 5600  df-res 5601  df-ima 5602  df-pred 6202  df-ord 6269  df-on 6270  df-lim 6271  df-suc 6272  df-iota 6391  df-fun 6435  df-fn 6436  df-f 6437  df-f1 6438  df-fo 6439  df-f1o 6440  df-fv 6441  df-riota 7232  df-ov 7278  df-oprab 7279  df-mpo 7280  df-om 7713  df-1st 7831  df-2nd 7832  df-frecs 8097  df-wrecs 8128  df-recs 8202  df-rdg 8241  df-1o 8297  df-er 8498  df-en 8734  df-dom 8735  df-sdom 8736  df-fin 8737  df-card 9697  df-pnf 11011  df-mnf 11012  df-xr 11013  df-ltxr 11014  df-le 11015  df-sub 11207  df-neg 11208  df-nn 11974  df-n0 12234  df-z 12320  df-uz 12583  df-fz 13240  df-fzo 13383  df-hash 14045  df-word 14218  df-concat 14274  df-substr 14354  df-pfx 14384
This theorem is referenced by:  pfxccat3  14447  pfxccatpfx2  14450  pfxccatin12d  14458
  Copyright terms: Public domain W3C validator