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

Theorem revrev 12406
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 12400 . . . 4  |-  ( W  e. Word  A  ->  (reverse `  W )  e. Word  A
)
2 revcl 12400 . . . 4  |-  ( (reverse `  W )  e. Word  A  ->  (reverse `  (reverse `  W
) )  e. Word  A
)
3 wrdf 12239 . . . 4  |-  ( (reverse `  (reverse `  W )
)  e. Word  A  ->  (reverse `  (reverse `  W )
) : ( 0..^ ( # `  (reverse `  (reverse `  W )
) ) ) --> A )
4 ffn 5558 . . . 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 12401 . . . . . . 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 12401 . . . . . 6  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  W
) )  =  (
# `  W )
)
97, 8eqtrd 2474 . . . . 5  |-  ( W  e. Word  A  ->  ( # `
 (reverse `  (reverse `  W ) ) )  =  ( # `  W
) )
109oveq2d 6106 . . . 4  |-  ( W  e. Word  A  ->  (
0..^ ( # `  (reverse `  (reverse `  W )
) ) )  =  ( 0..^ ( # `  W ) ) )
1110fneq2d 5501 . . 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 wrdf 12239 . . 3  |-  ( W  e. Word  A  ->  W : ( 0..^ (
# `  W )
) --> A )
14 ffn 5558 . . 3  |-  ( W : ( 0..^ (
# `  W )
) --> A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
1513, 14syl 16 . 2  |-  ( W  e. Word  A  ->  W  Fn  ( 0..^ ( # `  W ) ) )
161adantr 465 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
(reverse `  W )  e. Word  A )
17 simpr 461 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0..^ ( # `  W
) ) )
188adantr 465 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( # `  (reverse `  W
) )  =  (
# `  W )
)
1918oveq2d 6106 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  (reverse `  W )
) )  =  ( 0..^ ( # `  W
) ) )
2017, 19eleqtrrd 2519 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0..^ ( # `  (reverse `  W ) ) ) )
21 revfv 12402 . . . 4  |-  ( ( (reverse `  W )  e. Word  A  /\  x  e.  ( 0..^ ( # `  (reverse `  W )
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( (reverse `  W ) `  ( ( ( # `  (reverse `  W )
)  -  1 )  -  x ) ) )
2216, 20, 21syl2anc 661 . . 3  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( (reverse `  W ) `  ( ( ( # `  (reverse `  W )
)  -  1 )  -  x ) ) )
2318oveq1d 6105 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( # `  (reverse `  W ) )  - 
1 )  =  ( ( # `  W
)  -  1 ) )
2423oveq1d 6105 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  (reverse `  W )
)  -  1 )  -  x )  =  ( ( ( # `  W )  -  1 )  -  x ) )
2524fveq2d 5694 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  (reverse `  W
) )  -  1 )  -  x ) )  =  ( (reverse `  W ) `  (
( ( # `  W
)  -  1 )  -  x ) ) )
26 lencl 12248 . . . . . . . . . . . 12  |-  ( W  e. Word  A  ->  ( # `
 W )  e. 
NN0 )
2726nn0zd 10744 . . . . . . . . . . 11  |-  ( W  e. Word  A  ->  ( # `
 W )  e.  ZZ )
28 fzoval 11553 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  ZZ  ->  ( 0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
2927, 28syl 16 . . . . . . . . . 10  |-  ( W  e. Word  A  ->  (
0..^ ( # `  W
) )  =  ( 0 ... ( (
# `  W )  -  1 ) ) )
3029eleq2d 2509 . . . . . . . . 9  |-  ( W  e. Word  A  ->  (
x  e.  ( 0..^ ( # `  W
) )  <->  x  e.  ( 0 ... (
( # `  W )  -  1 ) ) ) )
3130biimpa 484 . . . . . . . 8  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  ->  x  e.  ( 0 ... ( ( # `  W )  -  1 ) ) )
32 fznn0sub2 11487 . . . . . . . 8  |-  ( x  e.  ( 0 ... ( ( # `  W
)  -  1 ) )  ->  ( (
( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( (
# `  W )  -  1 ) ) )
3331, 32syl 16 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0 ... ( ( # `  W
)  -  1 ) ) )
3429adantr 465 . . . . . . 7  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( 0..^ ( # `  W ) )  =  ( 0 ... (
( # `  W )  -  1 ) ) )
3533, 34eleqtrrd 2519 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )
36 revfv 12402 . . . . . 6  |-  ( ( W  e. Word  A  /\  ( ( ( # `  W )  -  1 )  -  x )  e.  ( 0..^ (
# `  W )
) )  ->  (
(reverse `  W ) `  ( ( ( # `  W )  -  1 )  -  x ) )  =  ( W `
 ( ( (
# `  W )  -  1 )  -  ( ( ( # `  W )  -  1 )  -  x ) ) ) )
3735, 36syldan 470 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  W )  -  1 )  -  x ) )  =  ( W `  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) ) ) )
38 peano2zm 10687 . . . . . . . . 9  |-  ( (
# `  W )  e.  ZZ  ->  ( ( # `
 W )  - 
1 )  e.  ZZ )
3927, 38syl 16 . . . . . . . 8  |-  ( W  e. Word  A  ->  (
( # `  W )  -  1 )  e.  ZZ )
4039zcnd 10747 . . . . . . 7  |-  ( W  e. Word  A  ->  (
( # `  W )  -  1 )  e.  CC )
41 elfzoelz 11552 . . . . . . . 8  |-  ( x  e.  ( 0..^ (
# `  W )
)  ->  x  e.  ZZ )
4241zcnd 10747 . . . . . . 7  |-  ( x  e.  ( 0..^ (
# `  W )
)  ->  x  e.  CC )
43 nncan 9637 . . . . . . 7  |-  ( ( ( ( # `  W
)  -  1 )  e.  CC  /\  x  e.  CC )  ->  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) )  =  x )
4440, 42, 43syl2an 477 . . . . . 6  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  -  ( ( ( # `  W
)  -  1 )  -  x ) )  =  x )
4544fveq2d 5694 . . . . 5  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( W `  (
( ( # `  W
)  -  1 )  -  ( ( (
# `  W )  -  1 )  -  x ) ) )  =  ( W `  x ) )
4637, 45eqtrd 2474 . . . 4  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  W )  -  1 )  -  x ) )  =  ( W `  x
) )
4725, 46eqtrd 2474 . . 3  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  W
) `  ( (
( # `  (reverse `  W
) )  -  1 )  -  x ) )  =  ( W `
 x ) )
4822, 47eqtrd 2474 . 2  |-  ( ( W  e. Word  A  /\  x  e.  ( 0..^ ( # `  W
) ) )  -> 
( (reverse `  (reverse `  W ) ) `  x )  =  ( W `  x ) )
4912, 15, 48eqfnfvd 5799 1  |-  ( W  e. Word  A  ->  (reverse `  (reverse `  W )
)  =  W )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1369    e. wcel 1756    Fn wfn 5412   -->wf 5413   ` cfv 5417  (class class class)co 6090   CCcc 9279   0cc0 9281   1c1 9282    - cmin 9594   ZZcz 10645   ...cfz 11436  ..^cfzo 11547   #chash 12102  Word cword 12220  reversecreverse 12226
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-rep 4402  ax-sep 4412  ax-nul 4420  ax-pow 4469  ax-pr 4530  ax-un 6371  ax-cnex 9337  ax-resscn 9338  ax-1cn 9339  ax-icn 9340  ax-addcl 9341  ax-addrcl 9342  ax-mulcl 9343  ax-mulrcl 9344  ax-mulcom 9345  ax-addass 9346  ax-mulass 9347  ax-distr 9348  ax-i2m1 9349  ax-1ne0 9350  ax-1rid 9351  ax-rnegex 9352  ax-rrecex 9353  ax-cnre 9354  ax-pre-lttri 9355  ax-pre-lttrn 9356  ax-pre-ltadd 9357  ax-pre-mulgt0 9358
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2429  df-cleq 2435  df-clel 2438  df-nfc 2567  df-ne 2607  df-nel 2608  df-ral 2719  df-rex 2720  df-reu 2721  df-rab 2723  df-v 2973  df-sbc 3186  df-csb 3288  df-dif 3330  df-un 3332  df-in 3334  df-ss 3341  df-pss 3343  df-nul 3637  df-if 3791  df-pw 3861  df-sn 3877  df-pr 3879  df-tp 3881  df-op 3883  df-uni 4091  df-int 4128  df-iun 4172  df-br 4292  df-opab 4350  df-mpt 4351  df-tr 4385  df-eprel 4631  df-id 4635  df-po 4640  df-so 4641  df-fr 4678  df-we 4680  df-ord 4721  df-on 4722  df-lim 4723  df-suc 4724  df-xp 4845  df-rel 4846  df-cnv 4847  df-co 4848  df-dm 4849  df-rn 4850  df-res 4851  df-ima 4852  df-iota 5380  df-fun 5419  df-fn 5420  df-f 5421  df-f1 5422  df-fo 5423  df-f1o 5424  df-fv 5425  df-riota 6051  df-ov 6093  df-oprab 6094  df-mpt2 6095  df-om 6476  df-1st 6576  df-2nd 6577  df-recs 6831  df-rdg 6865  df-1o 6919  df-oadd 6923  df-er 7100  df-en 7310  df-dom 7311  df-sdom 7312  df-fin 7313  df-card 8108  df-pnf 9419  df-mnf 9420  df-xr 9421  df-ltxr 9422  df-le 9423  df-sub 9596  df-neg 9597  df-nn 10322  df-n0 10579  df-z 10646  df-uz 10861  df-fz 11437  df-fzo 11548  df-hash 12103  df-word 12228  df-reverse 12234
This theorem is referenced by:  efginvrel1  16224
  Copyright terms: Public domain W3C validator