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

Theorem splval2 12849
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 ++  B ) ++  C
) )
splval2.f  |-  ( ph  ->  F  =  ( # `  A ) )
splval2.t  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
Assertion
Ref Expression
splval2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A ++  R ) ++  C ) )

Proof of Theorem splval2
StepHypRef Expression
1 splval2.s . . . 4  |-  ( ph  ->  S  =  ( ( A ++  B ) ++  C
) )
2 splval2.a . . . . . 6  |-  ( ph  ->  A  e. Word  X )
3 splval2.b . . . . . 6  |-  ( ph  ->  B  e. Word  X )
4 ccatcl 12707 . . . . . 6  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( A ++  B )  e. Word  X )
52, 3, 4syl2anc 665 . . . . 5  |-  ( ph  ->  ( A ++  B )  e. Word  X )
6 splval2.c . . . . 5  |-  ( ph  ->  C  e. Word  X )
7 ccatcl 12707 . . . . 5  |-  ( ( ( A ++  B )  e. Word  X  /\  C  e. Word  X )  ->  (
( A ++  B ) ++  C )  e. Word  X
)
85, 6, 7syl2anc 665 . . . 4  |-  ( ph  ->  ( ( A ++  B
) ++  C )  e. Word  X )
91, 8eqeltrd 2517 . . 3  |-  ( ph  ->  S  e. Word  X )
10 splval2.f . . . 4  |-  ( ph  ->  F  =  ( # `  A ) )
11 lencl 12674 . . . . 5  |-  ( A  e. Word  X  ->  ( # `
 A )  e. 
NN0 )
122, 11syl 17 . . . 4  |-  ( ph  ->  ( # `  A
)  e.  NN0 )
1310, 12eqeltrd 2517 . . 3  |-  ( ph  ->  F  e.  NN0 )
14 splval2.t . . . 4  |-  ( ph  ->  T  =  ( F  +  ( # `  B
) ) )
15 lencl 12674 . . . . . 6  |-  ( B  e. Word  X  ->  ( # `
 B )  e. 
NN0 )
163, 15syl 17 . . . . 5  |-  ( ph  ->  ( # `  B
)  e.  NN0 )
1713, 16nn0addcld 10929 . . . 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 12843 . . 3  |-  ( ( S  e. Word  X  /\  ( F  e.  NN0  /\  T  e.  NN0  /\  R  e. Word  X )
)  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) )
219, 13, 18, 19, 20syl13anc 1266 . 2  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T ,  (
# `  S ) >. ) ) )
22 nn0uz 11193 . . . . . . . . . 10  |-  NN0  =  ( ZZ>= `  0 )
2313, 22syl6eleq 2527 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
24 eluzfz1 11804 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
2523, 24syl 17 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
2613nn0zd 11038 . . . . . . . . . . . 12  |-  ( ph  ->  F  e.  ZZ )
27 uzid 11173 . . . . . . . . . . . 12  |-  ( F  e.  ZZ  ->  F  e.  ( ZZ>= `  F )
)
2826, 27syl 17 . . . . . . . . . . 11  |-  ( ph  ->  F  e.  ( ZZ>= `  F ) )
29 uzaddcl 11215 . . . . . . . . . . 11  |-  ( ( F  e.  ( ZZ>= `  F )  /\  ( # `
 B )  e. 
NN0 )  ->  ( F  +  ( # `  B
) )  e.  (
ZZ>= `  F ) )
3028, 16, 29syl2anc 665 . . . . . . . . . 10  |-  ( ph  ->  ( F  +  (
# `  B )
)  e.  ( ZZ>= `  F ) )
3114, 30eqeltrd 2517 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
32 elfzuzb 11792 . . . . . . . . 9  |-  ( F  e.  ( 0 ... T )  <->  ( F  e.  ( ZZ>= `  0 )  /\  T  e.  ( ZZ>=
`  F ) ) )
3323, 31, 32sylanbrc 668 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3418, 22syl6eleq 2527 . . . . . . . . 9  |-  ( ph  ->  T  e.  ( ZZ>= ` 
0 ) )
35 ccatlen 12708 . . . . . . . . . . . 12  |-  ( ( ( A ++  B )  e. Word  X  /\  C  e. Word  X )  ->  ( # `
 ( ( A ++  B ) ++  C ) )  =  ( (
# `  ( A ++  B ) )  +  ( # `  C
) ) )
365, 6, 35syl2anc 665 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  (
( A ++  B ) ++  C ) )  =  ( ( # `  ( A ++  B ) )  +  ( # `  C
) ) )
371fveq2d 5885 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  =  ( # `  ( ( A ++  B
) ++  C ) ) )
3810oveq1d 6320 . . . . . . . . . . . . 13  |-  ( ph  ->  ( F  +  (
# `  B )
)  =  ( (
# `  A )  +  ( # `  B
) ) )
39 ccatlen 12708 . . . . . . . . . . . . . 14  |-  ( ( A  e. Word  X  /\  B  e. Word  X )  ->  ( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
402, 3, 39syl2anc 665 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  ( A ++  B ) )  =  ( ( # `  A
)  +  ( # `  B ) ) )
4138, 14, 403eqtr4d 2480 . . . . . . . . . . . 12  |-  ( ph  ->  T  =  ( # `  ( A ++  B ) ) )
4241oveq1d 6320 . . . . . . . . . . 11  |-  ( ph  ->  ( T  +  (
# `  C )
)  =  ( (
# `  ( A ++  B ) )  +  ( # `  C
) ) )
4336, 37, 423eqtr4d 2480 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  =  ( T  +  ( # `  C
) ) )
4418nn0zd 11038 . . . . . . . . . . . 12  |-  ( ph  ->  T  e.  ZZ )
45 uzid 11173 . . . . . . . . . . . 12  |-  ( T  e.  ZZ  ->  T  e.  ( ZZ>= `  T )
)
4644, 45syl 17 . . . . . . . . . . 11  |-  ( ph  ->  T  e.  ( ZZ>= `  T ) )
47 lencl 12674 . . . . . . . . . . . 12  |-  ( C  e. Word  X  ->  ( # `
 C )  e. 
NN0 )
486, 47syl 17 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  C
)  e.  NN0 )
49 uzaddcl 11215 . . . . . . . . . . 11  |-  ( ( T  e.  ( ZZ>= `  T )  /\  ( # `
 C )  e. 
NN0 )  ->  ( T  +  ( # `  C
) )  e.  (
ZZ>= `  T ) )
5046, 48, 49syl2anc 665 . . . . . . . . . 10  |-  ( ph  ->  ( T  +  (
# `  C )
)  e.  ( ZZ>= `  T ) )
5143, 50eqeltrd 2517 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
52 elfzuzb 11792 . . . . . . . . 9  |-  ( T  e.  ( 0 ... ( # `  S
) )  <->  ( T  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  T ) ) )
5334, 51, 52sylanbrc 668 . . . . . . . 8  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
54 ccatswrd 12797 . . . . . . . 8  |-  ( ( S  e. Word  X  /\  ( 0  e.  ( 0 ... F )  /\  F  e.  ( 0 ... T )  /\  T  e.  ( 0 ... ( # `  S ) ) ) )  ->  ( ( S substr  <. 0 ,  F >. ) ++  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
559, 25, 33, 53, 54syl13anc 1266 . . . . . . 7  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) ++  ( S substr  <. F ,  T >. ) )  =  ( S substr  <. 0 ,  T >. ) )
56 eluzfz1 11804 . . . . . . . . . . . 12  |-  ( T  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... T
) )
5734, 56syl 17 . . . . . . . . . . 11  |-  ( ph  ->  0  e.  ( 0 ... T ) )
58 lencl 12674 . . . . . . . . . . . . . 14  |-  ( S  e. Word  X  ->  ( # `
 S )  e. 
NN0 )
599, 58syl 17 . . . . . . . . . . . . 13  |-  ( ph  ->  ( # `  S
)  e.  NN0 )
6059, 22syl6eleq 2527 . . . . . . . . . . . 12  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
61 eluzfz2 11805 . . . . . . . . . . . 12  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
6260, 61syl 17 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
63 ccatswrd 12797 . . . . . . . . . . 11  |-  ( ( S  e. Word  X  /\  ( 0  e.  ( 0 ... T )  /\  T  e.  ( 0 ... ( # `  S ) )  /\  ( # `  S )  e.  ( 0 ... ( # `  S
) ) ) )  ->  ( ( S substr  <. 0 ,  T >. ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( S substr  <. 0 ,  (
# `  S ) >. ) )
649, 57, 53, 62, 63syl13anc 1266 . . . . . . . . . 10  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) ++  ( S substr  <. T ,  ( # `  S ) >. )
)  =  ( S substr  <. 0 ,  ( # `  S ) >. )
)
65 swrdid 12769 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
669, 65syl 17 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  =  S )
6764, 66, 13eqtrd 2474 . . . . . . . . 9  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. ) ++  ( S substr  <. T ,  ( # `  S ) >. )
)  =  ( ( A ++  B ) ++  C
) )
68 swrdcl 12760 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  T >. )  e. Word  X )
699, 68syl 17 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  e. Word  X
)
70 swrdcl 12760 . . . . . . . . . . 11  |-  ( S  e. Word  X  ->  ( S substr  <. T ,  (
# `  S ) >. )  e. Word  X )
719, 70syl 17 . . . . . . . . . 10  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  e. Word  X )
72 swrd0len 12763 . . . . . . . . . . . 12  |-  ( ( S  e. Word  X  /\  T  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
739, 53, 72syl2anc 665 . . . . . . . . . . 11  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  T )
7473, 41eqtrd 2470 . . . . . . . . . 10  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A ++  B ) ) )
75 ccatopth 12811 . . . . . . . . . 10  |-  ( ( ( ( S substr  <. 0 ,  T >. )  e. Word  X  /\  ( S substr  <. T , 
( # `  S )
>. )  e. Word  X )  /\  ( ( A ++  B )  e. Word  X  /\  C  e. Word  X )  /\  ( # `  ( S substr  <. 0 ,  T >. ) )  =  (
# `  ( A ++  B ) ) )  ->  ( ( ( S substr  <. 0 ,  T >. ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A ++  B ) ++  C )  <->  ( ( S substr  <. 0 ,  T >. )  =  ( A ++  B )  /\  ( S substr  <. T ,  (
# `  S ) >. )  =  C ) ) )
7669, 71, 5, 6, 74, 75syl221anc 1275 . . . . . . . . 9  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  T >. ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  =  ( ( A ++  B ) ++  C )  <->  ( ( S substr  <. 0 ,  T >. )  =  ( A ++  B )  /\  ( S substr  <. T ,  (
# `  S ) >. )  =  C ) ) )
7767, 76mpbid 213 . . . . . . . 8  |-  ( ph  ->  ( ( S substr  <. 0 ,  T >. )  =  ( A ++  B )  /\  ( S substr  <. T , 
( # `  S )
>. )  =  C
) )
7877simpld 460 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  T >. )  =  ( A ++  B ) )
7955, 78eqtrd 2470 . . . . . 6  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) ++  ( S substr  <. F ,  T >. ) )  =  ( A ++  B ) )
80 swrdcl 12760 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. 0 ,  F >. )  e. Word  X )
819, 80syl 17 . . . . . . 7  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  e. Word  X
)
82 swrdcl 12760 . . . . . . . 8  |-  ( S  e. Word  X  ->  ( S substr  <. F ,  T >. )  e. Word  X )
839, 82syl 17 . . . . . . 7  |-  ( ph  ->  ( S substr  <. F ,  T >. )  e. Word  X
)
84 uztrn 11175 . . . . . . . . . . 11  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
8551, 31, 84syl2anc 665 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
86 elfzuzb 11792 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
8723, 85, 86sylanbrc 668 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
88 swrd0len 12763 . . . . . . . . 9  |-  ( ( S  e. Word  X  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
899, 87, 88syl2anc 665 . . . . . . . 8  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
9089, 10eqtrd 2470 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  (
# `  A )
)
91 ccatopth 12811 . . . . . . 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 >. ) ++  ( S substr  <. F ,  T >. ) )  =  ( A ++  B )  <->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) ) )
9281, 83, 2, 3, 90, 91syl221anc 1275 . . . . . 6  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) ++  ( S substr  <. F ,  T >. ) )  =  ( A ++  B )  <-> 
( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) ) )
9379, 92mpbid 213 . . . . 5  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. )  =  A  /\  ( S substr  <. F ,  T >. )  =  B ) )
9493simpld 460 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  =  A )
9594oveq1d 6320 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) ++  R )  =  ( A ++  R
) )
9677simprd 464 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  =  C
)
9795, 96oveq12d 6323 . 2  |-  ( ph  ->  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T ,  ( # `  S ) >. )
)  =  ( ( A ++  R ) ++  C
) )
9821, 97eqtrd 2470 1  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( A ++  R ) ++  C ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 187    /\ wa 370    = wceq 1437    e. wcel 1870   <.cop 4008   <.cotp 4010   ` cfv 5601  (class class class)co 6305   0cc0 9538    + caddc 9541   NN0cn0 10869   ZZcz 10937   ZZ>=cuz 11159   ...cfz 11782   #chash 12512  Word cword 12643   ++ cconcat 12645   substr csubstr 12647   splice csplice 12648
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1665  ax-4 1678  ax-5 1751  ax-6 1797  ax-7 1841  ax-8 1872  ax-9 1874  ax-10 1889  ax-11 1894  ax-12 1907  ax-13 2055  ax-ext 2407  ax-rep 4538  ax-sep 4548  ax-nul 4556  ax-pow 4603  ax-pr 4661  ax-un 6597  ax-cnex 9594  ax-resscn 9595  ax-1cn 9596  ax-icn 9597  ax-addcl 9598  ax-addrcl 9599  ax-mulcl 9600  ax-mulrcl 9601  ax-mulcom 9602  ax-addass 9603  ax-mulass 9604  ax-distr 9605  ax-i2m1 9606  ax-1ne0 9607  ax-1rid 9608  ax-rnegex 9609  ax-rrecex 9610  ax-cnre 9611  ax-pre-lttri 9612  ax-pre-lttrn 9613  ax-pre-ltadd 9614  ax-pre-mulgt0 9615
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-tru 1440  df-ex 1660  df-nf 1664  df-sb 1790  df-eu 2270  df-mo 2271  df-clab 2415  df-cleq 2421  df-clel 2424  df-nfc 2579  df-ne 2627  df-nel 2628  df-ral 2787  df-rex 2788  df-reu 2789  df-rmo 2790  df-rab 2791  df-v 3089  df-sbc 3306  df-csb 3402  df-dif 3445  df-un 3447  df-in 3449  df-ss 3456  df-pss 3458  df-nul 3768  df-if 3916  df-pw 3987  df-sn 4003  df-pr 4005  df-tp 4007  df-op 4009  df-ot 4011  df-uni 4223  df-int 4259  df-iun 4304  df-br 4427  df-opab 4485  df-mpt 4486  df-tr 4521  df-eprel 4765  df-id 4769  df-po 4775  df-so 4776  df-fr 4813  df-we 4815  df-xp 4860  df-rel 4861  df-cnv 4862  df-co 4863  df-dm 4864  df-rn 4865  df-res 4866  df-ima 4867  df-pred 5399  df-ord 5445  df-on 5446  df-lim 5447  df-suc 5448  df-iota 5565  df-fun 5603  df-fn 5604  df-f 5605  df-f1 5606  df-fo 5607  df-f1o 5608  df-fv 5609  df-riota 6267  df-ov 6308  df-oprab 6309  df-mpt2 6310  df-om 6707  df-1st 6807  df-2nd 6808  df-wrecs 7036  df-recs 7098  df-rdg 7136  df-1o 7190  df-oadd 7194  df-er 7371  df-en 7578  df-dom 7579  df-sdom 7580  df-fin 7581  df-card 8372  df-cda 8596  df-pnf 9676  df-mnf 9677  df-xr 9678  df-ltxr 9679  df-le 9680  df-sub 9861  df-neg 9862  df-nn 10610  df-2 10668  df-n0 10870  df-z 10938  df-uz 11160  df-fz 11783  df-fzo 11914  df-hash 12513  df-word 12651  df-concat 12653  df-substr 12655  df-splice 12656
This theorem is referenced by:  efginvrel2  17312  efgredleme  17328  efgcpbllemb  17340  frgpnabllem1  17444
  Copyright terms: Public domain W3C validator