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

Theorem splval2 13502
Description: Value of a splice, assuming the input word 𝑆 has already been decomposed into its pieces. (Contributed by Mario Carneiro, 1-Oct-2015.)
Hypotheses
Ref Expression
splval2.a (𝜑𝐴 ∈ Word 𝑋)
splval2.b (𝜑𝐵 ∈ Word 𝑋)
splval2.c (𝜑𝐶 ∈ Word 𝑋)
splval2.r (𝜑𝑅 ∈ Word 𝑋)
splval2.s (𝜑𝑆 = ((𝐴 ++ 𝐵) ++ 𝐶))
splval2.f (𝜑𝐹 = (#‘𝐴))
splval2.t (𝜑𝑇 = (𝐹 + (#‘𝐵)))
Assertion
Ref Expression
splval2 (𝜑 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = ((𝐴 ++ 𝑅) ++ 𝐶))

Proof of Theorem splval2
StepHypRef Expression
1 splval2.s . . . 4 (𝜑𝑆 = ((𝐴 ++ 𝐵) ++ 𝐶))
2 splval2.a . . . . . 6 (𝜑𝐴 ∈ Word 𝑋)
3 splval2.b . . . . . 6 (𝜑𝐵 ∈ Word 𝑋)
4 ccatcl 13354 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (𝐴 ++ 𝐵) ∈ Word 𝑋)
52, 3, 4syl2anc 693 . . . . 5 (𝜑 → (𝐴 ++ 𝐵) ∈ Word 𝑋)
6 splval2.c . . . . 5 (𝜑𝐶 ∈ Word 𝑋)
7 ccatcl 13354 . . . . 5 (((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) → ((𝐴 ++ 𝐵) ++ 𝐶) ∈ Word 𝑋)
85, 6, 7syl2anc 693 . . . 4 (𝜑 → ((𝐴 ++ 𝐵) ++ 𝐶) ∈ Word 𝑋)
91, 8eqeltrd 2700 . . 3 (𝜑𝑆 ∈ Word 𝑋)
10 splval2.f . . . 4 (𝜑𝐹 = (#‘𝐴))
11 lencl 13319 . . . . 5 (𝐴 ∈ Word 𝑋 → (#‘𝐴) ∈ ℕ0)
122, 11syl 17 . . . 4 (𝜑 → (#‘𝐴) ∈ ℕ0)
1310, 12eqeltrd 2700 . . 3 (𝜑𝐹 ∈ ℕ0)
14 splval2.t . . . 4 (𝜑𝑇 = (𝐹 + (#‘𝐵)))
15 lencl 13319 . . . . . 6 (𝐵 ∈ Word 𝑋 → (#‘𝐵) ∈ ℕ0)
163, 15syl 17 . . . . 5 (𝜑 → (#‘𝐵) ∈ ℕ0)
1713, 16nn0addcld 11352 . . . 4 (𝜑 → (𝐹 + (#‘𝐵)) ∈ ℕ0)
1814, 17eqeltrd 2700 . . 3 (𝜑𝑇 ∈ ℕ0)
19 splval2.r . . 3 (𝜑𝑅 ∈ Word 𝑋)
20 splval 13496 . . 3 ((𝑆 ∈ Word 𝑋 ∧ (𝐹 ∈ ℕ0𝑇 ∈ ℕ0𝑅 ∈ Word 𝑋)) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)))
219, 13, 18, 19, 20syl13anc 1327 . 2 (𝜑 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)))
22 nn0uz 11719 . . . . . . . . . 10 0 = (ℤ‘0)
2313, 22syl6eleq 2710 . . . . . . . . 9 (𝜑𝐹 ∈ (ℤ‘0))
24 eluzfz1 12345 . . . . . . . . 9 (𝐹 ∈ (ℤ‘0) → 0 ∈ (0...𝐹))
2523, 24syl 17 . . . . . . . 8 (𝜑 → 0 ∈ (0...𝐹))
2613nn0zd 11477 . . . . . . . . . . . 12 (𝜑𝐹 ∈ ℤ)
27 uzid 11699 . . . . . . . . . . . 12 (𝐹 ∈ ℤ → 𝐹 ∈ (ℤ𝐹))
2826, 27syl 17 . . . . . . . . . . 11 (𝜑𝐹 ∈ (ℤ𝐹))
29 uzaddcl 11741 . . . . . . . . . . 11 ((𝐹 ∈ (ℤ𝐹) ∧ (#‘𝐵) ∈ ℕ0) → (𝐹 + (#‘𝐵)) ∈ (ℤ𝐹))
3028, 16, 29syl2anc 693 . . . . . . . . . 10 (𝜑 → (𝐹 + (#‘𝐵)) ∈ (ℤ𝐹))
3114, 30eqeltrd 2700 . . . . . . . . 9 (𝜑𝑇 ∈ (ℤ𝐹))
32 elfzuzb 12333 . . . . . . . . 9 (𝐹 ∈ (0...𝑇) ↔ (𝐹 ∈ (ℤ‘0) ∧ 𝑇 ∈ (ℤ𝐹)))
3323, 31, 32sylanbrc 698 . . . . . . . 8 (𝜑𝐹 ∈ (0...𝑇))
3418, 22syl6eleq 2710 . . . . . . . . 9 (𝜑𝑇 ∈ (ℤ‘0))
35 ccatlen 13355 . . . . . . . . . . . 12 (((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) → (#‘((𝐴 ++ 𝐵) ++ 𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
365, 6, 35syl2anc 693 . . . . . . . . . . 11 (𝜑 → (#‘((𝐴 ++ 𝐵) ++ 𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
371fveq2d 6193 . . . . . . . . . . 11 (𝜑 → (#‘𝑆) = (#‘((𝐴 ++ 𝐵) ++ 𝐶)))
3810oveq1d 6662 . . . . . . . . . . . . 13 (𝜑 → (𝐹 + (#‘𝐵)) = ((#‘𝐴) + (#‘𝐵)))
39 ccatlen 13355 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (#‘(𝐴 ++ 𝐵)) = ((#‘𝐴) + (#‘𝐵)))
402, 3, 39syl2anc 693 . . . . . . . . . . . . 13 (𝜑 → (#‘(𝐴 ++ 𝐵)) = ((#‘𝐴) + (#‘𝐵)))
4138, 14, 403eqtr4d 2665 . . . . . . . . . . . 12 (𝜑𝑇 = (#‘(𝐴 ++ 𝐵)))
4241oveq1d 6662 . . . . . . . . . . 11 (𝜑 → (𝑇 + (#‘𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
4336, 37, 423eqtr4d 2665 . . . . . . . . . 10 (𝜑 → (#‘𝑆) = (𝑇 + (#‘𝐶)))
4418nn0zd 11477 . . . . . . . . . . . 12 (𝜑𝑇 ∈ ℤ)
45 uzid 11699 . . . . . . . . . . . 12 (𝑇 ∈ ℤ → 𝑇 ∈ (ℤ𝑇))
4644, 45syl 17 . . . . . . . . . . 11 (𝜑𝑇 ∈ (ℤ𝑇))
47 lencl 13319 . . . . . . . . . . . 12 (𝐶 ∈ Word 𝑋 → (#‘𝐶) ∈ ℕ0)
486, 47syl 17 . . . . . . . . . . 11 (𝜑 → (#‘𝐶) ∈ ℕ0)
49 uzaddcl 11741 . . . . . . . . . . 11 ((𝑇 ∈ (ℤ𝑇) ∧ (#‘𝐶) ∈ ℕ0) → (𝑇 + (#‘𝐶)) ∈ (ℤ𝑇))
5046, 48, 49syl2anc 693 . . . . . . . . . 10 (𝜑 → (𝑇 + (#‘𝐶)) ∈ (ℤ𝑇))
5143, 50eqeltrd 2700 . . . . . . . . 9 (𝜑 → (#‘𝑆) ∈ (ℤ𝑇))
52 elfzuzb 12333 . . . . . . . . 9 (𝑇 ∈ (0...(#‘𝑆)) ↔ (𝑇 ∈ (ℤ‘0) ∧ (#‘𝑆) ∈ (ℤ𝑇)))
5334, 51, 52sylanbrc 698 . . . . . . . 8 (𝜑𝑇 ∈ (0...(#‘𝑆)))
54 ccatswrd 13450 . . . . . . . 8 ((𝑆 ∈ Word 𝑋 ∧ (0 ∈ (0...𝐹) ∧ 𝐹 ∈ (0...𝑇) ∧ 𝑇 ∈ (0...(#‘𝑆)))) → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝑆 substr ⟨0, 𝑇⟩))
559, 25, 33, 53, 54syl13anc 1327 . . . . . . 7 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝑆 substr ⟨0, 𝑇⟩))
56 eluzfz1 12345 . . . . . . . . . . . 12 (𝑇 ∈ (ℤ‘0) → 0 ∈ (0...𝑇))
5734, 56syl 17 . . . . . . . . . . 11 (𝜑 → 0 ∈ (0...𝑇))
58 lencl 13319 . . . . . . . . . . . . . 14 (𝑆 ∈ Word 𝑋 → (#‘𝑆) ∈ ℕ0)
599, 58syl 17 . . . . . . . . . . . . 13 (𝜑 → (#‘𝑆) ∈ ℕ0)
6059, 22syl6eleq 2710 . . . . . . . . . . . 12 (𝜑 → (#‘𝑆) ∈ (ℤ‘0))
61 eluzfz2 12346 . . . . . . . . . . . 12 ((#‘𝑆) ∈ (ℤ‘0) → (#‘𝑆) ∈ (0...(#‘𝑆)))
6260, 61syl 17 . . . . . . . . . . 11 (𝜑 → (#‘𝑆) ∈ (0...(#‘𝑆)))
63 ccatswrd 13450 . . . . . . . . . . 11 ((𝑆 ∈ Word 𝑋 ∧ (0 ∈ (0...𝑇) ∧ 𝑇 ∈ (0...(#‘𝑆)) ∧ (#‘𝑆) ∈ (0...(#‘𝑆)))) → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = (𝑆 substr ⟨0, (#‘𝑆)⟩))
649, 57, 53, 62, 63syl13anc 1327 . . . . . . . . . 10 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = (𝑆 substr ⟨0, (#‘𝑆)⟩))
65 swrdid 13422 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, (#‘𝑆)⟩) = 𝑆)
669, 65syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨0, (#‘𝑆)⟩) = 𝑆)
6764, 66, 13eqtrd 2659 . . . . . . . . 9 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶))
68 swrdcl 13413 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋)
699, 68syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋)
70 swrdcl 13413 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋)
719, 70syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋)
72 swrd0len 13416 . . . . . . . . . . . 12 ((𝑆 ∈ Word 𝑋𝑇 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = 𝑇)
739, 53, 72syl2anc 693 . . . . . . . . . . 11 (𝜑 → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = 𝑇)
7473, 41eqtrd 2655 . . . . . . . . . 10 (𝜑 → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = (#‘(𝐴 ++ 𝐵)))
75 ccatopth 13464 . . . . . . . . . 10 ((((𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋 ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋) ∧ ((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) ∧ (#‘(𝑆 substr ⟨0, 𝑇⟩)) = (#‘(𝐴 ++ 𝐵))) → (((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶) ↔ ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)))
7669, 71, 5, 6, 74, 75syl221anc 1336 . . . . . . . . 9 (𝜑 → (((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶) ↔ ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)))
7767, 76mpbid 222 . . . . . . . 8 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶))
7877simpld 475 . . . . . . 7 (𝜑 → (𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵))
7955, 78eqtrd 2655 . . . . . 6 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵))
80 swrdcl 13413 . . . . . . . 8 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋)
819, 80syl 17 . . . . . . 7 (𝜑 → (𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋)
82 swrdcl 13413 . . . . . . . 8 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋)
839, 82syl 17 . . . . . . 7 (𝜑 → (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋)
84 uztrn 11701 . . . . . . . . . . 11 (((#‘𝑆) ∈ (ℤ𝑇) ∧ 𝑇 ∈ (ℤ𝐹)) → (#‘𝑆) ∈ (ℤ𝐹))
8551, 31, 84syl2anc 693 . . . . . . . . . 10 (𝜑 → (#‘𝑆) ∈ (ℤ𝐹))
86 elfzuzb 12333 . . . . . . . . . 10 (𝐹 ∈ (0...(#‘𝑆)) ↔ (𝐹 ∈ (ℤ‘0) ∧ (#‘𝑆) ∈ (ℤ𝐹)))
8723, 85, 86sylanbrc 698 . . . . . . . . 9 (𝜑𝐹 ∈ (0...(#‘𝑆)))
88 swrd0len 13416 . . . . . . . . 9 ((𝑆 ∈ Word 𝑋𝐹 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = 𝐹)
899, 87, 88syl2anc 693 . . . . . . . 8 (𝜑 → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = 𝐹)
9089, 10eqtrd 2655 . . . . . . 7 (𝜑 → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = (#‘𝐴))
91 ccatopth 13464 . . . . . . 7 ((((𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋) ∧ (𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (#‘(𝑆 substr ⟨0, 𝐹⟩)) = (#‘𝐴)) → (((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵) ↔ ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵)))
9281, 83, 2, 3, 90, 91syl221anc 1336 . . . . . 6 (𝜑 → (((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵) ↔ ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵)))
9379, 92mpbid 222 . . . . 5 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵))
9493simpld 475 . . . 4 (𝜑 → (𝑆 substr ⟨0, 𝐹⟩) = 𝐴)
9594oveq1d 6662 . . 3 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) = (𝐴 ++ 𝑅))
9677simprd 479 . . 3 (𝜑 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)
9795, 96oveq12d 6665 . 2 (𝜑 → (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝑅) ++ 𝐶))
9821, 97eqtrd 2655 1 (𝜑 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = ((𝐴 ++ 𝑅) ++ 𝐶))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 196  wa 384   = wceq 1482  wcel 1989  cop 4181  cotp 4183  cfv 5886  (class class class)co 6647  0cc0 9933   + caddc 9936  0cn0 11289  cz 11374  cuz 11684  ...cfz 12323  #chash 13112  Word cword 13286   ++ cconcat 13288   substr csubstr 13290   splice csplice 13291
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1721  ax-4 1736  ax-5 1838  ax-6 1887  ax-7 1934  ax-8 1991  ax-9 1998  ax-10 2018  ax-11 2033  ax-12 2046  ax-13 2245  ax-ext 2601  ax-rep 4769  ax-sep 4779  ax-nul 4787  ax-pow 4841  ax-pr 4904  ax-un 6946  ax-cnex 9989  ax-resscn 9990  ax-1cn 9991  ax-icn 9992  ax-addcl 9993  ax-addrcl 9994  ax-mulcl 9995  ax-mulrcl 9996  ax-mulcom 9997  ax-addass 9998  ax-mulass 9999  ax-distr 10000  ax-i2m1 10001  ax-1ne0 10002  ax-1rid 10003  ax-rnegex 10004  ax-rrecex 10005  ax-cnre 10006  ax-pre-lttri 10007  ax-pre-lttrn 10008  ax-pre-ltadd 10009  ax-pre-mulgt0 10010
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3or 1038  df-3an 1039  df-tru 1485  df-ex 1704  df-nf 1709  df-sb 1880  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2752  df-ne 2794  df-nel 2897  df-ral 2916  df-rex 2917  df-reu 2918  df-rab 2920  df-v 3200  df-sbc 3434  df-csb 3532  df-dif 3575  df-un 3577  df-in 3579  df-ss 3586  df-pss 3588  df-nul 3914  df-if 4085  df-pw 4158  df-sn 4176  df-pr 4178  df-tp 4180  df-op 4182  df-ot 4184  df-uni 4435  df-int 4474  df-iun 4520  df-br 4652  df-opab 4711  df-mpt 4728  df-tr 4751  df-id 5022  df-eprel 5027  df-po 5033  df-so 5034  df-fr 5071  df-we 5073  df-xp 5118  df-rel 5119  df-cnv 5120  df-co 5121  df-dm 5122  df-rn 5123  df-res 5124  df-ima 5125  df-pred 5678  df-ord 5724  df-on 5725  df-lim 5726  df-suc 5727  df-iota 5849  df-fun 5888  df-fn 5889  df-f 5890  df-f1 5891  df-fo 5892  df-f1o 5893  df-fv 5894  df-riota 6608  df-ov 6650  df-oprab 6651  df-mpt2 6652  df-om 7063  df-1st 7165  df-2nd 7166  df-wrecs 7404  df-recs 7465  df-rdg 7503  df-1o 7557  df-oadd 7561  df-er 7739  df-en 7953  df-dom 7954  df-sdom 7955  df-fin 7956  df-card 8762  df-pnf 10073  df-mnf 10074  df-xr 10075  df-ltxr 10076  df-le 10077  df-sub 10265  df-neg 10266  df-nn 11018  df-n0 11290  df-z 11375  df-uz 11685  df-fz 12324  df-fzo 12462  df-hash 13113  df-word 13294  df-concat 13296  df-substr 13298  df-splice 13299
This theorem is referenced by:  efginvrel2  18134  efgredleme  18150  efgcpbllemb  18162  frgpnabllem1  18270
  Copyright terms: Public domain W3C validator