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

Theorem splval2 13301
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 13154 . . . . . 6 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (𝐴 ++ 𝐵) ∈ Word 𝑋)
52, 3, 4syl2anc 690 . . . . 5 (𝜑 → (𝐴 ++ 𝐵) ∈ Word 𝑋)
6 splval2.c . . . . 5 (𝜑𝐶 ∈ Word 𝑋)
7 ccatcl 13154 . . . . 5 (((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) → ((𝐴 ++ 𝐵) ++ 𝐶) ∈ Word 𝑋)
85, 6, 7syl2anc 690 . . . 4 (𝜑 → ((𝐴 ++ 𝐵) ++ 𝐶) ∈ Word 𝑋)
91, 8eqeltrd 2683 . . 3 (𝜑𝑆 ∈ Word 𝑋)
10 splval2.f . . . 4 (𝜑𝐹 = (#‘𝐴))
11 lencl 13121 . . . . 5 (𝐴 ∈ Word 𝑋 → (#‘𝐴) ∈ ℕ0)
122, 11syl 17 . . . 4 (𝜑 → (#‘𝐴) ∈ ℕ0)
1310, 12eqeltrd 2683 . . 3 (𝜑𝐹 ∈ ℕ0)
14 splval2.t . . . 4 (𝜑𝑇 = (𝐹 + (#‘𝐵)))
15 lencl 13121 . . . . . 6 (𝐵 ∈ Word 𝑋 → (#‘𝐵) ∈ ℕ0)
163, 15syl 17 . . . . 5 (𝜑 → (#‘𝐵) ∈ ℕ0)
1713, 16nn0addcld 11198 . . . 4 (𝜑 → (𝐹 + (#‘𝐵)) ∈ ℕ0)
1814, 17eqeltrd 2683 . . 3 (𝜑𝑇 ∈ ℕ0)
19 splval2.r . . 3 (𝜑𝑅 ∈ Word 𝑋)
20 splval 13295 . . 3 ((𝑆 ∈ Word 𝑋 ∧ (𝐹 ∈ ℕ0𝑇 ∈ ℕ0𝑅 ∈ Word 𝑋)) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)))
219, 13, 18, 19, 20syl13anc 1319 . 2 (𝜑 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)))
22 nn0uz 11550 . . . . . . . . . 10 0 = (ℤ‘0)
2313, 22syl6eleq 2693 . . . . . . . . 9 (𝜑𝐹 ∈ (ℤ‘0))
24 eluzfz1 12170 . . . . . . . . 9 (𝐹 ∈ (ℤ‘0) → 0 ∈ (0...𝐹))
2523, 24syl 17 . . . . . . . 8 (𝜑 → 0 ∈ (0...𝐹))
2613nn0zd 11308 . . . . . . . . . . . 12 (𝜑𝐹 ∈ ℤ)
27 uzid 11530 . . . . . . . . . . . 12 (𝐹 ∈ ℤ → 𝐹 ∈ (ℤ𝐹))
2826, 27syl 17 . . . . . . . . . . 11 (𝜑𝐹 ∈ (ℤ𝐹))
29 uzaddcl 11572 . . . . . . . . . . 11 ((𝐹 ∈ (ℤ𝐹) ∧ (#‘𝐵) ∈ ℕ0) → (𝐹 + (#‘𝐵)) ∈ (ℤ𝐹))
3028, 16, 29syl2anc 690 . . . . . . . . . 10 (𝜑 → (𝐹 + (#‘𝐵)) ∈ (ℤ𝐹))
3114, 30eqeltrd 2683 . . . . . . . . 9 (𝜑𝑇 ∈ (ℤ𝐹))
32 elfzuzb 12158 . . . . . . . . 9 (𝐹 ∈ (0...𝑇) ↔ (𝐹 ∈ (ℤ‘0) ∧ 𝑇 ∈ (ℤ𝐹)))
3323, 31, 32sylanbrc 694 . . . . . . . 8 (𝜑𝐹 ∈ (0...𝑇))
3418, 22syl6eleq 2693 . . . . . . . . 9 (𝜑𝑇 ∈ (ℤ‘0))
35 ccatlen 13155 . . . . . . . . . . . 12 (((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) → (#‘((𝐴 ++ 𝐵) ++ 𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
365, 6, 35syl2anc 690 . . . . . . . . . . 11 (𝜑 → (#‘((𝐴 ++ 𝐵) ++ 𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
371fveq2d 6088 . . . . . . . . . . 11 (𝜑 → (#‘𝑆) = (#‘((𝐴 ++ 𝐵) ++ 𝐶)))
3810oveq1d 6538 . . . . . . . . . . . . 13 (𝜑 → (𝐹 + (#‘𝐵)) = ((#‘𝐴) + (#‘𝐵)))
39 ccatlen 13155 . . . . . . . . . . . . . 14 ((𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) → (#‘(𝐴 ++ 𝐵)) = ((#‘𝐴) + (#‘𝐵)))
402, 3, 39syl2anc 690 . . . . . . . . . . . . 13 (𝜑 → (#‘(𝐴 ++ 𝐵)) = ((#‘𝐴) + (#‘𝐵)))
4138, 14, 403eqtr4d 2649 . . . . . . . . . . . 12 (𝜑𝑇 = (#‘(𝐴 ++ 𝐵)))
4241oveq1d 6538 . . . . . . . . . . 11 (𝜑 → (𝑇 + (#‘𝐶)) = ((#‘(𝐴 ++ 𝐵)) + (#‘𝐶)))
4336, 37, 423eqtr4d 2649 . . . . . . . . . 10 (𝜑 → (#‘𝑆) = (𝑇 + (#‘𝐶)))
4418nn0zd 11308 . . . . . . . . . . . 12 (𝜑𝑇 ∈ ℤ)
45 uzid 11530 . . . . . . . . . . . 12 (𝑇 ∈ ℤ → 𝑇 ∈ (ℤ𝑇))
4644, 45syl 17 . . . . . . . . . . 11 (𝜑𝑇 ∈ (ℤ𝑇))
47 lencl 13121 . . . . . . . . . . . 12 (𝐶 ∈ Word 𝑋 → (#‘𝐶) ∈ ℕ0)
486, 47syl 17 . . . . . . . . . . 11 (𝜑 → (#‘𝐶) ∈ ℕ0)
49 uzaddcl 11572 . . . . . . . . . . 11 ((𝑇 ∈ (ℤ𝑇) ∧ (#‘𝐶) ∈ ℕ0) → (𝑇 + (#‘𝐶)) ∈ (ℤ𝑇))
5046, 48, 49syl2anc 690 . . . . . . . . . 10 (𝜑 → (𝑇 + (#‘𝐶)) ∈ (ℤ𝑇))
5143, 50eqeltrd 2683 . . . . . . . . 9 (𝜑 → (#‘𝑆) ∈ (ℤ𝑇))
52 elfzuzb 12158 . . . . . . . . 9 (𝑇 ∈ (0...(#‘𝑆)) ↔ (𝑇 ∈ (ℤ‘0) ∧ (#‘𝑆) ∈ (ℤ𝑇)))
5334, 51, 52sylanbrc 694 . . . . . . . 8 (𝜑𝑇 ∈ (0...(#‘𝑆)))
54 ccatswrd 13250 . . . . . . . 8 ((𝑆 ∈ Word 𝑋 ∧ (0 ∈ (0...𝐹) ∧ 𝐹 ∈ (0...𝑇) ∧ 𝑇 ∈ (0...(#‘𝑆)))) → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝑆 substr ⟨0, 𝑇⟩))
559, 25, 33, 53, 54syl13anc 1319 . . . . . . 7 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝑆 substr ⟨0, 𝑇⟩))
56 eluzfz1 12170 . . . . . . . . . . . 12 (𝑇 ∈ (ℤ‘0) → 0 ∈ (0...𝑇))
5734, 56syl 17 . . . . . . . . . . 11 (𝜑 → 0 ∈ (0...𝑇))
58 lencl 13121 . . . . . . . . . . . . . 14 (𝑆 ∈ Word 𝑋 → (#‘𝑆) ∈ ℕ0)
599, 58syl 17 . . . . . . . . . . . . 13 (𝜑 → (#‘𝑆) ∈ ℕ0)
6059, 22syl6eleq 2693 . . . . . . . . . . . 12 (𝜑 → (#‘𝑆) ∈ (ℤ‘0))
61 eluzfz2 12171 . . . . . . . . . . . 12 ((#‘𝑆) ∈ (ℤ‘0) → (#‘𝑆) ∈ (0...(#‘𝑆)))
6260, 61syl 17 . . . . . . . . . . 11 (𝜑 → (#‘𝑆) ∈ (0...(#‘𝑆)))
63 ccatswrd 13250 . . . . . . . . . . 11 ((𝑆 ∈ Word 𝑋 ∧ (0 ∈ (0...𝑇) ∧ 𝑇 ∈ (0...(#‘𝑆)) ∧ (#‘𝑆) ∈ (0...(#‘𝑆)))) → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = (𝑆 substr ⟨0, (#‘𝑆)⟩))
649, 57, 53, 62, 63syl13anc 1319 . . . . . . . . . 10 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = (𝑆 substr ⟨0, (#‘𝑆)⟩))
65 swrdid 13222 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, (#‘𝑆)⟩) = 𝑆)
669, 65syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨0, (#‘𝑆)⟩) = 𝑆)
6764, 66, 13eqtrd 2643 . . . . . . . . 9 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶))
68 swrdcl 13213 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋)
699, 68syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋)
70 swrdcl 13213 . . . . . . . . . . 11 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋)
719, 70syl 17 . . . . . . . . . 10 (𝜑 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋)
72 swrd0len 13216 . . . . . . . . . . . 12 ((𝑆 ∈ Word 𝑋𝑇 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = 𝑇)
739, 53, 72syl2anc 690 . . . . . . . . . . 11 (𝜑 → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = 𝑇)
7473, 41eqtrd 2639 . . . . . . . . . 10 (𝜑 → (#‘(𝑆 substr ⟨0, 𝑇⟩)) = (#‘(𝐴 ++ 𝐵)))
75 ccatopth 13264 . . . . . . . . . 10 ((((𝑆 substr ⟨0, 𝑇⟩) ∈ Word 𝑋 ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) ∈ Word 𝑋) ∧ ((𝐴 ++ 𝐵) ∈ Word 𝑋𝐶 ∈ Word 𝑋) ∧ (#‘(𝑆 substr ⟨0, 𝑇⟩)) = (#‘(𝐴 ++ 𝐵))) → (((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶) ↔ ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)))
7669, 71, 5, 6, 74, 75syl221anc 1328 . . . . . . . . 9 (𝜑 → (((𝑆 substr ⟨0, 𝑇⟩) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝐵) ++ 𝐶) ↔ ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)))
7767, 76mpbid 220 . . . . . . . 8 (𝜑 → ((𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵) ∧ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶))
7877simpld 473 . . . . . . 7 (𝜑 → (𝑆 substr ⟨0, 𝑇⟩) = (𝐴 ++ 𝐵))
7955, 78eqtrd 2639 . . . . . 6 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵))
80 swrdcl 13213 . . . . . . . 8 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋)
819, 80syl 17 . . . . . . 7 (𝜑 → (𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋)
82 swrdcl 13213 . . . . . . . 8 (𝑆 ∈ Word 𝑋 → (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋)
839, 82syl 17 . . . . . . 7 (𝜑 → (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋)
84 uztrn 11532 . . . . . . . . . . 11 (((#‘𝑆) ∈ (ℤ𝑇) ∧ 𝑇 ∈ (ℤ𝐹)) → (#‘𝑆) ∈ (ℤ𝐹))
8551, 31, 84syl2anc 690 . . . . . . . . . 10 (𝜑 → (#‘𝑆) ∈ (ℤ𝐹))
86 elfzuzb 12158 . . . . . . . . . 10 (𝐹 ∈ (0...(#‘𝑆)) ↔ (𝐹 ∈ (ℤ‘0) ∧ (#‘𝑆) ∈ (ℤ𝐹)))
8723, 85, 86sylanbrc 694 . . . . . . . . 9 (𝜑𝐹 ∈ (0...(#‘𝑆)))
88 swrd0len 13216 . . . . . . . . 9 ((𝑆 ∈ Word 𝑋𝐹 ∈ (0...(#‘𝑆))) → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = 𝐹)
899, 87, 88syl2anc 690 . . . . . . . 8 (𝜑 → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = 𝐹)
9089, 10eqtrd 2639 . . . . . . 7 (𝜑 → (#‘(𝑆 substr ⟨0, 𝐹⟩)) = (#‘𝐴))
91 ccatopth 13264 . . . . . . 7 ((((𝑆 substr ⟨0, 𝐹⟩) ∈ Word 𝑋 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) ∈ Word 𝑋) ∧ (𝐴 ∈ Word 𝑋𝐵 ∈ Word 𝑋) ∧ (#‘(𝑆 substr ⟨0, 𝐹⟩)) = (#‘𝐴)) → (((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵) ↔ ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵)))
9281, 83, 2, 3, 90, 91syl221anc 1328 . . . . . 6 (𝜑 → (((𝑆 substr ⟨0, 𝐹⟩) ++ (𝑆 substr ⟨𝐹, 𝑇⟩)) = (𝐴 ++ 𝐵) ↔ ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵)))
9379, 92mpbid 220 . . . . 5 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) = 𝐴 ∧ (𝑆 substr ⟨𝐹, 𝑇⟩) = 𝐵))
9493simpld 473 . . . 4 (𝜑 → (𝑆 substr ⟨0, 𝐹⟩) = 𝐴)
9594oveq1d 6538 . . 3 (𝜑 → ((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) = (𝐴 ++ 𝑅))
9677simprd 477 . . 3 (𝜑 → (𝑆 substr ⟨𝑇, (#‘𝑆)⟩) = 𝐶)
9795, 96oveq12d 6541 . 2 (𝜑 → (((𝑆 substr ⟨0, 𝐹⟩) ++ 𝑅) ++ (𝑆 substr ⟨𝑇, (#‘𝑆)⟩)) = ((𝐴 ++ 𝑅) ++ 𝐶))
9821, 97eqtrd 2639 1 (𝜑 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = ((𝐴 ++ 𝑅) ++ 𝐶))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 194  wa 382   = wceq 1474  wcel 1975  cop 4126  cotp 4128  cfv 5786  (class class class)co 6523  0cc0 9788   + caddc 9791  0cn0 11135  cz 11206  cuz 11515  ...cfz 12148  #chash 12930  Word cword 13088   ++ cconcat 13090   substr csubstr 13092   splice csplice 13093
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1711  ax-4 1726  ax-5 1825  ax-6 1873  ax-7 1920  ax-8 1977  ax-9 1984  ax-10 2004  ax-11 2019  ax-12 2031  ax-13 2228  ax-ext 2585  ax-rep 4689  ax-sep 4699  ax-nul 4708  ax-pow 4760  ax-pr 4824  ax-un 6820  ax-cnex 9844  ax-resscn 9845  ax-1cn 9846  ax-icn 9847  ax-addcl 9848  ax-addrcl 9849  ax-mulcl 9850  ax-mulrcl 9851  ax-mulcom 9852  ax-addass 9853  ax-mulass 9854  ax-distr 9855  ax-i2m1 9856  ax-1ne0 9857  ax-1rid 9858  ax-rnegex 9859  ax-rrecex 9860  ax-cnre 9861  ax-pre-lttri 9862  ax-pre-lttrn 9863  ax-pre-ltadd 9864  ax-pre-mulgt0 9865
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1866  df-eu 2457  df-mo 2458  df-clab 2592  df-cleq 2598  df-clel 2601  df-nfc 2735  df-ne 2777  df-nel 2778  df-ral 2896  df-rex 2897  df-reu 2898  df-rab 2900  df-v 3170  df-sbc 3398  df-csb 3495  df-dif 3538  df-un 3540  df-in 3542  df-ss 3549  df-pss 3551  df-nul 3870  df-if 4032  df-pw 4105  df-sn 4121  df-pr 4123  df-tp 4125  df-op 4127  df-ot 4129  df-uni 4363  df-int 4401  df-iun 4447  df-br 4574  df-opab 4634  df-mpt 4635  df-tr 4671  df-eprel 4935  df-id 4939  df-po 4945  df-so 4946  df-fr 4983  df-we 4985  df-xp 5030  df-rel 5031  df-cnv 5032  df-co 5033  df-dm 5034  df-rn 5035  df-res 5036  df-ima 5037  df-pred 5579  df-ord 5625  df-on 5626  df-lim 5627  df-suc 5628  df-iota 5750  df-fun 5788  df-fn 5789  df-f 5790  df-f1 5791  df-fo 5792  df-f1o 5793  df-fv 5794  df-riota 6485  df-ov 6526  df-oprab 6527  df-mpt2 6528  df-om 6931  df-1st 7032  df-2nd 7033  df-wrecs 7267  df-recs 7328  df-rdg 7366  df-1o 7420  df-oadd 7424  df-er 7602  df-en 7815  df-dom 7816  df-sdom 7817  df-fin 7818  df-card 8621  df-pnf 9928  df-mnf 9929  df-xr 9930  df-ltxr 9931  df-le 9932  df-sub 10115  df-neg 10116  df-nn 10864  df-n0 11136  df-z 11207  df-uz 11516  df-fz 12149  df-fzo 12286  df-hash 12931  df-word 13096  df-concat 13098  df-substr 13100  df-splice 13101
This theorem is referenced by:  efginvrel2  17905  efgredleme  17921  efgcpbllemb  17933  frgpnabllem1  18041
  Copyright terms: Public domain W3C validator