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

Theorem splval2 11791
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 11748 . . . . . 6  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( A concat  B )  e. Word  X )
52, 3, 4syl2anc 644 . . . . 5  |-  ( ph  ->  ( A concat  B )  e. Word  X )
6 splval2.c . . . . 5  |-  ( ph  ->  C  e. Word  X )
7 ccatcl 11748 . . . . 5  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  (
( A concat  B ) concat  C )  e. Word  X )
85, 6, 7syl2anc 644 . . . 4  |-  ( ph  ->  ( ( A concat  B
) concat  C )  e. Word  X
)
91, 8eqeltrd 2512 . . 3  |-  ( ph  ->  S  e. Word  X )
10 splval2.f . . . 4  |-  ( ph  ->  F  =  ( # `  A ) )
11 lencl 11740 . . . . 5  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
122, 11syl 16 . . . 4  |-  ( ph  ->  ( # `  A
)  e.  NN0 )
1310, 12eqeltrd 2512 . . 3  |-  ( ph  ->  F  e.  NN0 )
14 splval2.t . . . 4  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
15 lencl 11740 . . . . . 6  |-  ( B  e. Word  X  ->  ( # `
 B )  e. 
NN0 )
163, 15syl 16 . . . . 5  |-  ( ph  ->  ( # `  B
)  e.  NN0 )
1713, 16nn0addcld 10283 . . . 4  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  NN0 )
1814, 17eqeltrd 2512 . . 3  |-  ( ph  ->  T  e.  NN0 )
19 splval2.r . . 3  |-  ( ph  ->  R  e. Word  X )
20 splval 11785 . . 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 1187 . 2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
22 nn0uz 10525 . . . . . . . . . 10  |-  NN0  =  ( ZZ>= `  0 )
2313, 22syl6eleq 2528 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
24 eluzfz1 11069 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
2523, 24syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
2613nn0zd 10378 . . . . . . . . . . . 12  |-  ( ph  ->  F  e.  ZZ )
27 uzid 10505 . . . . . . . . . . . 12  |-  ( F  e.  ZZ  ->  F  e.  ( ZZ>= `  F )
)
2826, 27syl 16 . . . . . . . . . . 11  |-  ( ph  ->  F  e.  ( ZZ>= `  F ) )
29 uzaddcl 10538 . . . . . . . . . . 11  |-  ( ( F  e.  ( ZZ>= `  F )  /\  ( # `
 B )  e. 
NN0 )  ->  ( F  +  ( # `  B
) )  e.  (
ZZ>= `  F ) )
3028, 16, 29syl2anc 644 . . . . . . . . . 10  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  ( ZZ>= `  F ) )
3114, 30eqeltrd 2512 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
32 elfzuzb 11058 . . . . . . . . 9  |-  ( F  e.  ( 0 ... T )  <->  ( F  e.  ( ZZ>= `  0 )  /\  T  e.  ( ZZ>=
`  F ) ) )
3323, 31, 32sylanbrc 647 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3418, 22syl6eleq 2528 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= ` 
0 ) )
35 ccatlen 11749 . . . . . . . . . . . 12  |-  ( ( ( A concat  B )  e. Word  X  /\  C  e. Word  X )  ->  ( # `
 ( ( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C ) ) )
365, 6, 35syl2anc 644 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  (
( A concat  B ) concat  C ) )  =  ( ( # `  ( A concat  B ) )  +  ( # `  C
) ) )
371fveq2d 5735 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  =  ( # `  ( ( A concat  B
) concat  C ) ) )
3810oveq1d 6099 . . . . . . . . . . . . 13  |-  ( ph  ->  ( F  +  (
# `  B )
)  =  ( (
# `  A )  +  ( # `  B
) ) )
39 ccatlen 11749 . . . . . . . . . . . . . 14  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
402, 3, 39syl2anc 644 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  ( A concat  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4138, 14, 403eqtr4d 2480 . . . . . . . . . . . 12  |-  ( ph  ->  T  =  ( # `  ( A concat  B ) ) )
4241oveq1d 6099 . . . . . . . . . . 11  |-  ( ph  ->  ( T  +  (
# `  C )
)  =  ( (
# `  ( A concat  B ) )  +  (
# `  C )
) )
4336, 37, 423eqtr4d 2480 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  =  ( T  +  ( # `  C
) ) )
4418nn0zd 10378 . . . . . . . . . . . 12  |-  ( ph  ->  T  e.  ZZ )
45 uzid 10505 . . . . . . . . . . . 12  |-  ( T  e.  ZZ  ->  T  e.  ( ZZ>= `  T )
)
4644, 45syl 16 . . . . . . . . . . 11  |-  ( ph  ->  T  e.  ( ZZ>= `  T ) )
47 lencl 11740 . . . . . . . . . . . 12  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
486, 47syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  C
)  e.  NN0 )
49 uzaddcl 10538 . . . . . . . . . . 11  |-  ( ( T  e.  ( ZZ>= `  T )  /\  ( # `
 C )  e. 
NN0 )  ->  ( T  +  ( # `  C
) )  e.  (
ZZ>= `  T ) )
5046, 48, 49syl2anc 644 . . . . . . . . . 10  |-  ( ph  ->  ( T  +  (
# `  C )
)  e.  ( ZZ>= `  T ) )
5143, 50eqeltrd 2512 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
52 elfzuzb 11058 . . . . . . . . 9  |-  ( T  e.  ( 0 ... ( # `  S
) )  <->  ( T  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  T ) ) )
5334, 51, 52sylanbrc 647 . . . . . . . 8  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
54 ccatswrd 11778 . . . . . . . 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 1187 . . . . . . 7  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
56 eluzfz1 11069 . . . . . . . . . . . 12  |-  ( T  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... T
) )
5734, 56syl 16 . . . . . . . . . . 11  |-  ( ph  ->  0  e.  ( 0 ... T ) )
58 lencl 11740 . . . . . . . . . . . . . 14  |-  ( S  e. Word  X  ->  ( # `
 S )  e. 
NN0 )
599, 58syl 16 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  S
)  e.  NN0 )
6059, 22syl6eleq 2528 . . . . . . . . . . . 12  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
61 eluzfz2 11070 . . . . . . . . . . . 12  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
6260, 61syl 16 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
63 ccatswrd 11778 . . . . . . . . . . 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 1187 . . . . . . . . . 10  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( S substr  <. 0 ,  ( # `  S
) >. ) )
65 swrdid 11777 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
669, 65syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  =  S )
6764, 66, 13eqtrd 2474 . . . . . . . . 9  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) concat  ( S substr  <. T ,  ( # `  S
) >. ) )  =  ( ( A concat  B
) concat  C ) )
68 swrdcl 11771 . . . . . . . . . . 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 11771 . . . . . . . . . . 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 11774 . . . . . . . . . . . 12  |-  ( ( S  e. Word  X  /\  T  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
739, 53, 72syl2anc 644 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
7473, 41eqtrd 2470 . . . . . . . . . 10  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A concat  B ) ) )
75 ccatopth 11781 . . . . . . . . . 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 1196 . . . . . . . . 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 203 . . . . . . . 8  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. )  =  ( A concat  B )  /\  ( S substr  <. T , 
( # `  S )
>. )  =  C
) )
7877simpld 447 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  =  ( A concat  B ) )
7955, 78eqtrd 2470 . . . . . 6  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  ( S substr  <. F ,  T >. ) )  =  ( A concat  B ) )
80 swrdcl 11771 . . . . . . . 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 11771 . . . . . . . 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 10507 . . . . . . . . . . 11  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
8551, 31, 84syl2anc 644 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
86 elfzuzb 11058 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
8723, 85, 86sylanbrc 647 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
88 swrd0len 11774 . . . . . . . . 9  |-  ( ( S  e. Word  X  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
899, 87, 88syl2anc 644 . . . . . . . 8  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
9089, 10eqtrd 2470 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  (
# `  A )
)
91 ccatopth 11781 . . . . . . 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 1196 . . . . . 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 203 . . . . 5  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) )
9493simpld 447 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  =  A )
9594oveq1d 6099 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  =  ( A concat  R
) )
9677simprd 451 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  =  C
)
9795, 96oveq12d 6102 . 2  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A concat  R ) concat  C ) )
9821, 97eqtrd 2470 1  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A concat  R ) concat  C ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 178    /\ wa 360    = wceq 1653    e. wcel 1726   <.cop 3819   <.cotp 3820   ` cfv 5457  (class class class)co 6084   0cc0 8995    + caddc 8998   NN0cn0 10226   ZZcz 10287   ZZ>=cuz 10493   ...cfz 11048   #chash 11623  Word cword 11722   concat cconcat 11723   substr csubstr 11725   splice csplice 11726
This theorem is referenced by:  efginvrel2  15364  efgredleme  15380  efgcpbllemb  15392  frgpnabllem1  15489
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-rep 4323  ax-sep 4333  ax-nul 4341  ax-pow 4380  ax-pr 4406  ax-un 4704  ax-cnex 9051  ax-resscn 9052  ax-1cn 9053  ax-icn 9054  ax-addcl 9055  ax-addrcl 9056  ax-mulcl 9057  ax-mulrcl 9058  ax-mulcom 9059  ax-addass 9060  ax-mulass 9061  ax-distr 9062  ax-i2m1 9063  ax-1ne0 9064  ax-1rid 9065  ax-rnegex 9066  ax-rrecex 9067  ax-cnre 9068  ax-pre-lttri 9069  ax-pre-lttrn 9070  ax-pre-ltadd 9071  ax-pre-mulgt0 9072
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-ot 3826  df-uni 4018  df-int 4053  df-iun 4097  df-br 4216  df-opab 4270  df-mpt 4271  df-tr 4306  df-eprel 4497  df-id 4501  df-po 4506  df-so 4507  df-fr 4544  df-we 4546  df-ord 4587  df-on 4588  df-lim 4589  df-suc 4590  df-om 4849  df-xp 4887  df-rel 4888  df-cnv 4889  df-co 4890  df-dm 4891  df-rn 4892  df-res 4893  df-ima 4894  df-iota 5421  df-fun 5459  df-fn 5460  df-f 5461  df-f1 5462  df-fo 5463  df-f1o 5464  df-fv 5465  df-ov 6087  df-oprab 6088  df-mpt2 6089  df-1st 6352  df-2nd 6353  df-riota 6552  df-recs 6636  df-rdg 6671  df-1o 6727  df-oadd 6731  df-er 6908  df-en 7113  df-dom 7114  df-sdom 7115  df-fin 7116  df-card 7831  df-pnf 9127  df-mnf 9128  df-xr 9129  df-ltxr 9130  df-le 9131  df-sub 9298  df-neg 9299  df-nn 10006  df-n0 10227  df-z 10288  df-uz 10494  df-fz 11049  df-fzo 11141  df-hash 11624  df-word 11728  df-concat 11729  df-substr 11731  df-splice 11732
  Copyright terms: Public domain W3C validator