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

Theorem spllen 12721
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 12718 . . . 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 >. ) ++  R ) ++  ( S substr  <. T ,  (
# `  S ) >. ) ) )
61, 2, 3, 4, 5syl13anc 1228 . . 3  |-  ( ph  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T ,  (
# `  S ) >. ) ) )
76fveq2d 5852 . 2  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( # `  (
( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) ) )
8 swrdcl 12635 . . . . 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 12582 . . . 4  |-  ( ( ( S substr  <. 0 ,  F >. )  e. Word  A  /\  R  e. Word  A )  ->  ( ( S substr  <. 0 ,  F >. ) ++  R )  e. Word  A
)
119, 4, 10syl2anc 659 . . 3  |-  ( ph  ->  ( ( S substr  <. 0 ,  F >. ) ++  R )  e. Word  A )
12 swrdcl 12635 . . . 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 12583 . . 3  |-  ( ( ( ( S substr  <. 0 ,  F >. ) ++  R )  e. Word  A  /\  ( S substr  <. T ,  (
# `  S ) >. )  e. Word  A )  ->  ( # `  (
( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) ) )
1511, 13, 14syl2anc 659 . 2  |-  ( ph  ->  ( # `  (
( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) ) )
16 lencl 12549 . . . . . . 7  |-  ( R  e. Word  A  ->  ( # `
 R )  e. 
NN0 )
174, 16syl 16 . . . . . 6  |-  ( ph  ->  ( # `  R
)  e.  NN0 )
1817nn0cnd 10850 . . . . 5  |-  ( ph  ->  ( # `  R
)  e.  CC )
19 elfzelz 11691 . . . . . . 7  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ZZ )
202, 19syl 16 . . . . . 6  |-  ( ph  ->  F  e.  ZZ )
2120zcnd 10966 . . . . 5  |-  ( ph  ->  F  e.  CC )
2218, 21addcld 9604 . . . 4  |-  ( ph  ->  ( ( # `  R
)  +  F )  e.  CC )
23 elfzel2 11689 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ZZ )
243, 23syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ZZ )
2524zcnd 10966 . . . 4  |-  ( ph  ->  ( # `  S
)  e.  CC )
26 elfzelz 11691 . . . . . 6  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  T  e.  ZZ )
273, 26syl 16 . . . . 5  |-  ( ph  ->  T  e.  ZZ )
2827zcnd 10966 . . . 4  |-  ( ph  ->  T  e.  CC )
2922, 25, 28addsub12d 9945 . . 3  |-  ( ph  ->  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) )  =  ( ( # `  S
)  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
30 ccatlen 12583 . . . . . 6  |-  ( ( ( S substr  <. 0 ,  F >. )  e. Word  A  /\  R  e. Word  A )  ->  ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  =  ( (
# `  ( S substr  <.
0 ,  F >. ) )  +  ( # `  R ) ) )
319, 4, 30syl2anc 659 . . . . 5  |-  ( ph  ->  ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  =  ( (
# `  ( S substr  <.
0 ,  F >. ) )  +  ( # `  R ) ) )
32 elfzuz 11687 . . . . . . . . . 10  |-  ( F  e.  ( 0 ... T )  ->  F  e.  ( ZZ>= `  0 )
)
332, 32syl 16 . . . . . . . . 9  |-  ( ph  ->  F  e.  ( ZZ>= ` 
0 ) )
34 eluzfz1 11696 . . . . . . . . 9  |-  ( F  e.  ( ZZ>= `  0
)  ->  0  e.  ( 0 ... F
) )
3533, 34syl 16 . . . . . . . 8  |-  ( ph  ->  0  e.  ( 0 ... F ) )
36 elfzuz3 11688 . . . . . . . . . . 11  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  T )
)
373, 36syl 16 . . . . . . . . . 10  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  T ) )
38 elfzuz3 11688 . . . . . . . . . . 11  |-  ( F  e.  ( 0 ... T )  ->  T  e.  ( ZZ>= `  F )
)
392, 38syl 16 . . . . . . . . . 10  |-  ( ph  ->  T  e.  ( ZZ>= `  F ) )
40 uztrn 11098 . . . . . . . . . 10  |-  ( ( ( # `  S
)  e.  ( ZZ>= `  T )  /\  T  e.  ( ZZ>= `  F )
)  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
4137, 39, 40syl2anc 659 . . . . . . . . 9  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= `  F ) )
42 elfzuzb 11685 . . . . . . . . 9  |-  ( F  e.  ( 0 ... ( # `  S
) )  <->  ( F  e.  ( ZZ>= `  0 )  /\  ( # `  S
)  e.  ( ZZ>= `  F ) ) )
4333, 41, 42sylanbrc 662 . . . . . . . 8  |-  ( ph  ->  F  e.  ( 0 ... ( # `  S
) ) )
44 swrdlen 12639 . . . . . . . 8  |-  ( ( S  e. Word  A  /\  0  e.  ( 0 ... F )  /\  F  e.  ( 0 ... ( # `  S
) ) )  -> 
( # `  ( S substr  <. 0 ,  F >. ) )  =  ( F  -  0 ) )
451, 35, 43, 44syl3anc 1226 . . . . . . 7  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  ( F  -  0 ) )
4621subid1d 9911 . . . . . . 7  |-  ( ph  ->  ( F  -  0 )  =  F )
4745, 46eqtrd 2495 . . . . . 6  |-  ( ph  ->  ( # `  ( S substr  <. 0 ,  F >. ) )  =  F )
4847oveq1d 6285 . . . . 5  |-  ( ph  ->  ( ( # `  ( S substr  <. 0 ,  F >. ) )  +  (
# `  R )
)  =  ( F  +  ( # `  R
) ) )
4921, 18addcomd 9771 . . . . 5  |-  ( ph  ->  ( F  +  (
# `  R )
)  =  ( (
# `  R )  +  F ) )
5031, 48, 493eqtrd 2499 . . . 4  |-  ( ph  ->  ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  =  ( (
# `  R )  +  F ) )
51 elfzuz2 11694 . . . . . . 7  |-  ( T  e.  ( 0 ... ( # `  S
) )  ->  ( # `
 S )  e.  ( ZZ>= `  0 )
)
523, 51syl 16 . . . . . 6  |-  ( ph  ->  ( # `  S
)  e.  ( ZZ>= ` 
0 ) )
53 eluzfz2 11697 . . . . . 6  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
5452, 53syl 16 . . . . 5  |-  ( ph  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
55 swrdlen 12639 . . . . 5  |-  ( ( S  e. Word  A  /\  T  e.  ( 0 ... ( # `  S
) )  /\  ( # `
 S )  e.  ( 0 ... ( # `
 S ) ) )  ->  ( # `  ( S substr  <. T ,  (
# `  S ) >. ) )  =  ( ( # `  S
)  -  T ) )
561, 3, 54, 55syl3anc 1226 . . . 4  |-  ( ph  ->  ( # `  ( S substr  <. T ,  (
# `  S ) >. ) )  =  ( ( # `  S
)  -  T ) )
5750, 56oveq12d 6288 . . 3  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( ( # `  R )  +  F
)  +  ( (
# `  S )  -  T ) ) )
5818, 28, 21subsub3d 9952 . . . 4  |-  ( ph  ->  ( ( # `  R
)  -  ( T  -  F ) )  =  ( ( (
# `  R )  +  F )  -  T
) )
5958oveq2d 6286 . . 3  |-  ( ph  ->  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) )  =  ( ( # `  S )  +  ( ( ( # `  R
)  +  F )  -  T ) ) )
6029, 57, 593eqtr4d 2505 . 2  |-  ( ph  ->  ( ( # `  (
( S substr  <. 0 ,  F >. ) ++  R ) )  +  ( # `  ( S substr  <. T , 
( # `  S )
>. ) ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
617, 15, 603eqtrd 2499 1  |-  ( ph  ->  ( # `  ( S splice  <. F ,  T ,  R >. ) )  =  ( ( # `  S
)  +  ( (
# `  R )  -  ( T  -  F ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    = wceq 1398    e. wcel 1823   <.cop 4022   <.cotp 4024   ` cfv 5570  (class class class)co 6270   0cc0 9481    + caddc 9484    - cmin 9796   NN0cn0 10791   ZZcz 10860   ZZ>=cuz 11082   ...cfz 11675   #chash 12387  Word cword 12518   ++ cconcat 12520   substr csubstr 12522   splice csplice 12523
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1623  ax-4 1636  ax-5 1709  ax-6 1752  ax-7 1795  ax-8 1825  ax-9 1827  ax-10 1842  ax-11 1847  ax-12 1859  ax-13 2004  ax-ext 2432  ax-rep 4550  ax-sep 4560  ax-nul 4568  ax-pow 4615  ax-pr 4676  ax-un 6565  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1401  df-ex 1618  df-nf 1622  df-sb 1745  df-eu 2288  df-mo 2289  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2651  df-nel 2652  df-ral 2809  df-rex 2810  df-reu 2811  df-rmo 2812  df-rab 2813  df-v 3108  df-sbc 3325  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3784  df-if 3930  df-pw 4001  df-sn 4017  df-pr 4019  df-tp 4021  df-op 4023  df-ot 4025  df-uni 4236  df-int 4272  df-iun 4317  df-br 4440  df-opab 4498  df-mpt 4499  df-tr 4533  df-eprel 4780  df-id 4784  df-po 4789  df-so 4790  df-fr 4827  df-we 4829  df-ord 4870  df-on 4871  df-lim 4872  df-suc 4873  df-xp 4994  df-rel 4995  df-cnv 4996  df-co 4997  df-dm 4998  df-rn 4999  df-res 5000  df-ima 5001  df-iota 5534  df-fun 5572  df-fn 5573  df-f 5574  df-f1 5575  df-fo 5576  df-f1o 5577  df-fv 5578  df-riota 6232  df-ov 6273  df-oprab 6274  df-mpt2 6275  df-om 6674  df-1st 6773  df-2nd 6774  df-recs 7034  df-rdg 7068  df-1o 7122  df-oadd 7126  df-er 7303  df-en 7510  df-dom 7511  df-sdom 7512  df-fin 7513  df-card 8311  df-cda 8539  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9798  df-neg 9799  df-nn 10532  df-2 10590  df-n0 10792  df-z 10861  df-uz 11083  df-fz 11676  df-fzo 11800  df-hash 12388  df-word 12526  df-concat 12528  df-substr 12530  df-splice 12531
This theorem is referenced by:  psgnunilem2  16719  efgtlen  16943
  Copyright terms: Public domain W3C validator