% $Date: 2003/09/15 16:37:46 $ $Author: nthiery $ $Revision: 1.1.1.1 $

\begin{Mhelppage}{IsPerm}%
  {V. Prosper}%
  \begin{MInfo}
    \eng{tests whether the argument is a permutation}
  \end{MInfo}

  \MDeclareOption{\dominant}{dominant}
  \MDeclareOption{\grassmannian}{grassmannian}
  \MDeclareOption{\vexillary}{vexillary}

  \begin{MCalls}
    \Mcall{expr\Mopt{,\dominant,\grassmannian,\vexillary}}
  \end{MCalls}

  \begin{MParameters}
    \param{expr}
    \eng{any expression}
  \end{MParameters}

  \begin{MIntro}
    \eng{The {\Mthis} function tests whether \Mex{expr} is a
      permutation that is a list of \Mpar{n} disctinct positive
      integers between 1 and \Mpar{n}.
    
      One can test whether the permutation is either dominant,
      grassmannian or vexillary by using the corresponding second
      argument, \Mex{\dominant}, \Mex{\grassmannian} or
      \Mex{\vexillary}.
 
      A permutation is dominant, if and only if its code is a
      partition (i.e.  weakly decreasing vector of non-negative
      integers).
 
      A permutation is grassmannian, if and only if it has only one
      descent, or in other words, if there exists only one
      \Mmath{i}{i} with \Mmath{perm[i]>perm[i+1]}{perm_i>perm_{i+1}}.
 
      Let \Mex{part(perm)} be the partition obtained by reordering the
      components of its code.  Then \Mex{perm} is vexillary if and
      only if \Mex{part(Perm2Inv(perm))} is the conjugate of
      \Mex{part(perm)}.}
  \end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::TYP::IsPerm( [3,1] );
\end{Mexin}
\begin{Mexout}
                             FALSE
\end{Mexout}
\begin{Mexin}
muEC::TYP::IsPerm( [3,2,1] );
\end{Mexin}
\begin{Mexout}
                             TRUE
\end{Mexout}
\begin{Mexin}
muEC::TYP::IsPerm( [2,1,4,3], vexillary );
\end{Mexin}
\begin{Mexout}
                             FALSE
\end{Mexout}
\end{MExample}

\MRelatedFunctions{Permutation}
\end{Mhelppage}
