(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
BeginPackage["Perm`"]


(* ::Input::Initialization:: *)
Perm::usage = "Perm[5,2,3,1,4] means the permutation that maps 1->5, 2->2, 3->3, 4->1, 5->4.";


(* ::Input::Initialization:: *)
Begin["`private`"]


(* ::Input::Initialization:: *)
PermutationQ[\[Sigma]_Perm] := Sort[List@@\[Sigma]]===Range[Length[\[Sigma]]]


(* ::Input::Initialization:: *)
\[Sigma]_Perm \[SmallCircle] \[Tau]_Perm /; Length[\[Sigma]]==Length[\[Tau]] :=\[Sigma][[List@@\[Tau]]];


(* ::Input::Initialization:: *)
Perm /:(\[Sigma]_Perm)^-1 /; PermutationQ[\[Sigma]]:= (
\[Tau]=\[Sigma];
Do[\[Tau][[\[Sigma][[i]]]]=i, {i,Length[\[Sigma]]}];
\[Tau]
)


(* ::Input::Initialization:: *)
End[]; EndPackage[]



