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

Theorem splval 12832
Description: Value of the substring replacement operator. (Contributed by Stefan O'Rear, 15-Aug-2015.)
Assertion
Ref Expression
splval  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) )

Proof of Theorem splval
Dummy variables  s 
b are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 df-splice 12645 . . 3  |- splice  =  ( s  e.  _V , 
b  e.  _V  |->  ( ( ( s substr  <. 0 ,  ( 1st `  ( 1st `  b
) ) >. ) ++  ( 2nd `  b ) ) ++  ( s substr  <. ( 2nd `  ( 1st `  b ) ) ,  ( # `  s
) >. ) ) )
21a1i 11 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  -> splice  =  ( s  e.  _V , 
b  e.  _V  |->  ( ( ( s substr  <. 0 ,  ( 1st `  ( 1st `  b
) ) >. ) ++  ( 2nd `  b ) ) ++  ( s substr  <. ( 2nd `  ( 1st `  b ) ) ,  ( # `  s
) >. ) ) ) )
3 simprl 762 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  s  =  S )
4 fveq2 5872 . . . . . . . . 9  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 1st `  b )  =  ( 1st `  <. F ,  T ,  R >. ) )
54fveq2d 5876 . . . . . . . 8  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 1st `  ( 1st `  b
) )  =  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) ) )
65adantl 467 . . . . . . 7  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 1st `  ( 1st `  b ) )  =  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) ) )
7 ot1stg 6812 . . . . . . . 8  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) )  =  F )
87adantl 467 . . . . . . 7  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) )  =  F )
96, 8sylan9eqr 2483 . . . . . 6  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 1st `  ( 1st `  b
) )  =  F )
109opeq2d 4188 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  <. 0 ,  ( 1st `  ( 1st `  b ) )
>.  =  <. 0 ,  F >. )
113, 10oveq12d 6314 . . . 4  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( s substr  <.
0 ,  ( 1st `  ( 1st `  b
) ) >. )  =  ( S substr  <. 0 ,  F >. ) )
12 fveq2 5872 . . . . . 6  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 2nd `  b )  =  ( 2nd `  <. F ,  T ,  R >. ) )
1312adantl 467 . . . . 5  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 2nd `  b
)  =  ( 2nd `  <. F ,  T ,  R >. ) )
14 ot3rdg 6814 . . . . . . 7  |-  ( R  e.  Y  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
15143ad2ant3 1028 . . . . . 6  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
1615adantl 467 . . . . 5  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
1713, 16sylan9eqr 2483 . . . 4  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 2nd `  b )  =  R )
1811, 17oveq12d 6314 . . 3  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( (
s substr  <. 0 ,  ( 1st `  ( 1st `  b ) ) >.
) ++  ( 2nd `  b
) )  =  ( ( S substr  <. 0 ,  F >. ) ++  R ) )
194fveq2d 5876 . . . . . . 7  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 2nd `  ( 1st `  b
) )  =  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) ) )
2019adantl 467 . . . . . 6  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 2nd `  ( 1st `  b ) )  =  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) ) )
21 ot2ndg 6813 . . . . . . 7  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) )  =  T )
2221adantl 467 . . . . . 6  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) )  =  T )
2320, 22sylan9eqr 2483 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 2nd `  ( 1st `  b
) )  =  T )
243fveq2d 5876 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( # `  s
)  =  ( # `  S ) )
2523, 24opeq12d 4189 . . . 4  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  <. ( 2nd `  ( 1st `  b
) ) ,  (
# `  s ) >.  =  <. T ,  (
# `  S ) >. )
263, 25oveq12d 6314 . . 3  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( s substr  <.
( 2nd `  ( 1st `  b ) ) ,  ( # `  s
) >. )  =  ( S substr  <. T ,  (
# `  S ) >. ) )
2718, 26oveq12d 6314 . 2  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( (
( s substr  <. 0 ,  ( 1st `  ( 1st `  b ) )
>. ) ++  ( 2nd `  b ) ) ++  ( s substr  <. ( 2nd `  ( 1st `  b ) ) ,  ( # `  s
) >. ) )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T ,  ( # `  S ) >. )
) )
28 elex 3087 . . 3  |-  ( S  e.  V  ->  S  e.  _V )
2928adantr 466 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  S  e.  _V )
30 otex 4678 . . 3  |-  <. F ,  T ,  R >.  e. 
_V
3130a1i 11 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  <. F ,  T ,  R >.  e. 
_V )
32 ovex 6324 . . 3  |-  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  e.  _V
3332a1i 11 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  (
( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  e.  _V )
342, 27, 29, 31, 33ovmpt2d 6429 1  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( S splice  <. F ,  T ,  R >. )  =  ( ( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 370    /\ w3a 982    = wceq 1437    e. wcel 1867   _Vcvv 3078   <.cop 3999   <.cotp 4001   ` cfv 5592  (class class class)co 6296    |-> cmpt2 6298   1stc1st 6796   2ndc2nd 6797   0cc0 9528   #chash 12501   ++ cconcat 12634   substr csubstr 12636   splice csplice 12637
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 1748  ax-6 1794  ax-7 1838  ax-8 1869  ax-9 1871  ax-10 1886  ax-11 1891  ax-12 1904  ax-13 2052  ax-ext 2398  ax-sep 4539  ax-nul 4547  ax-pow 4594  ax-pr 4652  ax-un 6588
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3an 984  df-tru 1440  df-ex 1660  df-nf 1664  df-sb 1787  df-eu 2267  df-mo 2268  df-clab 2406  df-cleq 2412  df-clel 2415  df-nfc 2570  df-ne 2618  df-ral 2778  df-rex 2779  df-rab 2782  df-v 3080  df-sbc 3297  df-dif 3436  df-un 3438  df-in 3440  df-ss 3447  df-nul 3759  df-if 3907  df-sn 3994  df-pr 3996  df-op 4000  df-ot 4002  df-uni 4214  df-br 4418  df-opab 4476  df-mpt 4477  df-id 4760  df-xp 4851  df-rel 4852  df-cnv 4853  df-co 4854  df-dm 4855  df-rn 4856  df-iota 5556  df-fun 5594  df-fv 5600  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-1st 6798  df-2nd 6799  df-splice 12645
This theorem is referenced by:  splid  12834  spllen  12835  splfv1  12836  splfv2a  12837  splval2  12838  gsumspl  16572  efgredleme  17321  efgredlemc  17323  efgcpbllemb  17333  frgpuplem  17350  splvalpfx  38379
  Copyright terms: Public domain W3C validator