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

Theorem swrdval 11756
Description: Value of a subword. (Contributed by Stefan O'Rear, 15-Aug-2015.)
Assertion
Ref Expression
swrdval  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( S substr  <. F ,  L >. )  =  if ( ( F..^ L ) 
C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) ) )
Distinct variable groups:    x, S    x, F    x, L    x, V

Proof of Theorem swrdval
Dummy variables  s 
b are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 df-substr 11718 . . 3  |- substr  =  ( s  e.  _V , 
b  e.  ( ZZ 
X.  ZZ )  |->  if ( ( ( 1st `  b )..^ ( 2nd `  b ) )  C_  dom  s ,  ( x  e.  ( 0..^ ( ( 2nd `  b
)  -  ( 1st `  b ) ) ) 
|->  ( s `  (
x  +  ( 1st `  b ) ) ) ) ,  (/) ) )
21a1i 11 . 2  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  -> substr  =  ( s  e.  _V , 
b  e.  ( ZZ 
X.  ZZ )  |->  if ( ( ( 1st `  b )..^ ( 2nd `  b ) )  C_  dom  s ,  ( x  e.  ( 0..^ ( ( 2nd `  b
)  -  ( 1st `  b ) ) ) 
|->  ( s `  (
x  +  ( 1st `  b ) ) ) ) ,  (/) ) ) )
3 simprl 733 . . 3  |-  ( ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( s  =  S  /\  b  = 
<. F ,  L >. ) )  ->  s  =  S )
4 fveq2 5720 . . . . 5  |-  ( b  =  <. F ,  L >.  ->  ( 1st `  b
)  =  ( 1st `  <. F ,  L >. ) )
54adantl 453 . . . 4  |-  ( ( s  =  S  /\  b  =  <. F ,  L >. )  ->  ( 1st `  b )  =  ( 1st `  <. F ,  L >. )
)
6 op1stg 6351 . . . . 5  |-  ( ( F  e.  ZZ  /\  L  e.  ZZ )  ->  ( 1st `  <. F ,  L >. )  =  F )
763adant1 975 . . . 4  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( 1st `  <. F ,  L >. )  =  F )
85, 7sylan9eqr 2489 . . 3  |-  ( ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( s  =  S  /\  b  = 
<. F ,  L >. ) )  ->  ( 1st `  b )  =  F )
9 fveq2 5720 . . . . 5  |-  ( b  =  <. F ,  L >.  ->  ( 2nd `  b
)  =  ( 2nd `  <. F ,  L >. ) )
109adantl 453 . . . 4  |-  ( ( s  =  S  /\  b  =  <. F ,  L >. )  ->  ( 2nd `  b )  =  ( 2nd `  <. F ,  L >. )
)
11 op2ndg 6352 . . . . 5  |-  ( ( F  e.  ZZ  /\  L  e.  ZZ )  ->  ( 2nd `  <. F ,  L >. )  =  L )
12113adant1 975 . . . 4  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( 2nd `  <. F ,  L >. )  =  L )
1310, 12sylan9eqr 2489 . . 3  |-  ( ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( s  =  S  /\  b  = 
<. F ,  L >. ) )  ->  ( 2nd `  b )  =  L )
14 simp2 958 . . . . . 6  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  ( 1st `  b )  =  F )
15 simp3 959 . . . . . 6  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  ( 2nd `  b )  =  L )
1614, 15oveq12d 6091 . . . . 5  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
( 1st `  b
)..^ ( 2nd `  b
) )  =  ( F..^ L ) )
17 simp1 957 . . . . . 6  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  s  =  S )
1817dmeqd 5064 . . . . 5  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  dom  s  =  dom  S )
1916, 18sseq12d 3369 . . . 4  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
( ( 1st `  b
)..^ ( 2nd `  b
) )  C_  dom  s 
<->  ( F..^ L ) 
C_  dom  S )
)
2015, 14oveq12d 6091 . . . . . 6  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
( 2nd `  b
)  -  ( 1st `  b ) )  =  ( L  -  F
) )
2120oveq2d 6089 . . . . 5  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
0..^ ( ( 2nd `  b )  -  ( 1st `  b ) ) )  =  ( 0..^ ( L  -  F
) ) )
2214oveq2d 6089 . . . . . 6  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
x  +  ( 1st `  b ) )  =  ( x  +  F
) )
2317, 22fveq12d 5726 . . . . 5  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
s `  ( x  +  ( 1st `  b
) ) )  =  ( S `  (
x  +  F ) ) )
2421, 23mpteq12dv 4279 . . . 4  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (
x  e.  ( 0..^ ( ( 2nd `  b
)  -  ( 1st `  b ) ) ) 
|->  ( s `  (
x  +  ( 1st `  b ) ) ) )  =  ( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F
) ) ) )
25 eqidd 2436 . . . 4  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  (/)  =  (/) )
2619, 24, 25ifbieq12d 3753 . . 3  |-  ( ( s  =  S  /\  ( 1st `  b )  =  F  /\  ( 2nd `  b )  =  L )  ->  if ( ( ( 1st `  b )..^ ( 2nd `  b ) )  C_  dom  s ,  ( x  e.  ( 0..^ ( ( 2nd `  b
)  -  ( 1st `  b ) ) ) 
|->  ( s `  (
x  +  ( 1st `  b ) ) ) ) ,  (/) )  =  if ( ( F..^ L )  C_  dom  S ,  ( x  e.  ( 0..^ ( L  -  F ) ) 
|->  ( S `  (
x  +  F ) ) ) ,  (/) ) )
273, 8, 13, 26syl3anc 1184 . 2  |-  ( ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  /\  ( s  =  S  /\  b  = 
<. F ,  L >. ) )  ->  if (
( ( 1st `  b
)..^ ( 2nd `  b
) )  C_  dom  s ,  ( x  e.  ( 0..^ ( ( 2nd `  b )  -  ( 1st `  b
) ) )  |->  ( s `  ( x  +  ( 1st `  b
) ) ) ) ,  (/) )  =  if ( ( F..^ L
)  C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) ) )
28 elex 2956 . . 3  |-  ( S  e.  V  ->  S  e.  _V )
29283ad2ant1 978 . 2  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  S  e.  _V )
30 opelxpi 4902 . . 3  |-  ( ( F  e.  ZZ  /\  L  e.  ZZ )  -> 
<. F ,  L >.  e.  ( ZZ  X.  ZZ ) )
31303adant1 975 . 2  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  <. F ,  L >.  e.  ( ZZ 
X.  ZZ ) )
32 ovex 6098 . . . . 5  |-  ( 0..^ ( L  -  F
) )  e.  _V
3332mptex 5958 . . . 4  |-  ( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F
) ) )  e. 
_V
34 0ex 4331 . . . 4  |-  (/)  e.  _V
3533, 34ifex 3789 . . 3  |-  if ( ( F..^ L ) 
C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) )  e. 
_V
3635a1i 11 . 2  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  if ( ( F..^ L
)  C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) )  e. 
_V )
372, 27, 29, 31, 36ovmpt2d 6193 1  |-  ( ( S  e.  V  /\  F  e.  ZZ  /\  L  e.  ZZ )  ->  ( S substr  <. F ,  L >. )  =  if ( ( F..^ L ) 
C_  dom  S , 
( x  e.  ( 0..^ ( L  -  F ) )  |->  ( S `  ( x  +  F ) ) ) ,  (/) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 359    /\ w3a 936    = wceq 1652    e. wcel 1725   _Vcvv 2948    C_ wss 3312   (/)c0 3620   ifcif 3731   <.cop 3809    e. cmpt 4258    X. cxp 4868   dom cdm 4870   ` cfv 5446  (class class class)co 6073    e. cmpt2 6075   1stc1st 6339   2ndc2nd 6340   0cc0 8982    + caddc 8985    - cmin 9283   ZZcz 10274  ..^cfzo 11127   substr csubstr 11712
This theorem is referenced by:  swrd00  11757  swrdcl  11758  swrdval2  11759  swrdltnd  28153  swrdnd  28154  swrd0  28155  swrdvalodm2  28160  swrdvalodm  28161
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
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  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-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-nul 3621  df-if 3732  df-sn 3812  df-pr 3813  df-op 3815  df-uni 4008  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-id 4490  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-substr 11718
  Copyright terms: Public domain W3C validator