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

Theorem splval2 12395
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 12270 . . . . . 6  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( A concat  B )  e. Word  X )
52, 3, 4syl2anc 656 . . . . 5  |-  ( ph  ->  ( A concat  B )  e. Word  X )
6 splval2.c . . . . 5  |-  ( ph  ->  C  e. Word  X )
7 ccatcl 12270 . . . . 5  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  (
( A concat  B ) concat  C )  e. Word  X )
85, 6, 7syl2anc 656 . . . 4  |-  ( ph  ->  ( ( A concat  B
) concat  C )  e. Word  X
)
91, 8eqeltrd 2515 . . 3  |-  ( ph  ->  S  e. Word  X )
10 splval2.f . . . 4  |-  ( ph  ->  F  =  ( # `  A ) )
11 lencl 12245 . . . . 5  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
122, 11syl 16 . . . 4  |-  ( ph  ->  ( # `  A
)  e.  NN0 )
1310, 12eqeltrd 2515 . . 3  |-  ( ph  ->  F  e.  NN0 )
14 splval2.t . . . 4  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
15 lencl 12245 . . . . . 6  |-  ( B  e. Word  X  ->  ( # `
 B )  e. 
NN0 )
163, 15syl 16 . . . . 5  |-  ( ph  ->  ( # `  B
)  e.  NN0 )
1713, 16nn0addcld 10636 . . . 4  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  NN0 )
1814, 17eqeltrd 2515 . . 3  |-  ( ph  ->  T  e.  NN0 )
19 splval2.r . . 3  |-  ( ph  ->  R  e. Word  X )
20 splval 12389 . . 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 1215 . 2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
22 nn0uz 10891 . . . . . . . . . 10  |-  NN0  =  ( ZZ>= `  0 )
2313, 22syl6eleq 2531 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
24 eluzfz1 11454 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
2523, 24syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
2613nn0zd 10741 . . . . . . . . . . . 12  |-  ( ph  ->  F  e.  ZZ )
27 uzid 10871 . . . . . . . . . . . 12  |-  ( F  e.  ZZ  ->  F  e.  ( ZZ>= `  F )
)
2826, 27syl 16 . . . . . . . . . . 11  |-  ( ph  ->  F  e.  ( ZZ>= `  F ) )
29 uzaddcl 10907 . . . . . . . . . . 11  |-  ( ( F  e.  ( ZZ>= `  F )  /\  ( # `
 B )  e. 
NN0 )  ->  ( F  +  ( # `  B
) )  e.  (
ZZ>= `  F ) )
3028, 16, 29syl2anc 656 . . . . . . . . . 10  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  ( ZZ>= `  F ) )
3114, 30eqeltrd 2515 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
32 elfzuzb 11443 . . . . . . . . 9  |-  ( F  e.  ( 0 ... T )  <->  ( F  e.  ( ZZ>= `  0 )  /\  T  e.  ( ZZ>=
`  F ) ) )
3323, 31, 32sylanbrc 659 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3418, 22syl6eleq 2531 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= ` 
0 ) )
35 ccatlen 12271 . . . . . . . . . . . 12  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  ( # `
 ( ( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C ) ) )
365, 6, 35syl2anc 656 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  (
( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C
) ) )
371fveq2d 5692 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  =  ( # `  ( ( A concat  B
) concat  C ) ) )
3810oveq1d 6105 . . . . . . . . . . . . 13  |-  ( ph  ->  ( F  +  (
# `  B )
)  =  ( (
# `  A )  +  ( # `  B
) ) )
39 ccatlen 12271 . . . . . . . . . . . . . 14  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
402, 3, 39syl2anc 656 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4138, 14, 403eqtr4d 2483 . . . . . . . . . . . 12  |-  ( ph  ->  T  =  ( # `  ( A concat  B ) ) )
4241oveq1d 6105 . . . . . . . . . . 11  |-  ( ph  ->  ( T  +  (
# `  C )
)  =  ( (
# `  ( A concat  B ) )  +  (
# `  C )
) )
4336, 37, 423eqtr4d 2483 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  =  ( T  +  ( # `  C
) ) )
4418nn0zd 10741 . . . . . . . . . . . 12  |-  ( ph  ->  T  e.  ZZ )
45 uzid 10871 . . . . . . . . . . . 12  |-  ( T  e.  ZZ  ->  T  e.  ( ZZ>= `  T )
)
4644, 45syl 16 . . . . . . . . . . 11  |-  ( ph  ->  T  e.  ( ZZ>= `  T ) )
47 lencl 12245 . . . . . . . . . . . 12  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
486, 47syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  C
)  e.  NN0 )
49 uzaddcl 10907 . . . . . . . . . . 11  |-  ( ( T  e.  ( ZZ>= `  T )  /\  ( # `
 C )  e. 
NN0 )  ->  ( T  +  ( # `  C
) )  e.  (
ZZ>= `  T ) )
5046, 48, 49syl2anc 656 . . . . . . . . . 10  |-  ( ph  ->  ( T  +  (
# `  C )
)  e.  ( ZZ>= `  T ) )
5143, 50eqeltrd 2515 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
52 elfzuzb 11443 . . . . . . . . 9  |-  ( T  e.  ( 0 ... ( # `  S
) )  <->  ( T  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  T ) ) )
5334, 51, 52sylanbrc 659 . . . . . . . 8  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
54 ccatswrd 12346 . . . . . . . 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 1215 . . . . . . 7  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
56 eluzfz1 11454 . . . . . . . . . . . 12  |-  ( T  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... T
) )
5734, 56syl 16 . . . . . . . . . . 11  |-  ( ph  ->  0  e.  ( 0 ... T ) )
58 lencl 12245 . . . . . . . . . . . . . 14  |-  ( S  e. Word  X  ->  ( # `
 S )  e. 
NN0 )
599, 58syl 16 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  S
)  e.  NN0 )
6059, 22syl6eleq 2531 . . . . . . . . . . . 12  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
61 eluzfz2 11455 . . . . . . . . . . . 12  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
6260, 61syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
63 ccatswrd 12346 . . . . . . . . . . 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 1215 . . . . . . . . . 10  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( S substr  <. 0 ,  ( # `  S
) >. ) )
65 swrdid 12317 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
669, 65syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  =  S )
6764, 66, 13eqtrd 2477 . . . . . . . . 9  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( ( A concat  B
) concat  C ) )
68 swrdcl 12311 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  T >. )  e. Word  X )
699, 68syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  e. Word  X
)
70 swrdcl 12311 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. T ,  (
# `  S ) >. )  e. Word  X )
719, 70syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  e. Word  X )
72 swrd0len 12314 . . . . . . . . . . . 12  |-  ( ( S  e. Word  X  /\  T  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
739, 53, 72syl2anc 656 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
7473, 41eqtrd 2473 . . . . . . . . . 10  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A concat  B ) ) )
75 ccatopth 12360 . . . . . . . . . 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 1224 . . . . . . . . 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 210 . . . . . . . 8  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. )  =  ( A concat  B )  /\  ( S substr  <. T , 
( # `  S )
>. )  =  C
) )
7877simpld 456 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  =  ( A concat  B ) )
7955, 78eqtrd 2473 . . . . . 6  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( A concat  B ) )
80 swrdcl 12311 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  F >. )  e. Word  X )
819, 80syl 16 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  e. Word  X
)
82 swrdcl 12311 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. F ,  T >. )  e. Word  X )
839, 82syl 16 . . . . . . 7  |-  ( ph  ->  ( S substr  <. F ,  T >. )  e. Word  X
)
84 uztrn 10873 . . . . . . . . . . 11  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
8551, 31, 84syl2anc 656 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
86 elfzuzb 11443 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
8723, 85, 86sylanbrc 659 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
88 swrd0len 12314 . . . . . . . . 9  |-  ( ( S  e. Word  X  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
899, 87, 88syl2anc 656 . . . . . . . 8  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
9089, 10eqtrd 2473 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  (
# `  A )
)
91 ccatopth 12360 . . . . . . 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 1224 . . . . . 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 210 . . . . 5  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) )
9493simpld 456 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  =  A )
9594oveq1d 6105 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  =  ( A concat  R
) )
9677simprd 460 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  =  C
)
9795, 96oveq12d 6108 . 2  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  R ) concat  C ) )
9821, 97eqtrd 2473 1  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A concat  R ) concat  C ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    = wceq 1364    e. wcel 1761   <.cop 3880   <.cotp 3882   ` cfv 5415  (class class class)co 6090   0cc0 9278    + caddc 9281   NN0cn0 10575   ZZcz 10642   ZZ>=cuz 10857   ...cfz 11433   #chash 12099  Word cword 12217   concat cconcat 12219   substr csubstr 12221   splice csplice 12222
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1596  ax-4 1607  ax-5 1675  ax-6 1713  ax-7 1733  ax-8 1763  ax-9 1765  ax-10 1780  ax-11 1785  ax-12 1797  ax-13 1948  ax-ext 2422  ax-rep 4400  ax-sep 4410  ax-nul 4418  ax-pow 4467  ax-pr 4528  ax-un 6371  ax-cnex 9334  ax-resscn 9335  ax-1cn 9336  ax-icn 9337  ax-addcl 9338  ax-addrcl 9339  ax-mulcl 9340  ax-mulrcl 9341  ax-mulcom 9342  ax-addass 9343  ax-mulass 9344  ax-distr 9345  ax-i2m1 9346  ax-1ne0 9347  ax-1rid 9348  ax-rnegex 9349  ax-rrecex 9350  ax-cnre 9351  ax-pre-lttri 9352  ax-pre-lttrn 9353  ax-pre-ltadd 9354  ax-pre-mulgt0 9355
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 961  df-3an 962  df-tru 1367  df-ex 1592  df-nf 1595  df-sb 1706  df-eu 2261  df-mo 2262  df-clab 2428  df-cleq 2434  df-clel 2437  df-nfc 2566  df-ne 2606  df-nel 2607  df-ral 2718  df-rex 2719  df-reu 2720  df-rab 2722  df-v 2972  df-sbc 3184  df-csb 3286  df-dif 3328  df-un 3330  df-in 3332  df-ss 3339  df-pss 3341  df-nul 3635  df-if 3789  df-pw 3859  df-sn 3875  df-pr 3877  df-tp 3879  df-op 3881  df-ot 3883  df-uni 4089  df-int 4126  df-iun 4170  df-br 4290  df-opab 4348  df-mpt 4349  df-tr 4383  df-eprel 4628  df-id 4632  df-po 4637  df-so 4638  df-fr 4675  df-we 4677  df-ord 4718  df-on 4719  df-lim 4720  df-suc 4721  df-xp 4842  df-rel 4843  df-cnv 4844  df-co 4845  df-dm 4846  df-rn 4847  df-res 4848  df-ima 4849  df-iota 5378  df-fun 5417  df-fn 5418  df-f 5419  df-f1 5420  df-fo 5421  df-f1o 5422  df-fv 5423  df-riota 6049  df-ov 6093  df-oprab 6094  df-mpt2 6095  df-om 6476  df-1st 6576  df-2nd 6577  df-recs 6828  df-rdg 6862  df-1o 6916  df-oadd 6920  df-er 7097  df-en 7307  df-dom 7308  df-sdom 7309  df-fin 7310  df-card 8105  df-pnf 9416  df-mnf 9417  df-xr 9418  df-ltxr 9419  df-le 9420  df-sub 9593  df-neg 9594  df-nn 10319  df-n0 10576  df-z 10643  df-uz 10858  df-fz 11434  df-fzo 11545  df-hash 12100  df-word 12225  df-concat 12227  df-substr 12229  df-splice 12230
This theorem is referenced by:  efginvrel2  16217  efgredleme  16233  efgcpbllemb  16245  frgpnabllem1  16344
  Copyright terms: Public domain W3C validator