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

Theorem revco 12575
Description: Mapping of words commutes with reversal. (Contributed by Stefan O'Rear, 27-Aug-2015.)
Assertion
Ref Expression
revco  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  (reverse `  W ) )  =  (reverse `  ( F  o.  W )
) )

Proof of Theorem revco
Dummy variable  x is distinct from all other variables.
StepHypRef Expression
1 wrdf 12353 . . . . . . . 8  |-  ( W  e. Word  A  ->  W : ( 0..^ (
# `  W )
) --> A )
2 ffn 5662 . . . . . . . 8  |-  ( W : ( 0..^ (
# `  W )
) --> A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
31, 2syl 16 . . . . . . 7  |-  ( W  e. Word  A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
43ad2antrr 725 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  W  Fn  ( 0..^ ( # `  W
) ) )
5 lencl 12362 . . . . . . . . . . . . 13  |-  ( W  e. Word  A  ->  ( # `
 W )  e. 
NN0 )
65nn0zd 10851 . . . . . . . . . . . 12  |-  ( W  e. Word  A  ->  ( # `
 W )  e.  ZZ )
7 fzoval 11666 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  ZZ  ->  ( 0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
86, 7syl 16 . . . . . . . . . . 11  |-  ( W  e. Word  A  ->  (
0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
98adantr 465 . . . . . . . . . 10  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  W )
)  =  ( 0 ... ( ( # `  W )  -  1 ) ) )
109eleq2d 2522 . . . . . . . . 9  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  W ) )  <->  x  e.  ( 0 ... (
( # `  W )  -  1 ) ) ) )
1110biimpa 484 . . . . . . . 8  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0 ... ( ( # `  W )  -  1 ) ) )
12 fznn0sub2 11600 . . . . . . . 8  |-  ( x  e.  ( 0 ... ( ( # `  W
)  -  1 ) )  ->  ( (
( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( (
# `  W )  -  1 ) ) )
1311, 12syl 16 . . . . . . 7  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( ( # `  W
)  -  1 ) ) )
149adantr 465 . . . . . . 7  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  W ) )  =  ( 0 ... (
( # `  W )  -  1 ) ) )
1513, 14eleqtrrd 2543 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )
16 fvco2 5870 . . . . . 6  |-  ( ( W  Fn  ( 0..^ ( # `  W
) )  /\  (
( ( # `  W
)  -  1 )  -  x )  e.  ( 0..^ ( # `  W ) ) )  ->  ( ( F  o.  W ) `  ( ( ( # `  W )  -  1 )  -  x ) )  =  ( F `
 ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) ) )
174, 15, 16syl2anc 661 . . . . 5  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( F  o.  W ) `  (
( ( # `  W
)  -  1 )  -  x ) )  =  ( F `  ( W `  ( ( ( # `  W
)  -  1 )  -  x ) ) ) )
18 lenco 12573 . . . . . . . . 9  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  ( F  o.  W )
)  =  ( # `  W ) )
1918oveq1d 6210 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( ( # `  ( F  o.  W
) )  -  1 )  =  ( (
# `  W )  -  1 ) )
2019oveq1d 6210 . . . . . . 7  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
)  =  ( ( ( # `  W
)  -  1 )  -  x ) )
2120adantr 465 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  ( F  o.  W
) )  -  1 )  -  x )  =  ( ( (
# `  W )  -  1 )  -  x ) )
2221fveq2d 5798 . . . . 5  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( F  o.  W ) `  (
( ( # `  ( F  o.  W )
)  -  1 )  -  x ) )  =  ( ( F  o.  W ) `  ( ( ( # `  W )  -  1 )  -  x ) ) )
23 revfv 12516 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  x )  =  ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) )
2423adantlr 714 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  x )  =  ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) )
2524fveq2d 5798 . . . . 5  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( F `  (
(reverse `  W ) `  x ) )  =  ( F `  ( W `  ( (
( # `  W )  -  1 )  -  x ) ) ) )
2617, 22, 253eqtr4d 2503 . . . 4  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( F  o.  W ) `  (
( ( # `  ( F  o.  W )
)  -  1 )  -  x ) )  =  ( F `  ( (reverse `  W ) `  x ) ) )
2726mpteq2dva 4481 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  W ) )  |->  ( ( F  o.  W
) `  ( (
( # `  ( F  o.  W ) )  -  1 )  -  x ) ) )  =  ( x  e.  ( 0..^ ( # `  W ) )  |->  ( F `  ( (reverse `  W ) `  x
) ) ) )
2818oveq2d 6211 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  ( F  o.  W ) ) )  =  ( 0..^ (
# `  W )
) )
2928mpteq1d 4476 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  ( F  o.  W
) ) )  |->  ( ( F  o.  W
) `  ( (
( # `  ( F  o.  W ) )  -  1 )  -  x ) ) )  =  ( x  e.  ( 0..^ ( # `  W ) )  |->  ( ( F  o.  W
) `  ( (
( # `  ( F  o.  W ) )  -  1 )  -  x ) ) ) )
30 revlen 12515 . . . . . 6  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  W
) )  =  (
# `  W )
)
3130adantr 465 . . . . 5  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  (reverse `  W ) )  =  ( # `  W
) )
3231oveq2d 6211 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  (reverse `  W
) ) )  =  ( 0..^ ( # `  W ) ) )
3332mpteq1d 4476 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) )  =  ( x  e.  ( 0..^ ( # `  W
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) ) )
3427, 29, 333eqtr4rd 2504 . 2  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) )  =  ( x  e.  ( 0..^ ( # `  ( F  o.  W )
) )  |->  ( ( F  o.  W ) `
 ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
) ) ) )
35 simpr 461 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  F : A --> B )
36 revcl 12514 . . . . 5  |-  ( W  e. Word  A  ->  (reverse `  W )  e. Word  A
)
37 wrdf 12353 . . . . 5  |-  ( (reverse `  W )  e. Word  A  ->  (reverse `  W ) : ( 0..^ (
# `  (reverse `  W
) ) ) --> A )
3836, 37syl 16 . . . 4  |-  ( W  e. Word  A  ->  (reverse `  W ) : ( 0..^ ( # `  (reverse `  W ) ) ) --> A )
3938adantr 465 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  (reverse `  W ) : ( 0..^ (
# `  (reverse `  W
) ) ) --> A )
40 fcompt 5983 . . 3  |-  ( ( F : A --> B  /\  (reverse `  W ) : ( 0..^ ( # `  (reverse `  W )
) ) --> A )  ->  ( F  o.  (reverse `  W ) )  =  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) ) )
4135, 39, 40syl2anc 661 . 2  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  (reverse `  W ) )  =  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) ) )
42 ffun 5664 . . . . 5  |-  ( F : A --> B  ->  Fun  F )
4342adantl 466 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  Fun  F )
44 simpl 457 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  W  e. Word  A
)
45 cofunexg 6646 . . . 4  |-  ( ( Fun  F  /\  W  e. Word  A )  ->  ( F  o.  W )  e.  _V )
4643, 44, 45syl2anc 661 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  W )  e.  _V )
47 revval 12513 . . 3  |-  ( ( F  o.  W )  e.  _V  ->  (reverse `  ( F  o.  W
) )  =  ( x  e.  ( 0..^ ( # `  ( F  o.  W )
) )  |->  ( ( F  o.  W ) `
 ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
) ) ) )
4846, 47syl 16 . 2  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  (reverse `  ( F  o.  W ) )  =  ( x  e.  ( 0..^ ( # `  ( F  o.  W )
) )  |->  ( ( F  o.  W ) `
 ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
) ) ) )
4934, 41, 483eqtr4d 2503 1  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  (reverse `  W ) )  =  (reverse `  ( F  o.  W )
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1370    e. wcel 1758   _Vcvv 3072    |-> cmpt 4453    o. ccom 4947   Fun wfun 5515    Fn wfn 5516   -->wf 5517   ` cfv 5521  (class class class)co 6195   0cc0 9388   1c1 9389    - cmin 9701   ZZcz 10752   ...cfz 11549  ..^cfzo 11660   #chash 12215  Word cword 12334  reversecreverse 12340
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1954  ax-ext 2431  ax-rep 4506  ax-sep 4516  ax-nul 4524  ax-pow 4573  ax-pr 4634  ax-un 6477  ax-cnex 9444  ax-resscn 9445  ax-1cn 9446  ax-icn 9447  ax-addcl 9448  ax-addrcl 9449  ax-mulcl 9450  ax-mulrcl 9451  ax-mulcom 9452  ax-addass 9453  ax-mulass 9454  ax-distr 9455  ax-i2m1 9456  ax-1ne0 9457  ax-1rid 9458  ax-rnegex 9459  ax-rrecex 9460  ax-cnre 9461  ax-pre-lttri 9462  ax-pre-lttrn 9463  ax-pre-ltadd 9464  ax-pre-mulgt0 9465
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2265  df-mo 2266  df-clab 2438  df-cleq 2444  df-clel 2447  df-nfc 2602  df-ne 2647  df-nel 2648  df-ral 2801  df-rex 2802  df-reu 2803  df-rab 2805  df-v 3074  df-sbc 3289  df-csb 3391  df-dif 3434  df-un 3436  df-in 3438  df-ss 3445  df-pss 3447  df-nul 3741  df-if 3895  df-pw 3965  df-sn 3981  df-pr 3983  df-tp 3985  df-op 3987  df-uni 4195  df-int 4232  df-iun 4276  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4489  df-eprel 4735  df-id 4739  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-ord 4825  df-on 4826  df-lim 4827  df-suc 4828  df-xp 4949  df-rel 4950  df-cnv 4951  df-co 4952  df-dm 4953  df-rn 4954  df-res 4955  df-ima 4956  df-iota 5484  df-fun 5523  df-fn 5524  df-f 5525  df-f1 5526  df-fo 5527  df-f1o 5528  df-fv 5529  df-riota 6156  df-ov 6198  df-oprab 6199  df-mpt2 6200  df-om 6582  df-1st 6682  df-2nd 6683  df-recs 6937  df-rdg 6971  df-1o 7025  df-oadd 7029  df-er 7206  df-en 7416  df-dom 7417  df-sdom 7418  df-fin 7419  df-card 8215  df-pnf 9526  df-mnf 9527  df-xr 9528  df-ltxr 9529  df-le 9530  df-sub 9703  df-neg 9704  df-nn 10429  df-n0 10686  df-z 10753  df-uz 10968  df-fz 11550  df-fzo 11661  df-hash 12216  df-word 12342  df-reverse 12348
This theorem is referenced by:  efginvrel1  16341
  Copyright terms: Public domain W3C validator