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

Theorem splval2 12399
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 12274 . . . . . 6  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( A concat  B )  e. Word  X )
52, 3, 4syl2anc 661 . . . . 5  |-  ( ph  ->  ( A concat  B )  e. Word  X )
6 splval2.c . . . . 5  |-  ( ph  ->  C  e. Word  X )
7 ccatcl 12274 . . . . 5  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  (
( A concat  B ) concat  C )  e. Word  X )
85, 6, 7syl2anc 661 . . . 4  |-  ( ph  ->  ( ( A concat  B
) concat  C )  e. Word  X
)
91, 8eqeltrd 2517 . . 3  |-  ( ph  ->  S  e. Word  X )
10 splval2.f . . . 4  |-  ( ph  ->  F  =  ( # `  A ) )
11 lencl 12249 . . . . 5  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
122, 11syl 16 . . . 4  |-  ( ph  ->  ( # `  A
)  e.  NN0 )
1310, 12eqeltrd 2517 . . 3  |-  ( ph  ->  F  e.  NN0 )
14 splval2.t . . . 4  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
15 lencl 12249 . . . . . 6  |-  ( B  e. Word  X  ->  ( # `
 B )  e. 
NN0 )
163, 15syl 16 . . . . 5  |-  ( ph  ->  ( # `  B
)  e.  NN0 )
1713, 16nn0addcld 10640 . . . 4  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  NN0 )
1814, 17eqeltrd 2517 . . 3  |-  ( ph  ->  T  e.  NN0 )
19 splval2.r . . 3  |-  ( ph  ->  R  e. Word  X )
20 splval 12393 . . 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 1220 . 2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
22 nn0uz 10895 . . . . . . . . . 10  |-  NN0  =  ( ZZ>= `  0 )
2313, 22syl6eleq 2533 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
24 eluzfz1 11458 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
2523, 24syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
2613nn0zd 10745 . . . . . . . . . . . 12  |-  ( ph  ->  F  e.  ZZ )
27 uzid 10875 . . . . . . . . . . . 12  |-  ( F  e.  ZZ  ->  F  e.  ( ZZ>= `  F )
)
2826, 27syl 16 . . . . . . . . . . 11  |-  ( ph  ->  F  e.  ( ZZ>= `  F ) )
29 uzaddcl 10911 . . . . . . . . . . 11  |-  ( ( F  e.  ( ZZ>= `  F )  /\  ( # `
 B )  e. 
NN0 )  ->  ( F  +  ( # `  B
) )  e.  (
ZZ>= `  F ) )
3028, 16, 29syl2anc 661 . . . . . . . . . 10  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  ( ZZ>= `  F ) )
3114, 30eqeltrd 2517 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
32 elfzuzb 11447 . . . . . . . . 9  |-  ( F  e.  ( 0 ... T )  <->  ( F  e.  ( ZZ>= `  0 )  /\  T  e.  ( ZZ>=
`  F ) ) )
3323, 31, 32sylanbrc 664 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3418, 22syl6eleq 2533 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= ` 
0 ) )
35 ccatlen 12275 . . . . . . . . . . . 12  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  ( # `
 ( ( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C ) ) )
365, 6, 35syl2anc 661 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  (
( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C
) ) )
371fveq2d 5695 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  =  ( # `  ( ( A concat  B
) concat  C ) ) )
3810oveq1d 6106 . . . . . . . . . . . . 13  |-  ( ph  ->  ( F  +  (
# `  B )
)  =  ( (
# `  A )  +  ( # `  B
) ) )
39 ccatlen 12275 . . . . . . . . . . . . . 14  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
402, 3, 39syl2anc 661 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4138, 14, 403eqtr4d 2485 . . . . . . . . . . . 12  |-  ( ph  ->  T  =  ( # `  ( A concat  B ) ) )
4241oveq1d 6106 . . . . . . . . . . 11  |-  ( ph  ->  ( T  +  (
# `  C )
)  =  ( (
# `  ( A concat  B ) )  +  (
# `  C )
) )
4336, 37, 423eqtr4d 2485 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  =  ( T  +  ( # `  C
) ) )
4418nn0zd 10745 . . . . . . . . . . . 12  |-  ( ph  ->  T  e.  ZZ )
45 uzid 10875 . . . . . . . . . . . 12  |-  ( T  e.  ZZ  ->  T  e.  ( ZZ>= `  T )
)
4644, 45syl 16 . . . . . . . . . . 11  |-  ( ph  ->  T  e.  ( ZZ>= `  T ) )
47 lencl 12249 . . . . . . . . . . . 12  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
486, 47syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  C
)  e.  NN0 )
49 uzaddcl 10911 . . . . . . . . . . 11  |-  ( ( T  e.  ( ZZ>= `  T )  /\  ( # `
 C )  e. 
NN0 )  ->  ( T  +  ( # `  C
) )  e.  (
ZZ>= `  T ) )
5046, 48, 49syl2anc 661 . . . . . . . . . 10  |-  ( ph  ->  ( T  +  (
# `  C )
)  e.  ( ZZ>= `  T ) )
5143, 50eqeltrd 2517 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
52 elfzuzb 11447 . . . . . . . . 9  |-  ( T  e.  ( 0 ... ( # `  S
) )  <->  ( T  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  T ) ) )
5334, 51, 52sylanbrc 664 . . . . . . . 8  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
54 ccatswrd 12350 . . . . . . . 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 1220 . . . . . . 7  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
56 eluzfz1 11458 . . . . . . . . . . . 12  |-  ( T  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... T
) )
5734, 56syl 16 . . . . . . . . . . 11  |-  ( ph  ->  0  e.  ( 0 ... T ) )
58 lencl 12249 . . . . . . . . . . . . . 14  |-  ( S  e. Word  X  ->  ( # `
 S )  e. 
NN0 )
599, 58syl 16 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  S
)  e.  NN0 )
6059, 22syl6eleq 2533 . . . . . . . . . . . 12  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
61 eluzfz2 11459 . . . . . . . . . . . 12  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
6260, 61syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
63 ccatswrd 12350 . . . . . . . . . . 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 1220 . . . . . . . . . 10  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( S substr  <. 0 ,  ( # `  S
) >. ) )
65 swrdid 12321 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
669, 65syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  =  S )
6764, 66, 13eqtrd 2479 . . . . . . . . 9  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( ( A concat  B
) concat  C ) )
68 swrdcl 12315 . . . . . . . . . . 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 12315 . . . . . . . . . . 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 12318 . . . . . . . . . . . 12  |-  ( ( S  e. Word  X  /\  T  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
739, 53, 72syl2anc 661 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
7473, 41eqtrd 2475 . . . . . . . . . 10  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A concat  B ) ) )
75 ccatopth 12364 . . . . . . . . . 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 1229 . . . . . . . . 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 459 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  =  ( A concat  B ) )
7955, 78eqtrd 2475 . . . . . 6  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( A concat  B ) )
80 swrdcl 12315 . . . . . . . 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 12315 . . . . . . . 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 10877 . . . . . . . . . . 11  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
8551, 31, 84syl2anc 661 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
86 elfzuzb 11447 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
8723, 85, 86sylanbrc 664 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
88 swrd0len 12318 . . . . . . . . 9  |-  ( ( S  e. Word  X  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
899, 87, 88syl2anc 661 . . . . . . . 8  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
9089, 10eqtrd 2475 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  (
# `  A )
)
91 ccatopth 12364 . . . . . . 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 1229 . . . . . 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 459 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  =  A )
9594oveq1d 6106 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  =  ( A concat  R
) )
9677simprd 463 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  =  C
)
9795, 96oveq12d 6109 . 2  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  R ) concat  C ) )
9821, 97eqtrd 2475 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 1369    e. wcel 1756   <.cop 3883   <.cotp 3885   ` cfv 5418  (class class class)co 6091   0cc0 9282    + caddc 9285   NN0cn0 10579   ZZcz 10646   ZZ>=cuz 10861   ...cfz 11437   #chash 12103  Word cword 12221   concat cconcat 12223   substr csubstr 12225   splice csplice 12226
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-rep 4403  ax-sep 4413  ax-nul 4421  ax-pow 4470  ax-pr 4531  ax-un 6372  ax-cnex 9338  ax-resscn 9339  ax-1cn 9340  ax-icn 9341  ax-addcl 9342  ax-addrcl 9343  ax-mulcl 9344  ax-mulrcl 9345  ax-mulcom 9346  ax-addass 9347  ax-mulass 9348  ax-distr 9349  ax-i2m1 9350  ax-1ne0 9351  ax-1rid 9352  ax-rnegex 9353  ax-rrecex 9354  ax-cnre 9355  ax-pre-lttri 9356  ax-pre-lttrn 9357  ax-pre-ltadd 9358  ax-pre-mulgt0 9359
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2430  df-cleq 2436  df-clel 2439  df-nfc 2568  df-ne 2608  df-nel 2609  df-ral 2720  df-rex 2721  df-reu 2722  df-rab 2724  df-v 2974  df-sbc 3187  df-csb 3289  df-dif 3331  df-un 3333  df-in 3335  df-ss 3342  df-pss 3344  df-nul 3638  df-if 3792  df-pw 3862  df-sn 3878  df-pr 3880  df-tp 3882  df-op 3884  df-ot 3886  df-uni 4092  df-int 4129  df-iun 4173  df-br 4293  df-opab 4351  df-mpt 4352  df-tr 4386  df-eprel 4632  df-id 4636  df-po 4641  df-so 4642  df-fr 4679  df-we 4681  df-ord 4722  df-on 4723  df-lim 4724  df-suc 4725  df-xp 4846  df-rel 4847  df-cnv 4848  df-co 4849  df-dm 4850  df-rn 4851  df-res 4852  df-ima 4853  df-iota 5381  df-fun 5420  df-fn 5421  df-f 5422  df-f1 5423  df-fo 5424  df-f1o 5425  df-fv 5426  df-riota 6052  df-ov 6094  df-oprab 6095  df-mpt2 6096  df-om 6477  df-1st 6577  df-2nd 6578  df-recs 6832  df-rdg 6866  df-1o 6920  df-oadd 6924  df-er 7101  df-en 7311  df-dom 7312  df-sdom 7313  df-fin 7314  df-card 8109  df-pnf 9420  df-mnf 9421  df-xr 9422  df-ltxr 9423  df-le 9424  df-sub 9597  df-neg 9598  df-nn 10323  df-n0 10580  df-z 10647  df-uz 10862  df-fz 11438  df-fzo 11549  df-hash 12104  df-word 12229  df-concat 12231  df-substr 12233  df-splice 12234
This theorem is referenced by:  efginvrel2  16224  efgredleme  16240  efgcpbllemb  16252  frgpnabllem1  16351
  Copyright terms: Public domain W3C validator