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

Theorem swrdid 11505
Description: A word is a subword of itself. (Contributed by Stefan O'Rear, 16-Aug-2015.)
Assertion
Ref Expression
swrdid  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )

Proof of Theorem swrdid
Dummy variable  x is distinct from all other variables.
StepHypRef Expression
1 swrdcl 11499 . . . 4  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  e. Word  A )
2 wrdf 11466 . . . 4  |-  ( ( S substr  <. 0 ,  (
# `  S ) >. )  e. Word  A  -> 
( S substr  <. 0 ,  ( # `  S
) >. ) : ( 0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) ) --> A )
3 ffn 5427 . . . 4  |-  ( ( S substr  <. 0 ,  (
# `  S ) >. ) : ( 0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) ) --> A  ->  ( S substr  <. 0 ,  ( # `  S
) >. )  Fn  (
0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) ) )
41, 2, 33syl 18 . . 3  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  Fn  ( 0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) ) )
5 lencl 11468 . . . . . . . 8  |-  ( S  e. Word  A  ->  ( # `
 S )  e. 
NN0 )
6 eluzfz1 10850 . . . . . . . . 9  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  0  e.  ( 0 ... ( # `  S
) ) )
7 nn0uz 10309 . . . . . . . . 9  |-  NN0  =  ( ZZ>= `  0 )
86, 7eleq2s 2408 . . . . . . . 8  |-  ( (
# `  S )  e.  NN0  ->  0  e.  ( 0 ... ( # `
 S ) ) )
95, 8syl 15 . . . . . . 7  |-  ( S  e. Word  A  ->  0  e.  ( 0 ... ( # `
 S ) ) )
10 eluzfz2 10851 . . . . . . . . 9  |-  ( (
# `  S )  e.  ( ZZ>= `  0 )  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
1110, 7eleq2s 2408 . . . . . . . 8  |-  ( (
# `  S )  e.  NN0  ->  ( # `  S
)  e.  ( 0 ... ( # `  S
) ) )
125, 11syl 15 . . . . . . 7  |-  ( S  e. Word  A  ->  ( # `
 S )  e.  ( 0 ... ( # `
 S ) ) )
13 swrdlen 11503 . . . . . . 7  |-  ( ( S  e. Word  A  /\  0  e.  ( 0 ... ( # `  S
) )  /\  ( # `
 S )  e.  ( 0 ... ( # `
 S ) ) )  ->  ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) )  =  ( ( # `  S
)  -  0 ) )
149, 12, 13mpd3an23 1279 . . . . . 6  |-  ( S  e. Word  A  ->  ( # `
 ( S substr  <. 0 ,  ( # `  S
) >. ) )  =  ( ( # `  S
)  -  0 ) )
155nn0cnd 10067 . . . . . . 7  |-  ( S  e. Word  A  ->  ( # `
 S )  e.  CC )
1615subid1d 9191 . . . . . 6  |-  ( S  e. Word  A  ->  (
( # `  S )  -  0 )  =  ( # `  S
) )
1714, 16eqtrd 2348 . . . . 5  |-  ( S  e. Word  A  ->  ( # `
 ( S substr  <. 0 ,  ( # `  S
) >. ) )  =  ( # `  S
) )
1817oveq2d 5916 . . . 4  |-  ( S  e. Word  A  ->  (
0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) )  =  ( 0..^ ( # `  S ) ) )
1918fneq2d 5373 . . 3  |-  ( S  e. Word  A  ->  (
( S substr  <. 0 ,  ( # `  S
) >. )  Fn  (
0..^ ( # `  ( S substr  <. 0 ,  (
# `  S ) >. ) ) )  <->  ( S substr  <.
0 ,  ( # `  S ) >. )  Fn  ( 0..^ ( # `  S ) ) ) )
204, 19mpbid 201 . 2  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  Fn  ( 0..^ ( # `  S
) ) )
21 wrdf 11466 . . 3  |-  ( S  e. Word  A  ->  S : ( 0..^ (
# `  S )
) --> A )
22 ffn 5427 . . 3  |-  ( S : ( 0..^ (
# `  S )
) --> A  ->  S  Fn  ( 0..^ ( # `  S ) ) )
2321, 22syl 15 . 2  |-  ( S  e. Word  A  ->  S  Fn  ( 0..^ ( # `  S ) ) )
24 simpl 443 . . . 4  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  ->  S  e. Word  A )
259adantr 451 . . . 4  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
0  e.  ( 0 ... ( # `  S
) ) )
2612adantr 451 . . . 4  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
( # `  S )  e.  ( 0 ... ( # `  S
) ) )
2716oveq2d 5916 . . . . . 6  |-  ( S  e. Word  A  ->  (
0..^ ( ( # `  S )  -  0 ) )  =  ( 0..^ ( # `  S
) ) )
2827eleq2d 2383 . . . . 5  |-  ( S  e. Word  A  ->  (
x  e.  ( 0..^ ( ( # `  S
)  -  0 ) )  <->  x  e.  (
0..^ ( # `  S
) ) ) )
2928biimpar 471 . . . 4  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  ->  x  e.  ( 0..^ ( ( # `  S
)  -  0 ) ) )
30 swrdfv 11504 . . . 4  |-  ( ( ( S  e. Word  A  /\  0  e.  (
0 ... ( # `  S
) )  /\  ( # `
 S )  e.  ( 0 ... ( # `
 S ) ) )  /\  x  e.  ( 0..^ ( (
# `  S )  -  0 ) ) )  ->  ( ( S substr  <. 0 ,  (
# `  S ) >. ) `  x )  =  ( S `  ( x  +  0
) ) )
3124, 25, 26, 29, 30syl31anc 1185 . . 3  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
( ( S substr  <. 0 ,  ( # `  S
) >. ) `  x
)  =  ( S `
 ( x  + 
0 ) ) )
32 elfzoelz 10922 . . . . . . 7  |-  ( x  e.  ( 0..^ (
# `  S )
)  ->  x  e.  ZZ )
3332zcnd 10165 . . . . . 6  |-  ( x  e.  ( 0..^ (
# `  S )
)  ->  x  e.  CC )
3433addid1d 9057 . . . . 5  |-  ( x  e.  ( 0..^ (
# `  S )
)  ->  ( x  +  0 )  =  x )
3534adantl 452 . . . 4  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
( x  +  0 )  =  x )
3635fveq2d 5567 . . 3  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
( S `  (
x  +  0 ) )  =  ( S `
 x ) )
3731, 36eqtrd 2348 . 2  |-  ( ( S  e. Word  A  /\  x  e.  ( 0..^ ( # `  S
) ) )  -> 
( ( S substr  <. 0 ,  ( # `  S
) >. ) `  x
)  =  ( S `
 x ) )
3820, 23, 37eqfnfvd 5663 1  |-  ( S  e. Word  A  ->  ( S substr  <. 0 ,  (
# `  S ) >. )  =  S )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1633    e. wcel 1701   <.cop 3677    Fn wfn 5287   -->wf 5288   ` cfv 5292  (class class class)co 5900   0cc0 8782    + caddc 8785    - cmin 9082   NN0cn0 10012   ZZ>=cuz 10277   ...cfz 10829  ..^cfzo 10917   #chash 11384  Word cword 11450   substr csubstr 11453
This theorem is referenced by:  splid  11515  splval2  11519  wrdeqcats1  11521  wrdeqs1cat  11522  efgredleme  15101  efgredlemc  15103  efgcpbllemb  15113  frgpuplem  15130
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1537  ax-5 1548  ax-17 1607  ax-9 1645  ax-8 1666  ax-13 1703  ax-14 1705  ax-6 1720  ax-7 1725  ax-11 1732  ax-12 1897  ax-ext 2297  ax-rep 4168  ax-sep 4178  ax-nul 4186  ax-pow 4225  ax-pr 4251  ax-un 4549  ax-cnex 8838  ax-resscn 8839  ax-1cn 8840  ax-icn 8841  ax-addcl 8842  ax-addrcl 8843  ax-mulcl 8844  ax-mulrcl 8845  ax-mulcom 8846  ax-addass 8847  ax-mulass 8848  ax-distr 8849  ax-i2m1 8850  ax-1ne0 8851  ax-1rid 8852  ax-rnegex 8853  ax-rrecex 8854  ax-cnre 8855  ax-pre-lttri 8856  ax-pre-lttrn 8857  ax-pre-ltadd 8858  ax-pre-mulgt0 8859
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1533  df-nf 1536  df-sb 1640  df-eu 2180  df-mo 2181  df-clab 2303  df-cleq 2309  df-clel 2312  df-nfc 2441  df-ne 2481  df-nel 2482  df-ral 2582  df-rex 2583  df-reu 2584  df-rab 2586  df-v 2824  df-sbc 3026  df-csb 3116  df-dif 3189  df-un 3191  df-in 3193  df-ss 3200  df-pss 3202  df-nul 3490  df-if 3600  df-pw 3661  df-sn 3680  df-pr 3681  df-tp 3682  df-op 3683  df-uni 3865  df-int 3900  df-iun 3944  df-br 4061  df-opab 4115  df-mpt 4116  df-tr 4151  df-eprel 4342  df-id 4346  df-po 4351  df-so 4352  df-fr 4389  df-we 4391  df-ord 4432  df-on 4433  df-lim 4434  df-suc 4435  df-om 4694  df-xp 4732  df-rel 4733  df-cnv 4734  df-co 4735  df-dm 4736  df-rn 4737  df-res 4738  df-ima 4739  df-iota 5256  df-fun 5294  df-fn 5295  df-f 5296  df-f1 5297  df-fo 5298  df-f1o 5299  df-fv 5300  df-ov 5903  df-oprab 5904  df-mpt2 5905  df-1st 6164  df-2nd 6165  df-riota 6346  df-recs 6430  df-rdg 6465  df-1o 6521  df-oadd 6525  df-er 6702  df-en 6907  df-dom 6908  df-sdom 6909  df-fin 6910  df-card 7617  df-pnf 8914  df-mnf 8915  df-xr 8916  df-ltxr 8917  df-le 8918  df-sub 9084  df-neg 9085  df-nn 9792  df-n0 10013  df-z 10072  df-uz 10278  df-fz 10830  df-fzo 10918  df-hash 11385  df-word 11456  df-substr 11459
  Copyright terms: Public domain W3C validator