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

Theorem revrev 12732
Description: Reversion is an involution on words. (Contributed by Mario Carneiro, 1-Oct-2015.)
Assertion
Ref Expression
revrev  |-  ( W  e. Word  A  ->  (reverse `  (reverse `  W )
)  =  W )

Proof of Theorem revrev
Dummy variable  x is distinct from all other variables.
StepHypRef Expression
1 revcl 12726 . . . 4  |-  ( W  e. Word  A  ->  (reverse `  W )  e. Word  A
)
2 revcl 12726 . . . 4  |-  ( (reverse `  W )  e. Word  A  ->  (reverse `  (reverse `  W
) )  e. Word  A
)
3 wrdf 12538 . . . 4  |-  ( (reverse `  (reverse `  W )
)  e. Word  A  ->  (reverse `  (reverse `  W )
) : ( 0..^ ( # `  (reverse `  (reverse `  W )
) ) ) --> A )
4 ffn 5713 . . . 4  |-  ( (reverse `  (reverse `  W )
) : ( 0..^ ( # `  (reverse `  (reverse `  W )
) ) ) --> A  ->  (reverse `  (reverse `  W
) )  Fn  (
0..^ ( # `  (reverse `  (reverse `  W )
) ) ) )
51, 2, 3, 44syl 21 . . 3  |-  ( W  e. Word  A  ->  (reverse `  (reverse `  W )
)  Fn  ( 0..^ ( # `  (reverse `  (reverse `  W )
) ) ) )
6 revlen 12727 . . . . . . 7  |-  ( (reverse `  W )  e. Word  A  ->  ( # `  (reverse `  (reverse `  W )
) )  =  (
# `  (reverse `  W
) ) )
71, 6syl 16 . . . . . 6  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  (reverse `  W ) ) )  =  ( # `  (reverse `  W ) ) )
8 revlen 12727 . . . . . 6  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  W
) )  =  (
# `  W )
)
97, 8eqtrd 2495 . . . . 5  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  (reverse `  W ) ) )  =  ( # `  W
) )
109oveq2d 6286 . . . 4  |-  ( W  e. Word  A  ->  (
0..^ ( # `  (reverse `  (reverse `  W )
) ) )  =  ( 0..^ ( # `  W ) ) )
1110fneq2d 5654 . . 3  |-  ( W  e. Word  A  ->  (
(reverse `  (reverse `  W
) )  Fn  (
0..^ ( # `  (reverse `  (reverse `  W )
) ) )  <->  (reverse `  (reverse `  W ) )  Fn  ( 0..^ ( # `  W ) ) ) )
125, 11mpbid 210 . 2  |-  ( W  e. Word  A  ->  (reverse `  (reverse `  W )
)  Fn  ( 0..^ ( # `  W
) ) )
13 wrdfn 12547 . 2  |-  ( W  e. Word  A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
141adantr 463 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
(reverse `  W )  e. Word  A )
15 simpr 459 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0..^ ( # `  W
) ) )
168adantr 463 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( # `  (reverse `  W
) )  =  (
# `  W )
)
1716oveq2d 6286 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  (reverse `  W )
) )  =  ( 0..^ ( # `  W
) ) )
1815, 17eleqtrrd 2545 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0..^ ( # `  (reverse `  W ) ) ) )
19 revfv 12728 . . . 4  |-  ( ( (reverse `  W )  e. Word  A  /\  x  e.  ( 0..^ ( # `  (reverse `  W )
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( (reverse `  W ) `  ( ( ( # `  (reverse `  W )
)  -  1 )  -  x ) ) )
2014, 18, 19syl2anc 659 . . 3  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( (reverse `  W ) `  ( ( ( # `  (reverse `  W )
)  -  1 )  -  x ) ) )
2116oveq1d 6285 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( # `  (reverse `  W ) )  - 
1 )  =  ( ( # `  W
)  -  1 ) )
2221oveq1d 6285 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  (reverse `  W )
)  -  1 )  -  x )  =  ( ( ( # `  W )  -  1 )  -  x ) )
2322fveq2d 5852 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  (reverse `  W
) )  -  1 )  -  x ) )  =  ( (reverse `  W ) `  (
( ( # `  W
)  -  1 )  -  x ) ) )
24 lencl 12549 . . . . . . . . . . . 12  |-  ( W  e. Word  A  ->  ( # `
 W )  e. 
NN0 )
2524nn0zd 10963 . . . . . . . . . . 11  |-  ( W  e. Word  A  ->  ( # `
 W )  e.  ZZ )
26 fzoval 11805 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  ZZ  ->  ( 0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
2725, 26syl 16 . . . . . . . . . 10  |-  ( W  e. Word  A  ->  (
0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
2827eleq2d 2524 . . . . . . . . 9  |-  ( W  e. Word  A  ->  (
x  e.  ( 0..^ ( # `  W
) )  <->  x  e.  ( 0 ... (
( # `  W )  -  1 ) ) ) )
2928biimpa 482 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0 ... ( ( # `  W )  -  1 ) ) )
30 fznn0sub2 11785 . . . . . . . 8  |-  ( x  e.  ( 0 ... ( ( # `  W
)  -  1 ) )  ->  ( (
( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( (
# `  W )  -  1 ) ) )
3129, 30syl 16 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( ( # `  W
)  -  1 ) ) )
3227adantr 463 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  W ) )  =  ( 0 ... (
( # `  W )  -  1 ) ) )
3331, 32eleqtrrd 2545 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )
34 revfv 12728 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )  ->  (
(reverse `  W ) `  ( ( ( # `  W )  -  1 )  -  x ) )  =  ( W `
 ( ( (
# `  W )  -  1 )  -  ( ( ( # `  W )  -  1 )  -  x ) ) ) )
3533, 34syldan 468 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  W )  -  1 )  -  x ) )  =  ( W `  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) ) ) )
36 peano2zm 10903 . . . . . . . . 9  |-  ( (
# `  W )  e.  ZZ  ->  ( ( # `
 W )  - 
1 )  e.  ZZ )
3725, 36syl 16 . . . . . . . 8  |-  ( W  e. Word  A  ->  (
( # `  W )  -  1 )  e.  ZZ )
3837zcnd 10966 . . . . . . 7  |-  ( W  e. Word  A  ->  (
( # `  W )  -  1 )  e.  CC )
39 elfzoelz 11804 . . . . . . . 8  |-  ( x  e.  ( 0..^ (
# `  W )
)  ->  x  e.  ZZ )
4039zcnd 10966 . . . . . . 7  |-  ( x  e.  ( 0..^ (
# `  W )
)  ->  x  e.  CC )
41 nncan 9839 . . . . . . 7  |-  ( ( ( ( # `  W
)  -  1 )  e.  CC  /\  x  e.  CC )  ->  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) )  =  x )
4238, 40, 41syl2an 475 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  ( ( ( # `  W
)  -  1 )  -  x ) )  =  x )
4342fveq2d 5852 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( W `  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) ) )  =  ( W `  x ) )
4435, 43eqtrd 2495 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  W )  -  1 )  -  x ) )  =  ( W `  x
) )
4523, 44eqtrd 2495 . . 3  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  (reverse `  W
) )  -  1 )  -  x ) )  =  ( W `
 x ) )
4620, 45eqtrd 2495 . 2  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( W `  x ) )
4712, 13, 46eqfnfvd 5960 1  |-  ( W  e. Word  A  ->  (reverse `  (reverse `  W )
)  =  W )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 367    = wceq 1398    e. wcel 1823    Fn wfn 5565   -->wf 5566   ` cfv 5570  (class class class)co 6270   CCcc 9479   0cc0 9481   1c1 9482    - cmin 9796   ZZcz 10860   ...cfz 11675  ..^cfzo 11799   #chash 12387  Word cword 12518  reversecreverse 12524
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1623  ax-4 1636  ax-5 1709  ax-6 1752  ax-7 1795  ax-8 1825  ax-9 1827  ax-10 1842  ax-11 1847  ax-12 1859  ax-13 2004  ax-ext 2432  ax-rep 4550  ax-sep 4560  ax-nul 4568  ax-pow 4615  ax-pr 4676  ax-un 6565  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 972  df-3an 973  df-tru 1401  df-ex 1618  df-nf 1622  df-sb 1745  df-eu 2288  df-mo 2289  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2651  df-nel 2652  df-ral 2809  df-rex 2810  df-reu 2811  df-rmo 2812  df-rab 2813  df-v 3108  df-sbc 3325  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3784  df-if 3930  df-pw 4001  df-sn 4017  df-pr 4019  df-tp 4021  df-op 4023  df-uni 4236  df-int 4272  df-iun 4317  df-br 4440  df-opab 4498  df-mpt 4499  df-tr 4533  df-eprel 4780  df-id 4784  df-po 4789  df-so 4790  df-fr 4827  df-we 4829  df-ord 4870  df-on 4871  df-lim 4872  df-suc 4873  df-xp 4994  df-rel 4995  df-cnv 4996  df-co 4997  df-dm 4998  df-rn 4999  df-res 5000  df-ima 5001  df-iota 5534  df-fun 5572  df-fn 5573  df-f 5574  df-f1 5575  df-fo 5576  df-f1o 5577  df-fv 5578  df-riota 6232  df-ov 6273  df-oprab 6274  df-mpt2 6275  df-om 6674  df-1st 6773  df-2nd 6774  df-recs 7034  df-rdg 7068  df-1o 7122  df-oadd 7126  df-er 7303  df-en 7510  df-dom 7511  df-sdom 7512  df-fin 7513  df-card 8311  df-cda 8539  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9798  df-neg 9799  df-nn 10532  df-2 10590  df-n0 10792  df-z 10861  df-uz 11083  df-fz 11676  df-fzo 11800  df-hash 12388  df-word 12526  df-reverse 12532
This theorem is referenced by:  efginvrel1  16945
  Copyright terms: Public domain W3C validator