Permutation

Definition 1. A function ƒ:A→B f with hook colon A right arrow Bis called
1 1) injective (or one-to-one) if ƒ⁡(x)=ƒ⁡(y) f with hook of x equals f with hook of y for some x,y∈A x comma y is a member of Anecessarily implies that x=y x equals y
2 2) surjective (or onto) if for each b∈B b is a member of B there exists a∈A a is a member of A such that ƒ⁡(a)=b f with hook of a equals b
3 3) bijective if ƒ f with hook is both injective and surjective.

Definition 2. Let ƒ:A→B f with hook colon A right arrow B and g:B→C g colon B right arrow C be functions. Then, the composition of functions, denoted ƒ∘g f with hook composed with g, is a function from A to C defined as

(g∘ƒ)⁢(x)≝g⁡(ƒ⁡(x)) open paren g composed with f with hook close paren times x is defined to be g of f with hook of x for all x∈A x is a member of A.

Lemma 1. Let ƒ:A→B f with hook colon A right arrow B, g:B→C g colon B right arrow C and h:C→D h colon C right arrow D be functions. Then:
1 1) h∘(g∘ƒ)=(h∘g)∘ƒ h composed with open paren g composed with f with hook close paren equals open paren h composed with g close paren composed with f with hook, that is, function composition is associative;
2 2)if ƒ f with hook and g g are injective then g∘ƒ g composed with f with hook is injective;
3 3)if ƒ f with hook and g g are surjective then g∘ƒ g composed with f with hook is surjective;
4 4)if ƒ f with hook and g g are bijective then g∘ƒ g composed with f with hook is bijective.
Proof. 1 1) By Definition 2 2, for any x∈A x is a member of A we have
{(h∘(g∘ƒ))⁢(x)=h⁡((g∘ƒ)⁢(x))=h⁡(g⁡(ƒ⁡(x)))((h∘g)∘ƒ)⁢(x)=(h∘g)⁢(ƒ⁡(x))=h⁡(g⁡(ƒ⁡(x)))⇒(h∘(g∘ƒ))⁢(x)=((h∘g)∘ƒ)⁢(x) 2 cases Case 1: open paren h composed with open paren g composed with f with hook close paren close paren times x equals h of open paren open paren g composed with f with hook close paren times x close paren equals h of g of f with hook of x Case 2: open paren open paren h composed with g close paren composed with f with hook close paren times x equals open paren h composed with g close paren times f with hook of x equals h of g of f with hook of x right double arrow open paren h composed with open paren g composed with f with hook close paren close paren times x equals open paren open paren h composed with g close paren composed with f with hook close paren times x
2 2) If (g∘ƒ)⁢(x)=(g∘ƒ)⁢(y) open paren g composed with f with hook close paren times x equals open paren g composed with f with hook close paren times y for some x,y∈A x comma y is a member of A then (since g g is injective) we have ƒ⁡(x)=g⁡(y) f with hook of x equals g of ywhich implies (since f is injective) that x=y x equals y.
3 3) Let c c be an element of C C. Then (since g g is surjective) there exists b∈B b is a member of B such that g⁡(b)=c g of b equals c. Since ƒ f with hook is surjective, there exists a∈A a is a member of A such that ƒ⁡(a)=b f with hook of a equals b. Therefore, we have (g∘ƒ)⁢(a)=g⁡(ƒ⁡(a))=g⁡(b)=c open paren g composed with f with hook close paren times a equals g of f with hook of a equals g of b equals c.
4) Follows immediately from 2 2), 3 3) and Item 3 3 of Definition 1.

Definition 3. A function ƒ:[n]→[n] f with hook colon n right arrow n is called a permutation on n elements if ƒ f with hook is bijective. The set of all permutations on n elements we denote Sn S sub n. For example, functions ƒ1,ƒ2:[3]→[3] f with hook sub 1 comma f with hook sub 2 colon 3 right arrow 3 defined by ƒ1⁡(1)=2 f with hook sub 1 of 1 equals 2, ƒ1⁡(2)=3,ƒ1⁡(3)=1 f with hook sub 1 of 2 equals 3 comma f with hook sub 1 of 3 equals 1 and ƒ2⁡(1)=3,ƒ2⁡(2)=2,ƒ2⁡(3)=1 f with hook sub 2 of 1 equals 3 comma f with hook sub 2 of 2 equals 2 comma f with hook sub 2 of 3 equals 1 are elements of S3 S sub 3. One way to denote a permutation ƒ∈Sn f with hook is a member of S sub n is to use so called two-line notation. In two-line notation (or two-row notation) of a permutation ƒ∈Sn f with hook is a member of S sub n, one lists the elements of [n] n in the first row, and for each one its image bellow it in the second row, that is
(1) 1 ƒ=[i1i2i3…inƒ⁡(i1)ƒ⁡(i2)ƒ⁡(i3)…ƒ⁡(in)] f with hook equals the 2 by 5 matrix Row 1: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n Row 2: Column 1, f with hook of open paren i sub 1 close paren Column 2, f with hook of open paren i sub 2 close paren Column 3, f with hook of open paren i sub 3 close paren Column 4, dot dot dot Column 5, f with hook of open paren i sub n close paren
where (i1,i2,i3,…,in) open paren i sub 1 comma i sub 2 comma i sub 3 comma dot dot dot comma i sub n close paren is an ordered list of elements of [n] n in which each element of [n] n occurs only once. For example, functions ƒ1,ƒ2∈S3 f with hook sub 1 comma f with hook sub 2 is a member of S sub 3 from above can be written in two-line notation in one of the following ways:
ƒ1=[123231]=[132213]=[321132]=[213321]=[231312]=[312123] f with hook sub 1 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 2 3 1 equals the 2 by 3 matrix Row 1: 1 3 2 Row 2: 2 1 3 equals the 2 by 3 matrix Row 1: 3 2 1 Row 2: 1 3 2 equals the 2 by 3 matrix Row 1: 2 1 3 Row 2: 3 2 1 equals the 2 by 3 matrix Row 1: 2 3 1 Row 2: 3 1 2 equals the 2 by 3 matrix Row 1: 3 1 2 Row 2: 1 2 3
and
ƒ2=[123321]=[132312]=[321123]=[213231]=[231213]=[312132] f with hook sub 2 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 3 2 1 equals the 2 by 3 matrix Row 1: 1 3 2 Row 2: 3 1 2 equals the 2 by 3 matrix Row 1: 3 2 1 Row 2: 1 2 3 equals the 2 by 3 matrix Row 1: 2 1 3 Row 2: 2 3 1 equals the 2 by 3 matrix Row 1: 2 3 1 Row 2: 2 1 3 equals the 2 by 3 matrix Row 1: 3 1 2 Row 2: 1 3 2
Note that
1. in the first row of two-line notation (1), the elements of [n] n may appear in any order;
2. n n distinct objects can be arranged in an ordered line in n! n factorial ways.
This immediately implies the following:
Statement 1. There are n! n factorial permutation in Sn S sub n and each of these permutations can be written in two-line notation (1) 1 in n! n factorial ways.
For example, there are 3!=6 3 factorial equals 6 elements in S3 S sub 3
[123123],[123132],[123213],ƒ1=[123231],ƒ2=[123321],[123312] the 2 by 3 matrix Row 1: 1 2 3 Row 2: 1 2 3 comma the 2 by 3 matrix Row 1: 1 2 3 Row 2: 1 3 2 comma the 2 by 3 matrix Row 1: 1 2 3 Row 2: 2 1 3 comma f with hook sub 1 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 2 3 1 comma f with hook sub 2 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 3 2 1 comma the 2 by 3 matrix Row 1: 1 2 3 Row 2: 3 1 2
Let us calculate ƒ1∘ƒ2 f with hook sub 1 composed with f with hook sub 2 and ƒ2∘ƒ1 f with hook sub 2 composed with f with hook sub 1. We have
(ƒ1∘ƒ2)⁢(1)=ƒ1⁡(ƒ2⁡(1))=ƒ1⁡(3)=1 open paren f with hook sub 1 composed with f with hook sub 2 close paren times 1 equals f with hook sub 1 of f with hook sub 2 of 1 equals f with hook sub 1 of 3 equals 1
(ƒ1∘ƒ2)⁢(2)=ƒ1⁡(ƒ2⁡(2))=ƒ1⁡(2)=2 open paren f with hook sub 1 composed with f with hook sub 2 close paren times 2 equals f with hook sub 1 of f with hook sub 2 of 2 equals f with hook sub 1 of 2 equals 2
(ƒ1∘ƒ2)⁢(3)=ƒ1⁡(ƒ2⁡(3))=ƒ1⁡(1)=3 open paren f with hook sub 1 composed with f with hook sub 2 close paren times 3 equals f with hook sub 1 of f with hook sub 2 of 3 equals f with hook sub 1 of 1 equals 3
and
(ƒ2∘ƒ1)⁢(1)=ƒ2⁡(ƒ1⁡(1))=ƒ2⁡(2)=2 open paren f with hook sub 2 composed with f with hook sub 1 close paren times 1 equals f with hook sub 2 of f with hook sub 1 of 1 equals f with hook sub 2 of 2 equals 2
(ƒ2∘ƒ1)⁢(2)=ƒ2⁡(ƒ1⁡(2))=ƒ2⁡(3)=1 open paren f with hook sub 2 composed with f with hook sub 1 close paren times 2 equals f with hook sub 2 of f with hook sub 1 of 2 equals f with hook sub 2 of 3 equals 1
(ƒ2∘ƒ1)⁢(3)=ƒ2⁡(ƒ1⁡(3))=ƒ2⁡(1)=3 open paren f with hook sub 2 composed with f with hook sub 1 close paren times 3 equals f with hook sub 2 of f with hook sub 1 of 3 equals f with hook sub 2 of 1 equals 3
that is
ƒ1∘ƒ2=[123132] f with hook sub 1 composed with f with hook sub 2 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 1 3 2 and ƒ2∘ƒ1=[123213] f with hook sub 2 composed with f with hook sub 1 equals the 2 by 3 matrix Row 1: 1 2 3 Row 2: 2 1 3.
Theorem 1. Let Sn S sub n be the set of all permutation on n n elements. Then
1) ƒ∘g∈Sn f with hook composed with g is a member of S sub n for any ƒ,g∈Sn f with hook comma g is a member of S sub n;
2 2)h∘(g∘ƒ)=(h∘g)∘ƒ h composed with open paren g composed with f with hook close paren equals open paren h composed with g close paren composed with f with hook for any ƒ,g,h∈Sn f with hook comma g comma h is a member of S sub n;
3 3)Sn S sub n has a special permutation called the identity permutation, denoted id_n, such that
ƒ∘ f with hook composed withid_n= equalsid_n∘ƒ=ƒ composed with f with hook equals f with hook for any ƒ∈Sn; f with hook is a member of S sub n semicolon
4 4) for each ƒ∈Sn f with hook is a member of S sub n there exists an element in Sn S sub n, denoted ƒ-1 f with hook to the negative 1 power, called the inverse of ƒ f with hook, such that
ƒ∘ƒ-1=ƒ-1∘ƒ= f with hook composed with f with hook to the negative 1 power equals f with hook to the negative 1 power composed with f with hook equals id_n;
5 5) if n≥3 n is greater than or equal to 3, the composition of permutations of Sn S sub n is not commutative, that is, there are ƒ1,ƒ2∈Sn f with hook sub 1 comma f with hook sub 2 is a member of S sub n such that ƒ1∘ƒ2≠ƒ2∘ƒ1 f with hook sub 1 composed with f with hook sub 2 is not equal to f with hook sub 2 composed with f with hook sub 1
Proof. 1 1) Since, by Definition 3, ƒ f with hook and g g are bijections, the statement follows immediately from item 4 of Lemma 1.
2) Since, by Definition 3, ƒ,g f with hook comma g and h h are functions, the statement follows immediately from item1 of Lemma 1.
3) It is straightforward to check that the identity permutation of Sn S sub n, id_n, should be defined as id_n(i)=i, i equals i comma for i∈[n] i is a member of n, that is
id_n=[i1i2i3…ini1i2i3…in] equals the 2 by 5 matrix Row 1: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n Row 2: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n
4 4) If ƒ∈Sn f with hook is a member of S sub n is defined by (1 1) then it is straightforward to check that the inverse of ƒ,ƒ-1 f with hook comma f with hook to the negative 1 power, should be defined as
(4) 4 [ƒ⁡(i1)ƒ⁡(i2)ƒ⁡(i3)…ƒ⁡(in)i1i2i3…in] the 2 by 5 matrix Row 1: Column 1, f with hook of open paren i sub 1 close paren Column 2, f with hook of open paren i sub 2 close paren Column 3, f with hook of open paren i sub 3 close paren Column 4, dot dot dot Column 5, f with hook of open paren i sub n close paren Row 2: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n
5 5) The statement follows immediately from (2) 2.
Remark. Theorem 1 means that Sn S sub n forms a non-commutative group with respect to composition of functions, ∘ composed with. This group is called full symmetry group of n n-element set.

Definition 4. Let (k1,k2,…,kn) open paren k sub 1 comma k sub 2 comma dot dot dot comma k sub n close paren be an ordered list of the elements of [n] n such that each element of [n] n occurs (in the list) only once. The ordered pair of elements (ki1,ki2) open paren k sub i sub 1 comma k sub i sub 2 close paren is called an inversionof the list if i1<i2 i sub 1 is less than i sub 2 and ki1>ki2 k sub i sub 1 is greater than k sub i sub 2. For example, the pairs (4,3)=(k1,k2) open paren 4 comma 3 close paren equals open paren k sub 1 comma k sub 2 close paren, (3,1)=(k2,k3),(3,2)=(k2,k4),(4,1)=(k1,k3) open paren 3 comma 1 close paren equals open paren k sub 2 comma k sub 3 close paren comma open paren 3 comma 2 close paren equals open paren k sub 2 comma k sub 4 close paren comma open paren 4 comma 1 close paren equals open paren k sub 1 comma k sub 3 close paren and (4,2)=(k1,k4) open paren 4 comma 2 close paren equals open paren k sub 1 comma k sub 4 close paren are all the inversions of the ordered list (4,3,1,2,5)=(k1,k2,k3,k4,k5) open paren 4 comma 3 comma 1 comma 2 comma 5 close paren equals open paren k sub 1 comma k sub 2 comma k sub 3 comma k sub 4 comma k sub 5 close paren.

Definition 5. Suppose that a permutation ƒ∈Sn f with hook is a member of S sub n is written in the form (1 1). The sign (or signature or signum) of ƒ f with hook, denoted sgn(ƒ) f with hook, is defined to be
sgn(ƒ)≝(-1)p⁡(ƒ)+q⁡(ƒ), f with hook is defined to be open paren negative 1 close paren raised to the p of f with hook plus q of f with hook power comma
where p⁡(ƒ) p of f with hook and q⁡(ƒ) q of f with hook is the number of inversions in the ordered list (i1,i2,i3,…,in) open paren i sub 1 comma i sub 2 comma i sub 3 comma dot dot dot comma i sub n close paren and ƒ⁡(i1),ƒ⁡(i2),ƒ⁡(i3),…,ƒ⁡(in) f with hook of open paren i sub 1 close paren comma f with hook of open paren i sub 2 close paren comma f with hook of open paren i sub 3 close paren comma dot dot dot comma f with hook of open paren i sub n close paren, respectively.

Lemma 2. The value of (-1)p⁡(ƒ)+q⁡(ƒ) open paren negative 1 close paren raised to the p of f with hook plus q of f with hook power does not depend on the choice of representation of f in the form (1 1) (that is, Definition 5 is correct).

Theorem 2. For any ƒ,g∈Sn f with hook comma g is a member of S sub n we have sgn(ƒ∘g)= open paren f with hook composed with g close paren equalssgn(ƒ)⋅ f with hook timessgn(g) g.
Proof. Let us choose the representations of ƒ f with hook and g g in the form (1 1) such that the first row of ƒ f with hook is equal to the second row of g g, that is ƒ=[j1j2j3…jnk1k2k3…kn] f with hook equals the 2 by 5 matrix Row 1: Column 1, j sub 1 Column 2, j sub 2 Column 3, j sub 3 Column 4, dot dot dot Column 5, j sub n Row 2: Column 1, k sub 1 Column 2, k sub 2 Column 3, k sub 3 Column 4, dot dot dot Column 5, k sub n and g=[i1i2i3…inj1j2j3…jn] g equals the 2 by 5 matrix Row 1: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n Row 2: Column 1, j sub 1 Column 2, j sub 2 Column 3, j sub 3 Column 4, dot dot dot Column 5, j sub n.
Then we have ƒ∘g=[i1i2i3…ink1k2k3…kn] f with hook composed with g equals the 2 by 5 matrix Row 1: Column 1, i sub 1 Column 2, i sub 2 Column 3, i sub 3 Column 4, dot dot dot Column 5, i sub n Row 2: Column 1, k sub 1 Column 2, k sub 2 Column 3, k sub 3 Column 4, dot dot dot Column 5, k sub n. Due to our choice of the representations of ƒ f with hook and g g, we have p⁡(ƒ)=q⁡(g),p⁡(ƒ∘g)=p⁡(g) p of f with hook equals q of g comma p of open paren f with hook composed with g close paren equals p of g and q⁡(ƒ∘g)=q⁡(ƒ) q of open paren f with hook composed with g close paren equals q of f with hook, therefore sgn(ƒ∘g)=(-1)p⁡(ƒ∘g)+q⁡(ƒ∘g)=(-1)p⁡(g)+q⁡(ƒ) open paren f with hook composed with g close paren equals open paren negative 1 close paren raised to the p of open paren f with hook composed with g close paren plus q of open paren f with hook composed with g close paren power equals open paren negative 1 close paren raised to the p of g plus q of f with hook power
and
sgn(ƒ)⋅ f with hook timessgn(g)=(-1)p⁡(ƒ)+q⁡(ƒ)⋅(-1)p⁡(g)+q⁡(g)=(-1)p⁡(ƒ)+q⁡(ƒ)⋅(-1)p⁡(g)+p⁡(ƒ)=(-1)p⁡(g)+q⁡(ƒ)+2⁢p⁡(ƒ)=(-1)p⁡(g)+q⁡(ƒ) g equals open paren negative 1 close paren raised to the p of f with hook plus q of f with hook power times open paren negative 1 close paren raised to the p of g plus q of g power equals open paren negative 1 close paren raised to the p of f with hook plus q of f with hook power times open paren negative 1 close paren raised to the p of g plus p of f with hook power equals open paren negative 1 close paren raised to the p of g plus q of f with hook plus 2 p of f with hook power equals open paren negative 1 close paren raised to the p of g plus q of f with hook power.
Thus, sgn(ƒ∘g)=(-1)p⁡(g)+q⁡(ƒ)= open paren f with hook composed with g close paren equals open paren negative 1 close paren raised to the p of g plus q of f with hook power equalssgn(ƒ)⋅ f with hook timessgn(g) g.

Definition 6. A permutation ƒ∈Sn f with hook is a member of S sub n is called the transposition of elements k,l∈[n] k comma l is a member of n if ƒ⁡(k)=l,ƒ⁡(l)= f with hook of k equals l comma f with hook of l equalsk and ƒ⁡(i)=i f with hook of i equals i, for i∈[n] i is a member of n, i≠k,i≠l i is not equal to k comma i is not equal to l
Proposition 1.
1) sgn(id_n)=1 equals 1
2) sgn(ƒ)= f with hook equalssgn(ƒ-1) open paren f with hook to the negative 1 power close paren for any ƒ∈Sn f with hook is a member of S sub n;
3) if ƒ∈Sn f with hook is a member of S sub n is a transposition then sgn(ƒ)=-1 f with hook equals negative 1
Proof. 1) Since id_n can be written in the form (3) 3, we have p p(id_n)=q equals q(id_n). Therefore, by Definition 5, 5 comma sgn(id_n)=1. equals 1 period
2) Since if ƒ f with hook is written in the form (1) 1 then ƒ-1 f with hook to the negative 1 power can be written as (4) 4, we have p⁡(ƒ-1)=q⁡(ƒ) p of open paren f with hook to the negative 1 power close paren equals q of f with hook and q⁡(ƒ-1)=p˙⁡(ƒ) q of open paren f with hook to the negative 1 power close paren equals p dot above of f with hook Therefore, by Definition 5, 5 comma sgn(ƒ-1)=-1. open paren f with hook to the negative 1 power close paren equals negative 1 period
3) Suppose that ƒ∈Sn f with hook is a member of S sub n is the transposition of elements k,l∈[n] k comma l is a member of n. Then ƒ f with hook can be written as ƒ=[lki1i2…in-2kli1i2…in-2] f with hook equals the 2 by 6 matrix Row 1: Column 1, l Column 2, k Column 3, i sub 1 Column 4, i sub 2 Column 5, dot dot dot Column 6, i sub n minus 2 Row 2: Column 1, k Column 2, l Column 3, i sub 1 Column 4, i sub 2 Column 5, dot dot dot Column 6, i sub n minus 2.
It should be clear that in this case we have either p⁡(ƒ)=p⁡(ƒ)-1 p of f with hook equals p of f with hook minus 1 (if l < k) or p⁡(ƒ)=q⁡(ƒ)+1 p of f with hook equals q of f with hook plus 1 (ifl > k). In both cases, by Definition 5, sgn(ƒ)=-1. f with hook equals negative 1 period

Definition 7. A permutation ƒ∈Sn f with hook is a member of S sub n is called
1) an even permutation if sgn(ƒ)=1 f with hook equals 1
2) an odd permutation if sgn(ƒ)=-1 f with hook equals negative 1