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

Theorem spllen 11712
Description: The length of a splice. (Contributed by Stefan O'Rear, 23-Aug-2015.)
Hypotheses
Ref Expression
spllen.s  |-  ( ph  ->  S  e. Word  A )
spllen.f  |-  ( ph  ->  F  e.  ( 0 ... T ) )
spllen.t  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
spllen.r  |-  ( ph  ->  R  e. Word  A )
Assertion
Ref Expression
spllen  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )

Proof of Theorem spllen
StepHypRef Expression
1 spllen.s . . . 4  |-  ( ph  ->  S  e. Word  A )
2 spllen.f . . . 4  |-  ( ph  ->  F  e.  ( 0 ... T ) )
3 spllen.t . . . 4  |-  ( ph  ->  T  e.  ( 0 ... ( # `  S
) ) )
4 spllen.r . . . 4  |-  ( ph  ->  R  e. Word  A )
5 splval 11709 . . . 4  |-  ( ( S  e. Word  A  /\  ( F  e.  (
0 ... T )  /\  T  e.  ( 0 ... ( # `  S
) )  /\  R  e. Word  A ) )  -> 
( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
61, 2, 3, 4, 5syl13anc 1186 . . 3  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )
76fveq2d 5674 . 2  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( # `  (
( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) ) )
8 swrdcl 11695 . . . . 5  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  F >. )  e. Word  A )
91, 8syl 16 . . . 4  |-  ( ph  ->  ( S substr  <. 0 ,  F >. )  e. Word  A
)
10 ccatcl 11672 . . . 4  |-  ( ( ( S substr  <. 0 ,  F >. )  e. Word  A  /\  R  e. Word  A )  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  e. Word  A
)
119, 4, 10syl2anc 643 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) concat  R )  e. Word  A )
12 swrdcl 11695 . . . 4  |-  ( S  e. Word  A  ->  ( S substr  <. T ,  (
# `  S ) >. )  e. Word  A )
131, 12syl 16 . . 3  |-  ( ph  ->  ( S substr  <. T , 
( # `  S )
>. )  e. Word  A )
14 ccatlen 11673 . . 3  |-  ( ( ( ( S substr  <. 0 ,  F >. ) concat  R )  e. Word  A  /\  ( S substr  <. T ,  ( # `  S ) >. )  e. Word  A )  ->  ( # `
 ( ( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )  =  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) ) )
1511, 13, 14syl2anc 643 . 2  |-  ( ph  ->  ( # `  (
( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) )  =  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) ) )
16 lencl 11664 . . . . . . 7  |-  ( R  e. Word  A  ->  ( # `
 R )  e. 
NN0 )
174, 16syl 16 . . . . . 6  |-  ( ph  ->  ( # `  R
)  e.  NN0 )
1817nn0cnd 10210 . . . . 5  |-  ( ph  ->  ( # `  R
)  e.  CC )
19 elfzelz 10993 . . . . . . 7  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ZZ )
202, 19syl 16 . . . . . 6  |-  ( ph  ->  F  e.  ZZ )
2120zcnd 10310 . . . . 5  |-  ( ph  ->  F  e.  CC )
2218, 21addcld 9042 . . . 4  |-  ( ph  ->  ( ( # `  R
)  +  F )  e.  CC )
23 elfzel2 10991 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ZZ )
243, 23syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ZZ )
2524zcnd 10310 . . . 4  |-  ( ph  ->  ( # `  S
)  e.  CC )
26 elfzelz 10993 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  T  e.  ZZ )
273, 26syl 16 . . . . 5  |-  ( ph  ->  T  e.  ZZ )
2827zcnd 10310 . . . 4  |-  ( ph  ->  T  e.  CC )
2922, 25, 28addsub12d 9368 . . 3  |-  ( ph  ->  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) )  =  ( ( # `  S
)  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
30 ccatlen 11673 . . . . . 6  |-  ( ( ( S substr  <. 0 ,  F >. )  e. Word  A  /\  R  e. Word  A )  ->  ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  =  ( (
# `  ( S substr  <.
0 ,  F >. ) )  +  ( # `  R ) ) )
319, 4, 30syl2anc 643 . . . . 5  |-  ( ph  ->  ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  =  ( (
# `  ( S substr  <.
0 ,  F >. ) )  +  ( # `  R ) ) )
32 elfzuz 10989 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ( ZZ>= `  0 )
)
332, 32syl 16 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
34 eluzfz1 10998 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
3533, 34syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
36 elfzuz3 10990 . . . . . . . . . . 11  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  T )
)
373, 36syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
38 elfzuz3 10990 . . . . . . . . . . 11  |-  ( F  e.  ( 0 ... T )  ->  T  e.  ( ZZ>= `  F )
)
392, 38syl 16 . . . . . . . . . 10  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
40 uztrn 10436 . . . . . . . . . 10  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
4137, 39, 40syl2anc 643 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
42 elfzuzb 10987 . . . . . . . . 9  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
4333, 41, 42sylanbrc 646 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
44 swrdlen 11699 . . . . . . . 8  |-  ( ( S  e. Word  A  /\  0  e.  ( 0 ... F )  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  ( F  -  0 ) )
451, 35, 43, 44syl3anc 1184 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  ( F  -  0 ) )
4621subid1d 9334 . . . . . . 7  |-  ( ph  ->  ( F  -  0 )  =  F )
4745, 46eqtrd 2421 . . . . . 6  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
4847oveq1d 6037 . . . . 5  |-  ( ph  ->  ( ( # `  ( S substr  <. 0 ,  F >. ) )  +  (
# `  R )
)  =  ( F  +  ( # `  R
) ) )
4921, 18addcomd 9202 . . . . 5  |-  ( ph  ->  ( F  +  (
# `  R )
)  =  ( (
# `  R )  +  F ) )
5031, 48, 493eqtrd 2425 . . . 4  |-  ( ph  ->  ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  =  ( (
# `  R )  +  F ) )
51 elfzuz2 10996 . . . . . . 7  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  0 )
)
523, 51syl 16 . . . . . 6  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
53 eluzfz2 10999 . . . . . 6  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
5452, 53syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
55 swrdlen 11699 . . . . 5  |-  ( ( S  e. Word  A  /\  T  e.  ( 0 ... ( # `  S
) )  /\  ( # `
 S )  e.  ( 0 ... ( # `
 S ) ) )  ->  ( # `  ( S substr  <. T ,  (
# `  S ) >. ) )  =  ( ( # `  S
)  -  T ) )
561, 3, 54, 55syl3anc 1184 . . . 4  |-  ( ph  ->  ( # `  ( S substr  <. T ,  (
# `  S ) >. ) )  =  ( ( # `  S
)  -  T ) )
5750, 56oveq12d 6040 . . 3  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) ) )
5818, 28, 21subsub3d 9375 . . . 4  |-  ( ph  ->  ( ( # `  R
)  -  ( T  -  F ) )  =  ( ( (
# `  R )  +  F )  -  T
) )
5958oveq2d 6038 . . 3  |-  ( ph  ->  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) )  =  ( ( # `  S )  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
6029, 57, 593eqtr4d 2431 . 2  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
617, 15, 603eqtrd 2425 1  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    = wceq 1649    e. wcel 1717   <.cop 3762   <.cotp 3763   ` cfv 5396  (class class class)co 6022   0cc0 8925    + caddc 8928    - cmin 9225   NN0cn0 10155   ZZcz 10216   ZZ>=cuz 10422   ...cfz 10977   #chash 11547  Word cword 11646   concat cconcat 11647   substr csubstr 11649   splice csplice 11650
This theorem is referenced by:  efgtlen  15287  psgnunilem2  27089
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2370  ax-rep 4263  ax-sep 4273  ax-nul 4281  ax-pow 4320  ax-pr 4346  ax-un 4643  ax-cnex 8981  ax-resscn 8982  ax-1cn 8983  ax-icn 8984  ax-addcl 8985  ax-addrcl 8986  ax-mulcl 8987  ax-mulrcl 8988  ax-mulcom 8989  ax-addass 8990  ax-mulass 8991  ax-distr 8992  ax-i2m1 8993  ax-1ne0 8994  ax-1rid 8995  ax-rnegex 8996  ax-rrecex 8997  ax-cnre 8998  ax-pre-lttri 8999  ax-pre-lttrn 9000  ax-pre-ltadd 9001  ax-pre-mulgt0 9002
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2244  df-mo 2245  df-clab 2376  df-cleq 2382  df-clel 2385  df-nfc 2514  df-ne 2554  df-nel 2555  df-ral 2656  df-rex 2657  df-reu 2658  df-rab 2660  df-v 2903  df-sbc 3107  df-csb 3197  df-dif 3268  df-un 3270  df-in 3272  df-ss 3279  df-pss 3281  df-nul 3574  df-if 3685  df-pw 3746  df-sn 3765  df-pr 3766  df-tp 3767  df-op 3768  df-ot 3769  df-uni 3960  df-int 3995  df-iun 4039  df-br 4156  df-opab 4210  df-mpt 4211  df-tr 4246  df-eprel 4437  df-id 4441  df-po 4446  df-so 4447  df-fr 4484  df-we 4486  df-ord 4527  df-on 4528  df-lim 4529  df-suc 4530  df-om 4788  df-xp 4826  df-rel 4827  df-cnv 4828  df-co 4829  df-dm 4830  df-rn 4831  df-res 4832  df-ima 4833  df-iota 5360  df-fun 5398  df-fn 5399  df-f 5400  df-f1 5401  df-fo 5402  df-f1o 5403  df-fv 5404  df-ov 6025  df-oprab 6026  df-mpt2 6027  df-1st 6290  df-2nd 6291  df-riota 6487  df-recs 6571  df-rdg 6606  df-1o 6662  df-oadd 6666  df-er 6843  df-en 7048  df-dom 7049  df-sdom 7050  df-fin 7051  df-card 7761  df-pnf 9057  df-mnf 9058  df-xr 9059  df-ltxr 9060  df-le 9061  df-sub 9227  df-neg 9228  df-nn 9935  df-n0 10156  df-z 10217  df-uz 10423  df-fz 10978  df-fzo 11068  df-hash 11548  df-word 11652  df-concat 11653  df-substr 11655  df-splice 11656
  Copyright terms: Public domain W3C validator