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

Theorem swrdco 12815
Description: Mapping of words commutes with the substring operation. (Contributed by AV, 11-Nov-2018.)
Assertion
Ref Expression
swrdco  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( F  o.  ( W substr  <. M ,  N >. ) )  =  ( ( F  o.  W ) substr  <. M ,  N >. ) )

Proof of Theorem swrdco
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 ffn 5737 . . . 4  |-  ( F : A --> B  ->  F  Fn  A )
213ad2ant3 1019 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  F  Fn  A
)
3 swrdvalfn 12662 . . . . 5  |-  ( ( W  e. Word  A  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  -> 
( W substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) ) )
433expb 1197 . . . 4  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) ) )  ->  ( W substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) ) )
543adant3 1016 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( W substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) ) )
6 swrdrn 12665 . . . . 5  |-  ( ( W  e. Word  A  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  ->  ran  ( W substr  <. M ,  N >. )  C_  A
)
763expb 1197 . . . 4  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) ) )  ->  ran  ( W substr  <. M ,  N >. ) 
C_  A )
873adant3 1016 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ran  ( W substr  <. M ,  N >. ) 
C_  A )
9 fnco 5695 . . 3  |-  ( ( F  Fn  A  /\  ( W substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) )  /\  ran  ( W substr  <. M ,  N >. )  C_  A
)  ->  ( F  o.  ( W substr  <. M ,  N >. ) )  Fn  ( 0..^ ( N  -  M ) ) )
102, 5, 8, 9syl3anc 1228 . 2  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( F  o.  ( W substr  <. M ,  N >. ) )  Fn  ( 0..^ ( N  -  M ) ) )
11 wrdco 12809 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  W )  e. Word  B
)
12113adant2 1015 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( F  o.  W )  e. Word  B
)
13 simp2l 1022 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  M  e.  ( 0 ... N ) )
14 lenco 12810 . . . . . . . . . . . 12  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  ( F  o.  W )
)  =  ( # `  W ) )
1514eqcomd 2465 . . . . . . . . . . 11  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  W
)  =  ( # `  ( F  o.  W
) ) )
1615oveq2d 6312 . . . . . . . . . 10  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0 ... ( # `  W
) )  =  ( 0 ... ( # `  ( F  o.  W
) ) ) )
1716eleq2d 2527 . . . . . . . . 9  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( N  e.  ( 0 ... ( # `
 W ) )  <-> 
N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) )
1817biimpd 207 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( N  e.  ( 0 ... ( # `
 W ) )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) ) )
1918expcom 435 . . . . . . 7  |-  ( F : A --> B  -> 
( W  e. Word  A  ->  ( N  e.  ( 0 ... ( # `  W ) )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) ) )
2019com13 80 . . . . . 6  |-  ( N  e.  ( 0 ... ( # `  W
) )  ->  ( W  e. Word  A  ->  ( F : A --> B  ->  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) ) )
2120adantl 466 . . . . 5  |-  ( ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  -> 
( W  e. Word  A  ->  ( F : A --> B  ->  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) ) ) )
2221com12 31 . . . 4  |-  ( W  e. Word  A  ->  (
( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  ->  ( F : A
--> B  ->  N  e.  ( 0 ... ( # `
 ( F  o.  W ) ) ) ) ) )
23223imp 1190 . . 3  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) )
24 swrdvalfn 12662 . . 3  |-  ( ( ( F  o.  W
)  e. Word  B  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) )  -> 
( ( F  o.  W ) substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) ) )
2512, 13, 23, 24syl3anc 1228 . 2  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( ( F  o.  W ) substr  <. M ,  N >. )  Fn  ( 0..^ ( N  -  M ) ) )
26 3anass 977 . . . . . . 7  |-  ( ( W  e. Word  A  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  <->  ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `
 W ) ) ) ) )
2726biimpri 206 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) ) )  ->  ( W  e. Word  A  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) ) )
28273adant3 1016 . . . . 5  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( W  e. Word  A  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) ) )
29 swrdfv 12660 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  i  e.  ( 0..^ ( N  -  M
) ) )  -> 
( ( W substr  <. M ,  N >. ) `  i
)  =  ( W `
 ( i  +  M ) ) )
3029fveq2d 5876 . . . . 5  |-  ( ( ( W  e. Word  A  /\  M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  i  e.  ( 0..^ ( N  -  M
) ) )  -> 
( F `  (
( W substr  <. M ,  N >. ) `  i
) )  =  ( F `  ( W `
 ( i  +  M ) ) ) )
3128, 30sylan 471 . . . 4  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( F `  ( ( W substr  <. M ,  N >. ) `  i
) )  =  ( F `  ( W `
 ( i  +  M ) ) ) )
32 wrdfn 12567 . . . . . . 7  |-  ( W  e. Word  A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
33323ad2ant1 1017 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  W  Fn  (
0..^ ( # `  W
) ) )
3433adantr 465 . . . . 5  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  W  Fn  ( 0..^ ( # `  W
) ) )
35 elfzodifsumelfzo 11885 . . . . . . 7  |-  ( ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  -> 
( i  e.  ( 0..^ ( N  -  M ) )  -> 
( i  +  M
)  e.  ( 0..^ ( # `  W
) ) ) )
36353ad2ant2 1018 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( i  e.  ( 0..^ ( N  -  M ) )  ->  ( i  +  M )  e.  ( 0..^ ( # `  W
) ) ) )
3736imp 429 . . . . 5  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( i  +  M )  e.  ( 0..^ ( # `  W
) ) )
38 fvco2 5948 . . . . 5  |-  ( ( W  Fn  ( 0..^ ( # `  W
) )  /\  (
i  +  M )  e.  ( 0..^ (
# `  W )
) )  ->  (
( F  o.  W
) `  ( i  +  M ) )  =  ( F `  ( W `  ( i  +  M ) ) ) )
3934, 37, 38syl2anc 661 . . . 4  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( ( F  o.  W ) `  ( i  +  M
) )  =  ( F `  ( W `
 ( i  +  M ) ) ) )
4031, 39eqtr4d 2501 . . 3  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( F `  ( ( W substr  <. M ,  N >. ) `  i
) )  =  ( ( F  o.  W
) `  ( i  +  M ) ) )
41 fvco2 5948 . . . 4  |-  ( ( ( W substr  <. M ,  N >. )  Fn  (
0..^ ( N  -  M ) )  /\  i  e.  ( 0..^ ( N  -  M
) ) )  -> 
( ( F  o.  ( W substr  <. M ,  N >. ) ) `  i )  =  ( F `  ( ( W substr  <. M ,  N >. ) `  i ) ) )
425, 41sylan 471 . . 3  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( ( F  o.  ( W substr  <. M ,  N >. ) ) `  i )  =  ( F `  ( ( W substr  <. M ,  N >. ) `  i
) ) )
4314ancoms 453 . . . . . . . . . . . . . 14  |-  ( ( F : A --> B  /\  W  e. Word  A )  ->  ( # `  ( F  o.  W )
)  =  ( # `  W ) )
4443eqcomd 2465 . . . . . . . . . . . . 13  |-  ( ( F : A --> B  /\  W  e. Word  A )  ->  ( # `  W
)  =  ( # `  ( F  o.  W
) ) )
4544oveq2d 6312 . . . . . . . . . . . 12  |-  ( ( F : A --> B  /\  W  e. Word  A )  ->  ( 0 ... ( # `
 W ) )  =  ( 0 ... ( # `  ( F  o.  W )
) ) )
4645eleq2d 2527 . . . . . . . . . . 11  |-  ( ( F : A --> B  /\  W  e. Word  A )  ->  ( N  e.  ( 0 ... ( # `  W ) )  <->  N  e.  ( 0 ... ( # `
 ( F  o.  W ) ) ) ) )
4746biimpd 207 . . . . . . . . . 10  |-  ( ( F : A --> B  /\  W  e. Word  A )  ->  ( N  e.  ( 0 ... ( # `  W ) )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) )
4847ex 434 . . . . . . . . 9  |-  ( F : A --> B  -> 
( W  e. Word  A  ->  ( N  e.  ( 0 ... ( # `  W ) )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) ) )
4948com13 80 . . . . . . . 8  |-  ( N  e.  ( 0 ... ( # `  W
) )  ->  ( W  e. Word  A  ->  ( F : A --> B  ->  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) ) ) )
5049adantl 466 . . . . . . 7  |-  ( ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  -> 
( W  e. Word  A  ->  ( F : A --> B  ->  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) ) ) )
5150com12 31 . . . . . 6  |-  ( W  e. Word  A  ->  (
( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  ->  ( F : A
--> B  ->  N  e.  ( 0 ... ( # `
 ( F  o.  W ) ) ) ) ) )
52513imp 1190 . . . . 5  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) )
5312, 13, 523jca 1176 . . . 4  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( ( F  o.  W )  e. Word  B  /\  M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  ( F  o.  W
) ) ) ) )
54 swrdfv 12660 . . . 4  |-  ( ( ( ( F  o.  W )  e. Word  B  /\  M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  ( F  o.  W )
) ) )  /\  i  e.  ( 0..^ ( N  -  M
) ) )  -> 
( ( ( F  o.  W ) substr  <. M ,  N >. ) `  i )  =  ( ( F  o.  W
) `  ( i  +  M ) ) )
5553, 54sylan 471 . . 3  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( (
( F  o.  W
) substr  <. M ,  N >. ) `  i )  =  ( ( F  o.  W ) `  ( i  +  M
) ) )
5640, 42, 553eqtr4d 2508 . 2  |-  ( ( ( W  e. Word  A  /\  ( M  e.  ( 0 ... N )  /\  N  e.  ( 0 ... ( # `  W ) ) )  /\  F : A --> B )  /\  i  e.  ( 0..^ ( N  -  M ) ) )  ->  ( ( F  o.  ( W substr  <. M ,  N >. ) ) `  i )  =  ( ( ( F  o.  W ) substr  <. M ,  N >. ) `
 i ) )
5710, 25, 56eqfnfvd 5985 1  |-  ( ( W  e. Word  A  /\  ( M  e.  (
0 ... N )  /\  N  e.  ( 0 ... ( # `  W
) ) )  /\  F : A --> B )  ->  ( F  o.  ( W substr  <. M ,  N >. ) )  =  ( ( F  o.  W ) substr  <. M ,  N >. ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    /\ w3a 973    = wceq 1395    e. wcel 1819    C_ wss 3471   <.cop 4038   ran crn 5009    o. ccom 5012    Fn wfn 5589   -->wf 5590   ` cfv 5594  (class class class)co 6296   0cc0 9509    + caddc 9512    - cmin 9824   ...cfz 11697  ..^cfzo 11821   #chash 12408  Word cword 12538   substr csubstr 12542
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-rep 4568  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-cnex 9565  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1398  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4252  df-int 4289  df-iun 4334  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-om 6700  df-1st 6799  df-2nd 6800  df-recs 7060  df-rdg 7094  df-1o 7148  df-oadd 7152  df-er 7329  df-en 7536  df-dom 7537  df-sdom 7538  df-fin 7539  df-card 8337  df-cda 8565  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-nn 10557  df-2 10615  df-n0 10817  df-z 10886  df-uz 11107  df-fz 11698  df-fzo 11822  df-hash 12409  df-word 12546  df-substr 12550
This theorem is referenced by:  pfxco  32556
  Copyright terms: Public domain W3C validator