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

Theorem spllen 11775
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 11772 . . . 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 5724 . 2  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( # `  (
( ( S substr  <. 0 ,  F >. ) concat  R ) concat  ( S substr  <. T ,  (
# `  S ) >. ) ) ) )
8 swrdcl 11758 . . . . 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 11735 . . . 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 11758 . . . 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 11736 . . 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 11727 . . . . . . 7  |-  ( R  e. Word  A  ->  ( # `
 R )  e. 
NN0 )
174, 16syl 16 . . . . . 6  |-  ( ph  ->  ( # `  R
)  e.  NN0 )
1817nn0cnd 10268 . . . . 5  |-  ( ph  ->  ( # `  R
)  e.  CC )
19 elfzelz 11051 . . . . . . 7  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ZZ )
202, 19syl 16 . . . . . 6  |-  ( ph  ->  F  e.  ZZ )
2120zcnd 10368 . . . . 5  |-  ( ph  ->  F  e.  CC )
2218, 21addcld 9099 . . . 4  |-  ( ph  ->  ( ( # `  R
)  +  F )  e.  CC )
23 elfzel2 11049 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ZZ )
243, 23syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ZZ )
2524zcnd 10368 . . . 4  |-  ( ph  ->  ( # `  S
)  e.  CC )
26 elfzelz 11051 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  T  e.  ZZ )
273, 26syl 16 . . . . 5  |-  ( ph  ->  T  e.  ZZ )
2827zcnd 10368 . . . 4  |-  ( ph  ->  T  e.  CC )
2922, 25, 28addsub12d 9426 . . 3  |-  ( ph  ->  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) )  =  ( ( # `  S
)  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
30 ccatlen 11736 . . . . . 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 11047 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ( ZZ>= `  0 )
)
332, 32syl 16 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
34 eluzfz1 11056 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
3533, 34syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
36 elfzuz3 11048 . . . . . . . . . . 11  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  T )
)
373, 36syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
38 elfzuz3 11048 . . . . . . . . . . 11  |-  ( F  e.  ( 0 ... T )  ->  T  e.  ( ZZ>= `  F )
)
392, 38syl 16 . . . . . . . . . 10  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
40 uztrn 10494 . . . . . . . . . 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 11045 . . . . . . . . 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 11762 . . . . . . . 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 9392 . . . . . . 7  |-  ( ph  ->  ( F  -  0 )  =  F )
4745, 46eqtrd 2467 . . . . . 6  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
4847oveq1d 6088 . . . . 5  |-  ( ph  ->  ( ( # `  ( S substr  <. 0 ,  F >. ) )  +  (
# `  R )
)  =  ( F  +  ( # `  R
) ) )
4921, 18addcomd 9260 . . . . 5  |-  ( ph  ->  ( F  +  (
# `  R )
)  =  ( (
# `  R )  +  F ) )
5031, 48, 493eqtrd 2471 . . . 4  |-  ( ph  ->  ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  =  ( (
# `  R )  +  F ) )
51 elfzuz2 11054 . . . . . . 7  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  0 )
)
523, 51syl 16 . . . . . 6  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
53 eluzfz2 11057 . . . . . 6  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
5452, 53syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
55 swrdlen 11762 . . . . 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 6091 . . 3  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) ) )
5818, 28, 21subsub3d 9433 . . . 4  |-  ( ph  ->  ( ( # `  R
)  -  ( T  -  F ) )  =  ( ( (
# `  R )  +  F )  -  T
) )
5958oveq2d 6089 . . 3  |-  ( ph  ->  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) )  =  ( ( # `  S )  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
6029, 57, 593eqtr4d 2477 . 2  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) concat  R )
)  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
617, 15, 603eqtrd 2471 1  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    = wceq 1652    e. wcel 1725   <.cop 3809   <.cotp 3810   ` cfv 5446  (class class class)co 6073   0cc0 8982    + caddc 8985    - cmin 9283   NN0cn0 10213   ZZcz 10274   ZZ>=cuz 10480   ...cfz 11035   #chash 11610  Word cword 11709   concat cconcat 11710   substr csubstr 11712   splice csplice 11713
This theorem is referenced by:  efgtlen  15350  psgnunilem2  27376
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-rep 4312  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-ot 3816  df-uni 4008  df-int 4043  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-1st 6341  df-2nd 6342  df-riota 6541  df-recs 6625  df-rdg 6660  df-1o 6716  df-oadd 6720  df-er 6897  df-en 7102  df-dom 7103  df-sdom 7104  df-fin 7105  df-card 7818  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-nn 9993  df-n0 10214  df-z 10275  df-uz 10481  df-fz 11036  df-fzo 11128  df-hash 11611  df-word 11715  df-concat 11716  df-substr 11718  df-splice 11719
  Copyright terms: Public domain W3C validator