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

Theorem splval2 11472
Description: Value of a splice, assuming the input word  S has already been decomposed into its pieces. (Contributed by Mario Carneiro, 1-Oct-2015.)
Hypotheses
Ref Expression
splval2.a  |-  ( ph  ->  A  e. Word  X )
splval2.b  |-  ( ph  ->  B  e. Word  X )
splval2.c  |-  ( ph  ->  C  e. Word  X )
splval2.r  |-  ( ph  ->  R  e. Word  X )
splval2.s  |-  ( ph  ->  S  =  ( ( A concat  B ) concat  C
) )
splval2.f  |-  ( ph  ->  F  =  ( # `  A ) )
splval2.t  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
Assertion
Ref Expression
splval2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A concat  R ) concat  C ) )

Proof of Theorem splval2
StepHypRef Expression
1 splval2.s . . . 4  |-  ( ph  ->  S  =  ( ( A concat  B ) concat  C
) )
2 splval2.a . . . . . 6  |-  ( ph  ->  A  e. Word  X )
3 splval2.b . . . . . 6  |-  ( ph  ->  B  e. Word  X )
4 ccatcl 11429 . . . . . 6  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( A concat  B )  e. Word  X )
52, 3, 4syl2anc 642 . . . . 5  |-  ( ph  ->  ( A concat  B )  e. Word  X )
6 splval2.c . . . . 5  |-  ( ph  ->  C  e. Word  X )
7 ccatcl 11429 . . . . 5  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  (
( A concat  B ) concat  C )  e. Word  X )
85, 6, 7syl2anc 642 . . . 4  |-  ( ph  ->  ( ( A concat  B
) concat  C )  e. Word  X
)
91, 8eqeltrd 2357 . . 3  |-  ( ph  ->  S  e. Word  X )
10 splval2.f . . . 4  |-  ( ph  ->  F  =  ( # `  A ) )
11 lencl 11421 . . . . 5  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
122, 11syl 15 . . . 4  |-  ( ph  ->  ( # `  A
)  e.  NN0 )
1310, 12eqeltrd 2357 . . 3  |-  ( ph  ->  F  e.  NN0 )
14 splval2.t . . . 4  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
15 lencl 11421 . . . . . 6  |-  ( B  e. Word  X  ->  ( # `
 B )  e. 
NN0 )
163, 15syl 15 . . . . 5  |-  ( ph  ->  ( # `  B
)  e.  NN0 )
1713, 16nn0addcld 10022 . . . 4  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  NN0 )
1814, 17eqeltrd 2357 . . 3  |-  ( ph  ->  T  e.  NN0 )
19 splval2.r . . 3  |-  ( ph  ->  R  e. Word  X )
20 splval 11466 . . 3  |-  ( ( S  e. Word  X  /\  ( F  e.  NN0  /\  T  e.  NN0  /\  R  e. Word  X )
)  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
219, 13, 18, 19, 20syl13anc 1184 . 2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
22 nn0uz 10262 . . . . . . . . . 10  |-  NN0  =  ( ZZ>= `  0 )
2313, 22syl6eleq 2373 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
24 eluzfz1 10803 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
2523, 24syl 15 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
2613nn0zd 10115 . . . . . . . . . . . 12  |-  ( ph  ->  F  e.  ZZ )
27 uzid 10242 . . . . . . . . . . . 12  |-  ( F  e.  ZZ  ->  F  e.  ( ZZ>= `  F )
)
2826, 27syl 15 . . . . . . . . . . 11  |-  ( ph  ->  F  e.  ( ZZ>= `  F ) )
29 uzaddcl 10275 . . . . . . . . . . 11  |-  ( ( F  e.  ( ZZ>= `  F )  /\  ( # `
 B )  e. 
NN0 )  ->  ( F  +  ( # `  B
) )  e.  (
ZZ>= `  F ) )
3028, 16, 29syl2anc 642 . . . . . . . . . 10  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  ( ZZ>= `  F ) )
3114, 30eqeltrd 2357 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
32 elfzuzb 10792 . . . . . . . . 9  |-  ( F  e.  ( 0 ... T )  <->  ( F  e.  ( ZZ>= `  0 )  /\  T  e.  ( ZZ>=
`  F ) ) )
3323, 31, 32sylanbrc 645 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3418, 22syl6eleq 2373 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= ` 
0 ) )
35 ccatlen 11430 . . . . . . . . . . . 12  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  ( # `
 ( ( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C ) ) )
365, 6, 35syl2anc 642 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  (
( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C
) ) )
371fveq2d 5529 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  =  ( # `  ( ( A concat  B
) concat  C ) ) )
3810oveq1d 5873 . . . . . . . . . . . . 13  |-  ( ph  ->  ( F  +  (
# `  B )
)  =  ( (
# `  A )  +  ( # `  B
) ) )
39 ccatlen 11430 . . . . . . . . . . . . . 14  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
402, 3, 39syl2anc 642 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4138, 14, 403eqtr4d 2325 . . . . . . . . . . . 12  |-  ( ph  ->  T  =  ( # `  ( A concat  B ) ) )
4241oveq1d 5873 . . . . . . . . . . 11  |-  ( ph  ->  ( T  +  (
# `  C )
)  =  ( (
# `  ( A concat  B ) )  +  (
# `  C )
) )
4336, 37, 423eqtr4d 2325 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  =  ( T  +  ( # `  C
) ) )
4418nn0zd 10115 . . . . . . . . . . . 12  |-  ( ph  ->  T  e.  ZZ )
45 uzid 10242 . . . . . . . . . . . 12  |-  ( T  e.  ZZ  ->  T  e.  ( ZZ>= `  T )
)
4644, 45syl 15 . . . . . . . . . . 11  |-  ( ph  ->  T  e.  ( ZZ>= `  T ) )
47 lencl 11421 . . . . . . . . . . . 12  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
486, 47syl 15 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  C
)  e.  NN0 )
49 uzaddcl 10275 . . . . . . . . . . 11  |-  ( ( T  e.  ( ZZ>= `  T )  /\  ( # `
 C )  e. 
NN0 )  ->  ( T  +  ( # `  C
) )  e.  (
ZZ>= `  T ) )
5046, 48, 49syl2anc 642 . . . . . . . . . 10  |-  ( ph  ->  ( T  +  (
# `  C )
)  e.  ( ZZ>= `  T ) )
5143, 50eqeltrd 2357 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
52 elfzuzb 10792 . . . . . . . . 9  |-  ( T  e.  ( 0 ... ( # `  S
) )  <->  ( T  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  T ) ) )
5334, 51, 52sylanbrc 645 . . . . . . . 8  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
54 ccatswrd 11459 . . . . . . . 8  |-  ( ( S  e. Word  X  /\  ( 0  e.  ( 0 ... F )  /\  F  e.  ( 0 ... T )  /\  T  e.  ( 0 ... ( # `  S ) ) ) )  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
559, 25, 33, 53, 54syl13anc 1184 . . . . . . 7  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
56 eluzfz1 10803 . . . . . . . . . . . 12  |-  ( T  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... T
) )
5734, 56syl 15 . . . . . . . . . . 11  |-  ( ph  ->  0  e.  ( 0 ... T ) )
58 lencl 11421 . . . . . . . . . . . . . 14  |-  ( S  e. Word  X  ->  ( # `
 S )  e. 
NN0 )
599, 58syl 15 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  S
)  e.  NN0 )
6059, 22syl6eleq 2373 . . . . . . . . . . . 12  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
61 eluzfz2 10804 . . . . . . . . . . . 12  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
6260, 61syl 15 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
63 ccatswrd 11459 . . . . . . . . . . 11  |-  ( ( S  e. Word  X  /\  ( 0  e.  ( 0 ... T )  /\  T  e.  ( 0 ... ( # `  S ) )  /\  ( # `  S )  e.  ( 0 ... ( # `  S
) ) ) )  ->  ( ( S substr  <. 0 ,  T >. ) concat 
( S substr  <. T , 
( # `  S )
>. ) )  =  ( S substr  <. 0 ,  (
# `  S ) >. ) )
649, 57, 53, 62, 63syl13anc 1184 . . . . . . . . . 10  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( S substr  <. 0 ,  ( # `  S
) >. ) )
65 swrdid 11458 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
669, 65syl 15 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  =  S )
6764, 66, 13eqtrd 2319 . . . . . . . . 9  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( ( A concat  B
) concat  C ) )
68 swrdcl 11452 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  T >. )  e. Word  X )
699, 68syl 15 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  e. Word  X
)
70 swrdcl 11452 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. T ,  (
# `  S ) >. )  e. Word  X )
719, 70syl 15 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  e. Word  X )
72 swrd0len 11455 . . . . . . . . . . . 12  |-  ( ( S  e. Word  X  /\  T  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
739, 53, 72syl2anc 642 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
7473, 41eqtrd 2315 . . . . . . . . . 10  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A concat  B ) ) )
75 ccatopth 11462 . . . . . . . . . 10  |-  ( ( ( ( S substr  <. 0 ,  T >. )  e. Word  X  /\  ( S substr  <. T , 
( # `  S )
>. )  e. Word  X )  /\  ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  /\  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A concat  B ) ) )  -> 
( ( ( S substr  <. 0 ,  T >. ) concat 
( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  B ) concat  C )  <->  ( ( S substr  <. 0 ,  T >. )  =  ( A concat  B )  /\  ( S substr  <. T ,  (
# `  S ) >. )  =  C ) ) )
7669, 71, 5, 6, 74, 75syl221anc 1193 . . . . . . . . 9  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  T >. ) concat 
( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  B ) concat  C )  <->  ( ( S substr  <. 0 ,  T >. )  =  ( A concat  B )  /\  ( S substr  <. T ,  (
# `  S ) >. )  =  C ) ) )
7767, 76mpbid 201 . . . . . . . 8  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. )  =  ( A concat  B )  /\  ( S substr  <. T , 
( # `  S )
>. )  =  C
) )
7877simpld 445 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  =  ( A concat  B ) )
7955, 78eqtrd 2315 . . . . . 6  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( A concat  B ) )
80 swrdcl 11452 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  F >. )  e. Word  X )
819, 80syl 15 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  e. Word  X
)
82 swrdcl 11452 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. F ,  T >. )  e. Word  X )
839, 82syl 15 . . . . . . 7  |-  ( ph  ->  ( S substr  <. F ,  T >. )  e. Word  X
)
84 uztrn 10244 . . . . . . . . . . 11  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
8551, 31, 84syl2anc 642 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
86 elfzuzb 10792 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
8723, 85, 86sylanbrc 645 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
88 swrd0len 11455 . . . . . . . . 9  |-  ( ( S  e. Word  X  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
899, 87, 88syl2anc 642 . . . . . . . 8  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
9089, 10eqtrd 2315 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  (
# `  A )
)
91 ccatopth 11462 . . . . . . 7  |-  ( ( ( ( S substr  <. 0 ,  F >. )  e. Word  X  /\  ( S substr  <. F ,  T >. )  e. Word  X
)  /\  ( A  e. Word  X  /\  B  e. Word  X )  /\  ( # `
 ( S substr  <. 0 ,  F >. ) )  =  ( # `  A
) )  ->  (
( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( A concat  B )  <->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) ) )
9281, 83, 2, 3, 90, 91syl221anc 1193 . . . . . 6  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) concat 
( S substr  <. F ,  T >. ) )  =  ( A concat  B )  <-> 
( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) ) )
9379, 92mpbid 201 . . . . 5  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) )
9493simpld 445 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  =  A )
9594oveq1d 5873 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  =  ( A concat  R
) )
9677simprd 449 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  =  C
)
9795, 96oveq12d 5876 . 2  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  R ) concat  C ) )
9821, 97eqtrd 2315 1  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A concat  R ) concat  C ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 176    /\ wa 358    = wceq 1623    e. wcel 1684   <.cop 3643   <.cotp 3644   ` cfv 5255  (class class class)co 5858   0cc0 8737    + caddc 8740   NN0cn0 9965   ZZcz 10024   ZZ>=cuz 10230   ...cfz 10782   #chash 11337  Word cword 11403   concat cconcat 11404   substr csubstr 11406   splice csplice 11407
This theorem is referenced by:  efginvrel2  15036  efgredleme  15052  efgcpbllemb  15064  frgpnabllem1  15161
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-ot 3650  df-uni 3828  df-int 3863  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-oadd 6483  df-er 6660  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-card 7572  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-nn 9747  df-n0 9966  df-z 10025  df-uz 10231  df-fz 10783  df-fzo 10871  df-hash 11338  df-word 11409  df-concat 11410  df-substr 11412  df-splice 11413
  Copyright terms: Public domain W3C validator