Macaulay2 » Documentation
Packages » Macaulay2Doc :: inversePermutation
next | previous | forward | backward | up | index | toc

inversePermutation -- inverse permutation

Synopsis

Description

i1 : x = {1,2,3,4,5,0}

o1 = {1, 2, 3, 4, 5, 0}

o1 : List
i2 : y = inversePermutation x

o2 = {5, 0, 1, 2, 3, 4}

o2 : List
i3 : all(#x, i -> x#(y#i) == i)

o3 = true
i4 : all(#x, i -> y#(x#i) == i)

o4 = true

We compose permutations with _; see VisibleList _ List.

i5 : x_x_x

o5 = {3, 4, 5, 0, 1, 2}

o5 : List
i6 : x_x_x_x_x_x

o6 = {0, 1, 2, 3, 4, 5}

o6 : List
i7 : x_y

o7 = {0, 1, 2, 3, 4, 5}

o7 : List
i8 : y_x

o8 = {0, 1, 2, 3, 4, 5}

o8 : List

For the programmer

The object inversePermutation is a function closure.