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

Theorem revco 12856
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 wrdfn 12612 . . . . . . 7  |-  ( W  e. Word  A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
21ad2antrr 724 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  W  Fn  ( 0..^ ( # `  W
) ) )
3 lencl 12614 . . . . . . . . . . . . 13  |-  ( W  e. Word  A  ->  ( # `
 W )  e. 
NN0 )
43nn0zd 11006 . . . . . . . . . . . 12  |-  ( W  e. Word  A  ->  ( # `
 W )  e.  ZZ )
5 fzoval 11860 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  ZZ  ->  ( 0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
64, 5syl 17 . . . . . . . . . . 11  |-  ( W  e. Word  A  ->  (
0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
76adantr 463 . . . . . . . . . 10  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  W )
)  =  ( 0 ... ( ( # `  W )  -  1 ) ) )
87eleq2d 2472 . . . . . . . . 9  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( x  e.  ( 0..^ ( # `  W ) )  <->  x  e.  ( 0 ... (
( # `  W )  -  1 ) ) ) )
98biimpa 482 . . . . . . . 8  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0 ... ( ( # `  W )  -  1 ) ) )
10 fznn0sub2 11836 . . . . . . . 8  |-  ( x  e.  ( 0 ... ( ( # `  W
)  -  1 ) )  ->  ( (
( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( (
# `  W )  -  1 ) ) )
119, 10syl 17 . . . . . . 7  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( ( # `  W
)  -  1 ) ) )
127adantr 463 . . . . . . 7  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  W ) )  =  ( 0 ... (
( # `  W )  -  1 ) ) )
1311, 12eleqtrrd 2493 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )
14 fvco2 5924 . . . . . 6  |-  ( ( W  Fn  ( 0..^ ( # `  W
) )  /\  (
( ( # `  W
)  -  1 )  -  x )  e.  ( 0..^ ( # `  W ) ) )  ->  ( ( F  o.  W ) `  ( ( ( # `  W )  -  1 )  -  x ) )  =  ( F `
 ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) ) )
152, 13, 14syl2anc 659 . . . . 5  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( F  o.  W ) `  (
( ( # `  W
)  -  1 )  -  x ) )  =  ( F `  ( W `  ( ( ( # `  W
)  -  1 )  -  x ) ) ) )
16 lenco 12854 . . . . . . . . 9  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  ( F  o.  W )
)  =  ( # `  W ) )
1716oveq1d 6293 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( ( # `  ( F  o.  W
) )  -  1 )  =  ( (
# `  W )  -  1 ) )
1817oveq1d 6293 . . . . . . 7  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
)  =  ( ( ( # `  W
)  -  1 )  -  x ) )
1918adantr 463 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  ( F  o.  W
) )  -  1 )  -  x )  =  ( ( (
# `  W )  -  1 )  -  x ) )
2019fveq2d 5853 . . . . 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 ) ) )
21 revfv 12793 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  x )  =  ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) )
2221adantlr 713 . . . . . 6  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  x )  =  ( W `  ( ( ( # `  W )  -  1 )  -  x ) ) )
2322fveq2d 5853 . . . . 5  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( F `  (
(reverse `  W ) `  x ) )  =  ( F `  ( W `  ( (
( # `  W )  -  1 )  -  x ) ) ) )
2415, 20, 233eqtr4d 2453 . . . 4  |-  ( ( ( W  e. Word  A  /\  F : A --> B )  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( F  o.  W ) `  (
( ( # `  ( F  o.  W )
)  -  1 )  -  x ) )  =  ( F `  ( (reverse `  W ) `  x ) ) )
2524mpteq2dva 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
) ) ) )
2616oveq2d 6294 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  ( F  o.  W ) ) )  =  ( 0..^ (
# `  W )
) )
2726mpteq1d 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 ) ) ) )
28 revlen 12792 . . . . . 6  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  W
) )  =  (
# `  W )
)
2928adantr 463 . . . . 5  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( # `  (reverse `  W ) )  =  ( # `  W
) )
3029oveq2d 6294 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( 0..^ (
# `  (reverse `  W
) ) )  =  ( 0..^ ( # `  W ) ) )
3130mpteq1d 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 )
) ) )
3225, 27, 313eqtr4rd 2454 . 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
) ) ) )
33 simpr 459 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  F : A --> B )
34 revcl 12791 . . . . 5  |-  ( W  e. Word  A  ->  (reverse `  W )  e. Word  A
)
35 wrdf 12603 . . . . 5  |-  ( (reverse `  W )  e. Word  A  ->  (reverse `  W ) : ( 0..^ (
# `  (reverse `  W
) ) ) --> A )
3634, 35syl 17 . . . 4  |-  ( W  e. Word  A  ->  (reverse `  W ) : ( 0..^ ( # `  (reverse `  W ) ) ) --> A )
3736adantr 463 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  (reverse `  W ) : ( 0..^ (
# `  (reverse `  W
) ) ) --> A )
38 fcompt 6046 . . 3  |-  ( ( F : A --> B  /\  (reverse `  W ) : ( 0..^ ( # `  (reverse `  W )
) ) --> A )  ->  ( F  o.  (reverse `  W ) )  =  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) ) )
3933, 37, 38syl2anc 659 . 2  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  (reverse `  W ) )  =  ( x  e.  ( 0..^ ( # `  (reverse `  W )
) )  |->  ( F `
 ( (reverse `  W
) `  x )
) ) )
40 ffun 5716 . . . . 5  |-  ( F : A --> B  ->  Fun  F )
4140adantl 464 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  Fun  F )
42 simpl 455 . . . 4  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  W  e. Word  A
)
43 cofunexg 6748 . . . 4  |-  ( ( Fun  F  /\  W  e. Word  A )  ->  ( F  o.  W )  e.  _V )
4441, 42, 43syl2anc 659 . . 3  |-  ( ( W  e. Word  A  /\  F : A --> B )  ->  ( F  o.  W )  e.  _V )
45 revval 12790 . . 3  |-  ( ( F  o.  W )  e.  _V  ->  (reverse `  ( F  o.  W
) )  =  ( x  e.  ( 0..^ ( # `  ( F  o.  W )
) )  |->  ( ( F  o.  W ) `
 ( ( (
# `  ( F  o.  W ) )  - 
1 )  -  x
) ) ) )
4644, 45syl 17 . 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
) ) ) )
4732, 39, 463eqtr4d 2453 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 367    = wceq 1405    e. wcel 1842   _Vcvv 3059    |-> cmpt 4453    o. ccom 4827   Fun wfun 5563    Fn wfn 5564   -->wf 5565   ` cfv 5569  (class class class)co 6278   0cc0 9522   1c1 9523    - cmin 9841   ZZcz 10905   ...cfz 11726  ..^cfzo 11854   #chash 12452  Word cword 12583  reversecreverse 12589
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1639  ax-4 1652  ax-5 1725  ax-6 1771  ax-7 1814  ax-8 1844  ax-9 1846  ax-10 1861  ax-11 1866  ax-12 1878  ax-13 2026  ax-ext 2380  ax-rep 4507  ax-sep 4517  ax-nul 4525  ax-pow 4572  ax-pr 4630  ax-un 6574  ax-cnex 9578  ax-resscn 9579  ax-1cn 9580  ax-icn 9581  ax-addcl 9582  ax-addrcl 9583  ax-mulcl 9584  ax-mulrcl 9585  ax-mulcom 9586  ax-addass 9587  ax-mulass 9588  ax-distr 9589  ax-i2m1 9590  ax-1ne0 9591  ax-1rid 9592  ax-rnegex 9593  ax-rrecex 9594  ax-cnre 9595  ax-pre-lttri 9596  ax-pre-lttrn 9597  ax-pre-ltadd 9598  ax-pre-mulgt0 9599
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 975  df-3an 976  df-tru 1408  df-ex 1634  df-nf 1638  df-sb 1764  df-eu 2242  df-mo 2243  df-clab 2388  df-cleq 2394  df-clel 2397  df-nfc 2552  df-ne 2600  df-nel 2601  df-ral 2759  df-rex 2760  df-reu 2761  df-rmo 2762  df-rab 2763  df-v 3061  df-sbc 3278  df-csb 3374  df-dif 3417  df-un 3419  df-in 3421  df-ss 3428  df-pss 3430  df-nul 3739  df-if 3886  df-pw 3957  df-sn 3973  df-pr 3975  df-tp 3977  df-op 3979  df-uni 4192  df-int 4228  df-iun 4273  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4490  df-eprel 4734  df-id 4738  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-xp 4829  df-rel 4830  df-cnv 4831  df-co 4832  df-dm 4833  df-rn 4834  df-res 4835  df-ima 4836  df-pred 5367  df-ord 5413  df-on 5414  df-lim 5415  df-suc 5416  df-iota 5533  df-fun 5571  df-fn 5572  df-f 5573  df-f1 5574  df-fo 5575  df-f1o 5576  df-fv 5577  df-riota 6240  df-ov 6281  df-oprab 6282  df-mpt2 6283  df-om 6684  df-1st 6784  df-2nd 6785  df-wrecs 7013  df-recs 7075  df-rdg 7113  df-1o 7167  df-oadd 7171  df-er 7348  df-en 7555  df-dom 7556  df-sdom 7557  df-fin 7558  df-card 8352  df-cda 8580  df-pnf 9660  df-mnf 9661  df-xr 9662  df-ltxr 9663  df-le 9664  df-sub 9843  df-neg 9844  df-nn 10577  df-2 10635  df-n0 10837  df-z 10906  df-uz 11128  df-fz 11727  df-fzo 11855  df-hash 12453  df-word 12591  df-reverse 12597
This theorem is referenced by:  efginvrel1  17070
  Copyright terms: Public domain W3C validator