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

Theorem splval 13502
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 13304 . . 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 794 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  s  =  S )
4 fveq2 6191 . . . . . . . . 9  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 1st `  b )  =  ( 1st `  <. F ,  T ,  R >. ) )
54fveq2d 6195 . . . . . . . 8  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 1st `  ( 1st `  b
) )  =  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) ) )
65adantl 482 . . . . . . 7  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 1st `  ( 1st `  b ) )  =  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) ) )
7 ot1stg 7182 . . . . . . . 8  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) )  =  F )
87adantl 482 . . . . . . 7  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 1st `  ( 1st `  <. F ,  T ,  R >. ) )  =  F )
96, 8sylan9eqr 2678 . . . . . 6  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 1st `  ( 1st `  b
) )  =  F )
109opeq2d 4409 . . . . 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 6668 . . . 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 6191 . . . . . 6  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 2nd `  b )  =  ( 2nd `  <. F ,  T ,  R >. ) )
1312adantl 482 . . . . 5  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 2nd `  b
)  =  ( 2nd `  <. F ,  T ,  R >. ) )
14 ot3rdg 7184 . . . . . . 7  |-  ( R  e.  Y  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
15143ad2ant3 1084 . . . . . 6  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
1615adantl 482 . . . . 5  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 2nd `  <. F ,  T ,  R >. )  =  R )
1713, 16sylan9eqr 2678 . . . 4  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 2nd `  b )  =  R )
1811, 17oveq12d 6668 . . 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 6195 . . . . . . 7  |-  ( b  =  <. F ,  T ,  R >.  ->  ( 2nd `  ( 1st `  b
) )  =  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) ) )
2019adantl 482 . . . . . 6  |-  ( ( s  =  S  /\  b  =  <. F ,  T ,  R >. )  ->  ( 2nd `  ( 1st `  b ) )  =  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) ) )
21 ot2ndg 7183 . . . . . . 7  |-  ( ( F  e.  W  /\  T  e.  X  /\  R  e.  Y )  ->  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) )  =  T )
2221adantl 482 . . . . . 6  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  ( 2nd `  ( 1st `  <. F ,  T ,  R >. ) )  =  T )
2320, 22sylan9eqr 2678 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( 2nd `  ( 1st `  b
) )  =  T )
243fveq2d 6195 . . . . 5  |-  ( ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  /\  (
s  =  S  /\  b  =  <. F ,  T ,  R >. ) )  ->  ( # `  s
)  =  ( # `  S ) )
2523, 24opeq12d 4410 . . . 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 6668 . . 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 6668 . 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 3212 . . 3  |-  ( S  e.  V  ->  S  e.  _V )
2928adantr 481 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  S  e.  _V )
30 otex 4933 . . 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 ovexd 6680 . 2  |-  ( ( S  e.  V  /\  ( F  e.  W  /\  T  e.  X  /\  R  e.  Y
) )  ->  (
( ( S substr  <. 0 ,  F >. ) ++  R ) ++  ( S substr  <. T , 
( # `  S )
>. ) )  e.  _V )
332, 27, 29, 31, 32ovmpt2d 6788 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 384    /\ w3a 1037    = wceq 1483    e. wcel 1990   _Vcvv 3200   <.cop 4183   <.cotp 4185   ` cfv 5888  (class class class)co 6650    |-> cmpt2 6652   1stc1st 7166   2ndc2nd 7167   0cc0 9936   #chash 13117   ++ cconcat 13293   substr csubstr 13295   splice csplice 13296
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1722  ax-4 1737  ax-5 1839  ax-6 1888  ax-7 1935  ax-8 1992  ax-9 1999  ax-10 2019  ax-11 2034  ax-12 2047  ax-13 2246  ax-ext 2602  ax-sep 4781  ax-nul 4789  ax-pow 4843  ax-pr 4906  ax-un 6949
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3an 1039  df-tru 1486  df-ex 1705  df-nf 1710  df-sb 1881  df-eu 2474  df-mo 2475  df-clab 2609  df-cleq 2615  df-clel 2618  df-nfc 2753  df-ral 2917  df-rex 2918  df-rab 2921  df-v 3202  df-sbc 3436  df-dif 3577  df-un 3579  df-in 3581  df-ss 3588  df-nul 3916  df-if 4087  df-sn 4178  df-pr 4180  df-op 4184  df-ot 4186  df-uni 4437  df-br 4654  df-opab 4713  df-mpt 4730  df-id 5024  df-xp 5120  df-rel 5121  df-cnv 5122  df-co 5123  df-dm 5124  df-rn 5125  df-iota 5851  df-fun 5890  df-fv 5896  df-ov 6653  df-oprab 6654  df-mpt2 6655  df-1st 7168  df-2nd 7169  df-splice 13304
This theorem is referenced by:  splid  13504  spllen  13505  splfv1  13506  splfv2a  13507  splval2  13508  gsumspl  17381  efgredleme  18156  efgredlemc  18158  efgcpbllemb  18168  frgpuplem  18185  splvalpfx  41435
  Copyright terms: Public domain W3C validator