matrix w
Every permutation $p$ on $n$ symbols can be written as an $n \times n$ matrix. Its matrix representation has a $1$ in entry $(i,j)$ if $p(i) = j$ and $0$ otherwise.
i1 : p = permutation {3,1,2,5,4} o1 = Permutation{3, 1, 2, 5, 4} o1 : Permutation
i2 : matrix p o2 = | 0 1 0 0 0 | | 0 0 1 0 0 | | 1 0 0 0 0 | | 0 0 0 0 1 | | 0 0 0 1 0 | 5 5 o2 : Matrix ZZ <-- ZZ