Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Birkhoff's representation theorem wikipedia , lookup
Factorization of polynomials over finite fields wikipedia , lookup
Modular representation theory wikipedia , lookup
Fundamental group wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
Invariant convex cone wikipedia , lookup
Group action wikipedia , lookup
Homological algebra wikipedia , lookup
Deligne–Lusztig theory wikipedia , lookup
Oscillator representation wikipedia , lookup
Groups CDM Klaus Sutner Carnegie Mellon University Fall 2015 Outline 1 From Magmas to Groups 2 Substructures, Morphisms and Congruences 3 Generators and Cayley Graphs 4 Data Structures for Groups 5 Group Presentations 6 Products 7 Decision Problems 8 Symmetric Groups 2 Magmas 3 Definition A magma is a structure with a single binary operation ∗: M = h M, ∗ i where ∗ : M × M → M is a (total) binary function on the carrier set M , often referred to as multiplication in this context. There are no further restrictions on the operation. It is quite difficult to describe these structures in full generality; to obtain a good theory one needs to impose further restrictions on the properties of ∗. Some Magmas Example The natural numbers with exponentiation form a magma. Example The integers with subtraction form a magma. Example The positive rationals with division form a magma. 4 More Magmas 5 Example Binary trees can be considered as magma hT ,∗i where T is the collection of all binary trees and ∗ denotes the operation of attaching two trees to a new root. Note that this operation is highly non-associative: r ∗ (s ∗ t) 6= (r ∗ s) ∗ t no matter what r, s and t are. Example Likewise we could consider lists over some groundset A as a magma h List(A), ∗ i where ∗ is interpreted as join (or concatenation). Warning: this is actually a monoid. Free Magmas In algebra, it is interesting to understand a structure that satisfies certain specifications, but has no other, special properties. These structures are called free. So suppose we have a carrier set A. What would the free magma over A look like? Since magmas impose no conditions on the operation ∗, we get full binary trees (terms over the ground set) internal nodes are labeled by ∗, leaves are labeled by A. 6 Semigroups 7 Definition A semigroup is a structure with a single associative operation ∗: S = h S, ∗ i . Thus, a semigroup is a magma such that for all x, y, z in S we have associativity: x ∗ (y ∗ z) = (x ∗ y) ∗ z. Many natural algebraic operations have this property, but not all: Exponentiation is not associative. Subtraction is not associative. Idempotents Definition An idempotent in a semigroup is an element e such that e ∗ e = e. An idempotent is a bit weaker than an identity. Lemma Let S be a finite semigroup. Then S contains an idempotent. Exercise Prove the idempotent lemma. Think lasso. 8 Free Semigroups 9 We have seen that the free magma over A is the collection of ground terms, essentially binary trees with leaves labeled in A. In a semigroup we have one additional specification: associativity. Hence we can identify all trees with same frontier: they correspond to the same semigroup element. Hence, we might as well think of them as a list. ∗ ∗ ∗ a ∗ = ∗ b c d ∗ a d c b = ∗ a b c d Six Leaves 10 Monoids 11 Definition A monoid is a semigroup with an identity element e: e ∗ x = x ∗ e = x. One usually writes monoids in the form M = h M, ∗, e i to indicate the neutral element. Of course, the neutral element is idempotent. Proposition The neutral element in a monoid is unique. Proof. e = e ∗ e0 = e0 . 2 Classical Examples Example The set of all words over a fixed alphabet forms a monoid with concatenation as operation. The neutral element is the empty word. Example The set of all lists over some fixed ground set forms a monoid with join as operation. The neutral element is the empty list. Example The set of all functions f : A → A for some arbitrary set A forms a monoid with functional composition as operation. The neutral element is the identity function. Example The set of all binary relations on A, for some arbitrary ground set A, forms a monoid with relational composition as operation. The neutral element is the identity relation. 12 Classical Examples, cont’d. Example The set of natural numbers with addition forms a monoid; the neutral element is 0. Ditto for integers, rationals, algebraic numbers, reals, complex numbers. Example The set of positive natural numbers with multiplication forms a monoid; the neutral element is 1. Example The set of all n by n matrices of, say, integers, with matrix multiplications forms a monoid; the neutral element is the identity matrix. 13 Semigroups versus Monoids 14 There is very little difference between semigroups and monoids: clearly, every monoid is a semigroups. On the other hand, suppose S is a semigroup without a unit element. Adjoin a new element 1 to the carrier set and extend the multiplication as follows: 1∗x=x∗1=x 1∗1=1 where x ∈ S. The new structure S 1 is a monoid. Still, for technical reasons it is quite useful to distinguish between the two types of structures. Strange Examples 15 Example A band is a semigroup defined on the Cartesian product A × B where A and B are two arbitrary sets (non-empty). The operation is (a, b) ∗ (c, d) = (a, d) It is obvious that this operation is associative. Note that a band is idempotent: x ∗ x = x for all x. Example The bicyclic semigroup is defined on N × N by the operation (a, b) ∗ (c, d) = (a − b + max(b, c), d − c + max(b, c)) Associativity requires a little argument here. This may look strange, but it is just the free semigroup on two generators r and s subject to sr = 1. The idempotents of this semigroup are exactly the elements (a, a). Solving Equations 16 Monoids appear quite frequently, but have one crucial flaw from the point of view of solving equations: in general we cannot solve the equation a ∗ x = b. To make sure solutions always exist we need more assumptions. One step in the right direction is the (left) cancellation property: a∗x=a∗y implies x=y This guarantees that a solution, if it exist, is unique. Exercise Check which of the monoids from above have the cancellation property. What restrictions on the left multiplier a are necessary to guarantee cancellation? Groups 17 At last, here is the kind of structure that guarantees existence and uniqueness of solutions of linear equations. Definition A group is a structure G = G, ·, −1 , e where h G, ·, e i is a monoid and x · x−1 = x−1 · x = e for all x. The group element x−1 is called the inverse of x. One can show that x−1 is the uniquely determined element y such that x · y = y · x = e. We could also have defined a group as a monoid with the additional property ∀ x ∃ y (x · y = y · x = 1). Abelian Groups Definition A group is commutative or Abelian if x · y = y · x for all x and y. Notation: It is customary to write Abelian groups additively as h G, +, 0 i or h G, + i . General groups are written multiplicatively as h G, ·, 1 i or h G, · i . As usual, the multiplication operator is often omitted. The inverse is correspondingly written −x in additive notation and x−1 in multiplicative notation. 18 Solving Equations 19 In a group, the equation a·x=b always has the unique solution x = a−1 · b Note that this is easier than standard arithmetic: there is no need to worry about the case a = 0 (when dealing with a ring or a field). The systematic study of abstract groups was one of the central accomplishments of 19th century mathematics. They appear in many, many places and some understanding of the their basic properties is crucial. Classical Examples Example The set of integers (rationals, reals, complexes) with addition forms a group; the neutral element is 0. Example The set of modular numbers relatively prime to modulus m with multiplication forms a group; the neutral element is 1. Example The set of non-zero rationals (reals, complexes) with multiplication forms a group; the neutral element is 1. 20 Classical Examples Example The set of all regular n by n matrices of reals, with matrix multiplications forms a group; the neutral element is the identity matrix. Example The set of all permutations f : A → A for some arbitrary set A forms a group SA with functional composition as operation. The neutral element is the identity function. 21 Free Groups 22 So what is the free group over some set A? We have already seen that we can think of the elements of the free semigroup as plain lists of elements. Alternatively, think about words: the free monoid over A is just A? with concatenation. To adjust this for groups we enlarge the alphabet: Γ = A ∪ {a | a ∈ A} with the intent that a represents a−1 . Then the free group F (A) over A can be thought of as h Γ∗0 , ∗ i where Γ∗0 is the subset of Γ? where no word has an adjacent a and a. The Multiplication To multiply two elements in F (A) we concatenate the two words in Γ∗0 , and repeatedly cancel out any adjacent a and a pairs. The resulting word is again in Γ∗0 . It is not hard to check that this really produces a group “with no special properties whatsoever.” 23 Why Abstract Algebra? Laziness: any property, of, say, groups derived from only the axioms holds in all groups, automatically. You only check three simple properties, and all results apply. Psychology: it is sometimes easier to argue abstractly than in a concrete situation (you can’t see the forest because of all the trees). This a bit hard to believe, but true. E.g., consider non-singular matrices of reals. Show that (A · B)−1 = B −1 · A−1 One could try to use the properties of matrix multiplication and, say, Gaussian elimination, to prove this. Any such argument would be very hard and technically difficult. Exercise Give a simple, abstract proof of this equation in any group whatsoever. 24 A Breakthrough This axiomatic style of algebra is relatively new, the major breakthrough publication is van der Waerden’s (1903-1996) classical texts that cemented the notion of algebraic structure (a first-order structure) as the fundamental concept in algebra: B. L. van der Waerden Moderne Algebra, Teil I Springer Verlag, Berlin, 1930 B. L. van der Waerden Moderne Algebra, Teil II Springer Verlag, Berlin, 1931 25 2 From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs Data Structures for Groups Group Presentations Products Decision Problems Symmetric Groups Operations The following general ideas are crucial when dealing with algebraic structures: Substructure A structure that is obtained by shrinking the carrier set and the algebraic operations. Homomorphism A map from one structure to another that is well-behaved. Quotient A structure obtained by identifying some of the elements of a given structure (via an equivalence relation). Product A structure that is defined over the Cartesian product of other structures, with appropriately defined operations. We will describe these ideas in the contexts of groups. 27 Subgroups Definition Consider a group hA, ·i . A subgroup of A is a set B ⊆ A such that hB, i is a group, where is the restriction of · to B. This is always written hB, ·i , no one bothers to distinguish between the full group operation · and the restriction . Note, though, that the group operation may be much easier to compute in the subgroup. Example hQ, +i is a subgroup of hR, +i . hZ, +i is a subgroup of hQ, +i . h2Z, +i is a subgroup of hZ, +i . {1} is the trivial subgroup of any group (written multiplicatively). 28 Testing Subgroups 29 Lemma Let A be a group and ∅ 6= B ⊆ A. Then B is a subgroup of A if, and only if, x, y ∈ B implies x−1 · y ∈ B. If the group is finite than it suffices that x, y ∈ B implies x · y ∈ B. Proof. The first part follows easily from the definition. For the second part note that B must contain 1: as a finite semigroup B must contain an idempotent, which must be the identity in A. The map B → B, x 7→ b · x is a permutation of B for each b ∈ B (injective implies surjective in the finite case). But then for some x ∈ B: 1 = b · x so we have closure under inverses. 2 Homomorphisms 30 A map from one group to another is mostly interesting if it preserves structure. Definition Suppose G and H are groups. A function f : G → H is a (group) homomorphism if f (x · y) = f (x) ∗ f (y) Here · is the operation in G, and ∗ the operation in H. If the function f is in addition injective then it is an monomorphism. If the function f is in addition surjective then it is an epimorphism. If the function f is in addition bijective then it is an isomorphism. Usually one simply writes f (xy) = f (x)f (y) and does not explicitly display the two different group operations. Examples Example f : G → H , f (x) = 1, is a homomorphism. f : G → G , f (x) = x is an isomorphism. f : Z → Zm , f (x) = x mod m is an epimorphism. log : R+ → R is a isomorphism from R+ , ·, 1 to h R, +, 0 i . As the last example show, one does not always want to identify isomorphic groups. In fact, the whole purpose of logarithms is to translate multiplication into addition. 31 The Remainder Homomorphism Let hZ, +, 0i be the group of natural numbers under addition, and hZm , +, 0i be the group of natural numbers modulo m under addition. The function f : Z → Zm f (x) = x mod m is a group homomorphism. The same is true if we replace addition by multiplication, except we are dealing with monoids rather than groups (full disclosure: we are dealing with a ring homomorphism). Note: this means any polynomial equation between integers is preserved by taking mods. 32 Basic Properties 33 Proposition Let f : G → G0 be a homomorphism. Then f (1G ) = 1H and f (x−1 ) = f (x)−1 . Moreover, H := rng f is a subgroup of G. Proof. Set e := f (1). Then e = f (1) = f (1 · 1) = f (1)f (1) = e2 and thus e = 1. We have 1 = f (xx−1 ) = f (x)f (x−1 ) The subgroup property follows immediately. 2 Cayley’s Theorem 34 Theorem (Cayley 1854) Every group is isomorphic to a subgroup of a permutation group. Proof. Let A = hA, ·i be a group, and let SA be the full permutation group over A. Define a map ϕ : A → SA ϕ(a)(x) = x · a Then ϕ is a homomorphism: ϕ(a · b) = ϕ(a) ◦ ϕ(b). Moreover, ϕ is mono since ϕ(a)(1) = a. Hence, the range of ϕ is a subgroup of SA that is isomorphic to A. 2 Note that this representation is not too helpful computationally: each permutation in SA has the same size as A. Kernels 35 Let f : G → G0 be a homomorphism. By the usual set-theoretic mumbo-jumbo we get an equivalence relation, the kernel relation of f , by setting x ∼ y :⇔ f (x) = f (y). Since we are dealing with groups there is a better description. Definition The kernel of a homomorphism is defined as ker f = { x ∈ G | f (x) = 1 }. Then x ∼ y ⇐⇒ y −1 x ∈ ker f Note that the kernel of a homomorphism is always a subgroup. Also, f is injective (a monomorphism) iff the kernel is trivial: ker f = 1. Cosets 36 We can push this a little bit further based on the last observation: Definition For any subgroup H ⊆ G and a ∈ G define the (left) coset of H by a as aH = { ax | x ∈ H } ⊆ G The number of such cosets is the index of H in G, written [G : H]. Right cosets are defined in a similar manner. Now consider any subgroup H ⊆ G and define a relation x ∼H y :⇔ x−1 y ∈ H We claim that ∼H is an equivalence relation on G whose equivalence classes are just the cosets aH. Partition Size 37 Lemma ∼H is an equivalence relation on G, and the equivalence classes of ∼H all have the same size |H|. Proof. Reflexivity follows from 1 ∈ H. Symmetry since x−1 y ∈ H implies (x−1 y)−1 = y −1 x ∈ H, Transitivity since x−1 y, y −1 z ∈ H implies x−1 z ∈ H. For the second claim note that [x]∼ = xH. But z 7→ xz is a bijection from H to xH. 2 Lagrange’s Theorem Theorem (Lagrange 1771) Let G be a finite group, and H any subgroup of G. Then |G| = |H| · [G : H]. In particular, |H| divides |G|. Note how algebra produces a stronger result here: if we look at arbitrary functions f : A → B then any equivalence relation arises as a kernel relation. But if we consider groups and homomorphisms we get only very special equivalence relations. This restriction will turn out to be very helpful to answer various counting problems. 38 Order 39 Let a ∈ G. We write h a i for the least subgroup of G containing a. It is not hard to see that h a i = { ai | i ∈ Z } If G is finite, we have h a i = { ai | i ≥ 1 }. Definition The cardinality of h a i is the order of a in G. Application It follows from Lagrange’s theorem that the order of any group element divides the order (cardinality) of the whole group. Hence for n = |G|, a ∈ G we have an = 1. This provides a simple proof for the famous Euler-Fermat theorem. Recall that Z?m is the group of elements in Zm that have multiplicative inverses. Also, ϕ(m) is Euler’s totient function: ϕ(m) = |Z?m |. Theorem (Euler-Fermat) The order of a ∈ Z?m divides ϕ(m). 40 Wurzelbrunft’s Idea 41 Write G/H for G/ ∼H , the collection of H cosets. Wurzelbrunft remembers from algebra lecture that quotients are really only useful if they carry some natural algebraic structure. He proposes to turn G/H into a group as follows: aH ∗ bH := abH and we get the Wurzelbrunft quotient group G/H. An example of this construction are the modular numbers from above. Since the group structure is inherited from G, this should be quite useful. Right? Wrong 42 For this to work we need to show that this multiplication is well-defined. So let a ∼ a0 and b ∼ b0 . We need abH = a0 b0 H But all the information we have is that a0 = ah1 and b0 = bh2 , hi ∈ H. H is a subgroup, so h2 H = H, which produces abH = abh2 H = ab0 H Alas, now we are stuck. As it turns out, there is no way to get around this problem: we need more than just a plain subgroup. Normal Subgroups Definition A subgroup H of G is normal if for all x ∈ H, a ∈ G: axa−1 ∈ H. In other words, a subgroup is normal if it is invariant under the conjugation maps x 7→ axa−1 . Equivalently, aH = Ha. In a commutative group all subgroups are normal. The trivial group 1 and G itself are always normal subgroups (groups that have no other subgroups are called simple, a hugely important concept in the classification of groups). There are non-commutative groups where all subgroups are normal, but that is a rare property. The group of all translations in the plane is a normal subgroup of the group of all rigid motions (translations plus rotations and reflections). 43 Fixing Wurzelbrunft Now we can fix Wurzelbrunft’s argument: assume H is normal. Then abH = aHb = ah1 Hb = ah1 bH = ah1 bh2 H = a0 b0 H Definition This group is called the quotient group of G modulo (the normal subgroup) H and written G/H. So where do we get normal subgroups? Proposition A subgroup H of G is normal iff it is the kernel of a homomorphism f : G → G0 where G0 is some other group. 44 It’s a Group 45 To hammer this home: let f : G → G0 be a homomorphism and ∼ = ∼ker f the equivalence relation induced by it. We can define a multiplication on the equivalence classes of ∼ by setting [x] ∗ [y] := [xy] This is well-defined: let x ∼ x0 and y ∼ y 0 , then f (xy) = f (x)f (y) = f (x0 )f (y 0 ) = f (x0 y 0 ), so that [xy] = [x0 y 0 ]. It is not hard to see that this produces a group structure on G/ ∼. Example 1 46 Let G be the integers under addition and H = mZ. Then x ∼ y ⇐⇒ y − x ∈ mZ ⇐⇒ x = y (mod m) H is the kernel of the epimorphism x 7→ x mod m. Example 2 47 Let G be the group of all permutations on [n]. Define ( 0 if x is even, f (x) = 1 otherwise. Then f is homomorphism from G to the additive group Z2 . The kernel of f is the subgroup H = { x ∈ G | x even } Note that |H| = |G| /2 = n!/2. Example 3 48 Consider the multiplicative group G = Z∗13 = {1, 2, . . . , 12} We one can check that H = {1, 3, 9} is a subgroup with cosets H = {1, 3, 9} , 2H = {2, 5, 6} , 4H = {4, 10, 12} , 7H = {7, 8, 11} The multiplication table for G/H written with canonical representatives is 1 2 4 7 2 4 7 1 4 7 1 2 and is isomorphic to the additive group Z4 . 7 1 2 4 Decomposition of Homomorphisms 49 Lemma Every homomorphism f : G → H can be written as f = ν ◦ ι where ν is an epimorphism and ι is a monomorphism. Proof. Let K ⊆ G be the kernel of f , a normal subgroup. Define ν : G → G/K x 7→ [x] ι : G/K → H [x] 7→ f (x) It is easy to check that these functions work. 2 Congruences 50 To obtain the quotient group G/H we need to factor by a special type of equivalence relation. Definition Suppose G is a group and ∼ an equivalence relation on G. ∼ is a congruence if for all x, y, u, v ∈ G: x ∼ x0 , y ∼ y 0 implies xy ∼ x0 y 0 . Again, congruences are very important since they make it possible to define a group structure on the quotient set G/∼: [x] · [y] = [x · y] Congruences and Homomorphisms Unfortunately, the equivalence relations ∼H for arbitrary subgroups H are not congruences in general, we need normal subgroups for this to work. Proposition If H is a normal subgroup, then ∼H is a congruence. Proposition H is the kernel of a homomorphism f : G → G0 iff H is normal. Exercise Prove these propositions. 51 Example: Chinese Remainder You know this already. E.g., let p and q be two distinct primes. f : Z → Zp × Zq f (x) = (x mod p, x mod q) Then H = pq Z and the quotient is Z/(pqZ) = Zpq . One can show that f is an epimorphism (this requires a little argument). Hence Zpq is isomorphic to Zp × Zq . 52 So? 53 Hence we can either compute with one number modulo pq, or with two numbers, one modulo p and the other modulo q. Zpq and Zp × Zq are isomorphic, but computationally there is a difference. This can be exploited sometimes to fake high-precision computations with small word sizes. Also note that the correctness proof for RSA more or less requires the product representation. From Magmas to Groups Substructures, Morphisms and Congruences 3 Generators and Cayley Graphs Data Structures for Groups Group Presentations Products Decision Problems Symmetric Groups Back To Subgroups: The Closure Perspective Our characterization of subgroup shows that subgroups are related to closures: we want subsets B ⊆ G that are “closed under the group operations”: 1∈B x ∈ B implies x−1 ∈ B x, y ∈ B implies xy ∈ B In the finite case the second condition is superfluous. This point of view makes it natural to start from any set A ⊆ G and then add elements until we have closure, i.e., a subgroup: we want the least subgroup that contains A. 55 Generating Subgroups As it turns out, there are many useful subgroups defined by conditions such as the following: Let H be the least subgroup of G containing all the elements g1 , . . . , gk ∈ G. Definition Let G be a group and A ⊆ G. The group generated by A is the least subgroup of G that contains A. A is a set of generators for this subgroup. In symbols: h A i . Here are some examples. 56 Some Subgroups 57 Example Swap: The permutation “swap 1 and 2” generates a subgroup of size 2: {I, (1, 2)}. The permutation “rotate left” generates a subgroup of size n: { (1, 2, . . . , n)i | i < n }. The same subgroup is generated by “rotate left”. The alternating group An . But rotate together with swap generate the whole symmetric group. Let G be the full permutation group on X. Let X0 ⊆ X and set H = { f ∈ G | ∀ x ∈ X0 f (x) = x }. Then H is a subgroup of G. Existence versus Construction Abstractly we know that h A i always exists since hAi = \ { H ⊆ G | A ⊆ H subgroup } But computationally this is useless: we already have to know all subgroups (containing A) to compute the intersection. Even if G is finite and relatively small, there is no hope to build an algorithm on this characterization. Also note that h A i is one of the H’s on the right hand side (impredicative definition). So how do we actually compute h A i from A? 58 One Generator 59 If there is only one generator g, and G is finite, then all we get is H = { gi | 0 ≤ i < m } where m is the order of g in G. Note that in this case H is Abelian. In fact, H is isomorphic to Zm via i 7→ g i . If the order of g is infinite then h g i is isomorphic to Z. Two Generators A small set of generators provides a good, compact description of a group provided one can easily compute the group operation. Alas, for multiple generators, things soon become very complicated. Let a = (1, 2) and b = (1, 2, . . . , n) in Sn . Proposition h a, b i = Sn . Exercise Show that a single generator cannot suffice to produce Sn . Exercise Find some other set of generators for Sn . Exercise Characterize all two-element sets of generators for Sn . 60 Cayley Graphs 61 Generators also build a bridge between groups and labeled digraphs. Definition Let G be a group and A a set of generators of G. The (right) Cayley graph of G (wrt. A) is the directed labeled graph Γr (G) = hG, Ei with edges given by a x −→ x · a where x ∈ G, a ∈ A Likewise we can define a left Cayley graph Γl (G). Lemma Γr (G) is strongly connected and regular. This follows from A being a set of generators. Example The Cayley graph of the Abelian group Z2 × Z2 × Z2 . 62 Example The Cayley graph of the Abelian group Z9 × Z16 . 63 Example The Cayley graph of the symmetric group of four letters. 64 Example 65 a a a b b b b b b a a a Exercise Determine the group given by this Cayley graph. Generating Subgroups So suppose we have a set of generators g1 , . . . , gk in some finite group G. How do we compute the generated subgroup h g1 , . . . , gk i ? We form all possible compositions of the generators: g1 · g1 , g1 · g2 , g2 · g1 , g1 · g2 · g1 , g2 · g1 · g1 , and so on. Stop when no new elements appear. This is a classical closure operation. Note that if we were operating in an infinite group we also would need to deal with inverses (just try a single generator). 66 Fixed Point Perspective 67 Since we are dealing with a closure operation it is natural to express the construction using fixed points. Define F to be the operation “multiply by all the generators and keep the old stuff”: F : P(G) → P(G) F (X) = Xg1 ∪ Xg2 ∪ . . . ∪ Xgk ∪ X Then at least for finite groups G we have h g1 , . . . , gk i = FP(F, {1}). In any implementation bookkeeping will be crucial to avoid recomputation. Fixed Point Algorithm Here is an implementation of the fixed point idea. The program below avoids recomputation by keeping a set of “active” elements (which may lead to new group elements when multiplied by a generator). act = H = {1}; while( act != {} ) { H = Union[ H, act ]; act = act * gen; // form all possible products act = Complement[ act, H ]; } Exercise Figure out how to implement this algorithm. For example, how should one handle subgroups of Sn generated in this fashion? 68 Example 69 Let a = T (2, 1, 3, 4) and b = T (2, 3, 4, 1) in S4 . The table shows the elements added at each step. We omit the T for clarity. level new elements 0 (1, 2, 3, 4) 1 (2, 1, 3, 4), (2, 3, 4, 1) 2 (1, 3, 4, 2), (3, 2, 4, 1), (3, 4, 1, 2) 3 (2, 4, 1, 3), (3, 1, 4, 2), (3, 4, 2, 1), (4, 1, 2, 3), (4, 3, 1, 2) 4 (1, 4, 2, 3), (3, 1, 2, 4), (4, 1, 3, 2), (4, 2, 1, 3), (4, 3, 2, 1) 5 (1, 2, 4, 3), (1, 3, 2, 4), (1, 4, 3, 2), (3, 2, 1, 4), (4, 2, 3, 1) 6 (2, 1, 4, 3), (2, 3, 1, 4), (2, 4, 3, 1) Spanning Tree Perspective The fixed point algorithm is perfectly usable, but sometimes a more detailed construction is preferable. For an alternative approach we can use Cayley graphs. Suppose we had the Cayley graph Γr (H) of H whose edges are labeled by the given generators A. We can think of generating a subgroup as a graph exploration problem: starting at vertex 1 we are trying to produce all points reachable via path segments labeled by a sequence g1 , . . . , gk of generators. Needless to say, this is just a Gedankenexperiment: all we have in reality is the generators and some group operation in G. 70 Building a Spanning Tree At any rate, we can build a spanning tree T of Γr (H) as follows: Initialize T = {1}. For each leaf x of T compute y = x · g for all generators g. If y is not in T add y as a new node, and add a tree edge (x, g, y). Stop when no new nodes appear. This is really just breadth-first-search in a virtual graph: it suffices to have one point and the ability to generate all out-edges of a point. It is even an advantage not to have a standard data structure (such as an adjacency list): this approach also works when G is huge (even infinite) as long as H is not too large. 71 Witnesses Note that every point in the spanning tree (and thus every element of H) is associated with a unique path from the root to the point. Reading off the labels of that path we obtain a “word” whose letters are generators that represents the subgroup element: multiplying out this product of generators we obtain the subgroup element. This word is called a witness for the corresponding element. Witnesses are occasionally useful, in particular in connection with finite state machine constructions. More later. 72 Example 1 73 Consider the two generators a = (1, 0) and b = (0, 1) in Z3 × Z2 , the group from the Cayley graph example. witness ε a b aa ab aab element (0, 0) (1, 0) (0, 1) (2, 0) (1, 1) (2, 1) There is no witness ba since ba = (1, 1) which already has a length-lex shorter witness ab < ba. The Tree 74 Here is the spanning tree constructed by the algorithm. 0, 0 a b 1, 0 0, 1 a b 2, 0 1, 1 b 2, 1 The Full Graph 75 Adding the back-edges encountered during the construction we get the full Cayley graph. 0, 0 b a b a 1, 0 0, 1 b a a b 2, 0 1, 1 b a b a 2, 1 Example 2 76 Consider the two generators a = T (2, 1, 3, 4) and b = T (2, 3, 1, 4) in S4 . ε a b ab ba bb Tree: T (1, 2, 3, 4) T (2, 1, 3, 4) T (2, 3, 1, 4) T (3, 2, 1, 4) T (1, 3, 2, 4) T (3, 1, 2, 4) Example 3 77 Consider the two generators a = T (2, 1, 3, 4) and b = T (2, 3, 4, 1). We use one-line notation for clarity. ε a b ab ba bb aba abb bab bba bbb abab (1, 2, 3, 4) (2, 1, 3, 4) (2, 3, 4, 1) (3, 2, 4, 1) (1, 3, 4, 2) (3, 4, 1, 2) (3, 1, 4, 2) (4, 3, 1, 2) (2, 4, 1, 3) (3, 4, 2, 1) (4, 1, 2, 3) (4, 2, 1, 3) This time the tree has depth 6. abba abbb babb bbab ababb abbab babba babbb bbabb ababba ababbb abbabb (4, 3, 2, 1) (1, 4, 2, 3) (3, 1, 2, 4) (4, 1, 3, 2) (1, 3, 2, 4) (1, 4, 3, 2) (3, 2, 1, 4) (4, 2, 3, 1) (1, 2, 4, 3) (2, 3, 1, 4) (2, 4, 3, 1) (2, 1, 4, 3) Implementation As usual, assume that each group element can be stored in O(1) space, that a group operation can be computed in O(1) time, and that we can store and search for elements in O(1) steps. Theorem One can compute the subgroup H (and indeed the Cayley graph of H) generated by g1 , . . . , gk in expected time linear in the size of H. Note, though, that the efficiency assumption may be blatantly false in practice. E.g. for permutation and matrix groups the algebraic operations are quite expensive. The theorem is based on using a hash table as the main container. Computing a good hash function and checking equality may be far from constant. 78 Pseudocode Here is pseudocode for the subgroup generating algorithm given a list of generators. enqueue( 1 ); while( queue not empty ) x = dequeue; for each generator g do y = x * g; if( y is new ) enqueue( y ); Use a hash table (or some other dictionary) to check if y is new. 79 Why a Queue? 80 As far as the set of generated elements is concerned, any container would do. But in some applications a queue is the best choice. To see why, first let us rephrase the problem slightly. We are really dealing with a structure A = h A, f1 , . . . , fk i and, given a point a ∈ A, we are trying to compute the least B ⊆ A such that a ∈ B, and x ∈ B implies fi (x) ∈ B for all i = 1, . . . , k . As a set, B is independent of our choice of container in the algorithm. But Witnesses Are Not 81 Consider the alphabet Σk = {1, 2, . . . , k}. Much as in a DFA we can evaluate a word w = e1 e2 . . . en by applying the functions to the seed point a in this order: b = fe1 ◦ fe2 ◦ . . . ◦ fen (a) So w is a witness (or certificate) for b ∈ B. But in general there are many witnesses, so one would like to have a natural one. For algorithmic purposes, the best choice is the length-lex minimal witness. To get the length-lex minimal witness we have to use a queue (and run through the generating functions in the natural order). Exercise Prove this assertion about minimal witnesses. Prototype Algorithm Here is the spanning tree algorithm as pseudocode. enqueue( a ); while( queue not empty ) x = dequeue; for each function fi do y = fi(x); if( y is new ) wit(y) = wit(x).i; enqueue( y ); // perhaps other processing By choosing appropriate “other processing” versions of this prototype algorithm can be used in many situations. 82 From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs 4 Data Structures for Groups Group Presentations Products Decision Problems Symmetric Groups Implementing Groups So how do we actually compute in a group? Let’s first focus on the finite case, for which there always is a brute-force solution – at least in principle. Definition Given a finite group G = hG, ∗i the Cayley table or multiplication table of G is an G by G matrix with entries in G: the entry in position (a, b) is a ∗ b. It is usually safe to assume that the group elements are represented by integers, so the size of the Cayley table is Θ(n2 ) using a uniform cost function. That’s OK for small n but not for larger ones. More importantly, Cayley tables tend to shed little light on the structure of the group, all you have is a pile of data. 84 Small Groups 85 n = 1: trivial group {1} n = 2: Z2 1 a a 1 n = 3: Z3 1 a b a b 1 b 1 a n=4 86 Z4 1 a b c a b c 1 b c 1 a c 1 a b 1 a b c a 1 c b b c 1 a c b a 1 Kleinsche Vierergruppe n = 5, 6 87 n = 5: Z5 n = 6: Z6 , S3 n = 7: Z7 n = 8: 5 groups It gets to be a bit tedious to write down these Cayley tables. Here is a count of the number of finite groups of size n for n ≤ 60. Note that the outliers at n = 32 and n = 48. Counting Finite Groups 88 50 40 30 20 10 10 20 30 40 50 60 Cyclic Groups 89 A group G is cyclic if there is some element a ∈ G such that G = { ai | i ∈ Z } In this case a is called a generator. If G is a finite cyclic group we have G = { ai | 0 ≤ i < k } where k is the order of a (which is the size of G). Note that in any finite group G and for any a ∈ G the subgroup { ai | 0 ≤ i < k } is cyclic (with generator a). Cyclic Groups are Boring Up to isomorphism there is only one cyclic group of order k, and it is isomorphic to h Zk , +, 0 i . A generator is 1. Note that there are other generators, though: ` is a generator iff gcd(`, k) = 1. All cyclic groups are commutative. 90 Multiplicative Subgroup 91 Recall Z?m = { x < m | gcd(x, m) = 1 } Example Here is the Cayley table for Z?20 . 1 3 7 9 11 13 17 19 3 9 1 7 13 19 11 17 7 1 9 3 17 11 19 13 9 7 3 1 19 17 13 11 11 13 17 19 1 3 7 9 13 19 11 17 3 9 1 7 17 11 19 13 7 1 9 3 Note the subgroup {1, 3, 7, 9} in the top-left corner. 19 17 13 11 9 7 3 1 Dihedral Groups 92 Symmetries in geometry are an excellent source of groups. For example, consider the square with four vertices in positions (±1, ±1). D A C B What are the rigid motions of the plane that leave the square unchanged in the sense that they place the square on top of itself? Dihedral Groups, II 93 Your geometric intuition should tell you the following: The motions that leave the square unchanged are precisely: Rotations around the origin by multiples of π/2 There are essentially only 4 of these, including the trivial one. Reflections along the axes and diagonals. There are 4 of these. D A C D C B B A Dihedral Groups, III These motions naturally form a group: composition of motions is associative, the identity motion is admissible, every motion is reversible, and the composition of two admissible motions is again admissible. This group is called a dihedral group D4 . If we replace the square by a regular n-gon we obtain Dn : a group consisting of n rotations and n reflections. Another tempting generalization is to 3-dimensional space (replace square by cube), but we won’t pursue this here. 94 Pentagon The symmetries of a pentagon, given by D5 . 95 An Isomorphism 96 Proposition The symmetric group on 3 points is isomorphic to the dihedral group D3 . Proof. First note that both groups have size 6, so there is a chance the claim might be correct. The permutations f = (1, 2) and g = (1, 2, 3) (in cycle notation) generate S3 , so we only need to find their counterparts in D3 . f corresponds to a reflection and g corresponds to a rotation. 2 Exercise Check the details in the last argument. Why can this line of reasoning not be used to show that Sn is isomorphic to Dn in general? Other Representations Needless to say, a table of size n2 is only useful for rather small values of n. In the last example, the table was constructed by using some standard arithmetic functions: GDC, multiplication, mods. In general, sometimes we can express the group operation effectively by using standard operations on some numerical or combinatorial data structure. One very important example of this technique is the use of matrices to represent groups: matrices over any ring come equipped with a natural operation: matrix multiplication. As it turns out, by choosing suitable matrices to represent group elements one can often translated the group multiplication into matrix multiplication. Note that this representation is potentially much smaller than the full Cayley table: we just have to store the translation from group element to matrix. 97 Permutation Matrices 98 Here is a first step in this direction: we express permutations as matrices. Definition A permutation matrix is a 0/1 matrix that has exactly one 1 in each row and each column. It is easy to associate a permutation f on [n] with an n × n permutation matrix Mf : ( 1 Mf (i, j) = 0 if f (i) = j, otherwise. Proposition The map Φ : f 7→ Mf is a group monomorphism. This is easy to check. Note, however, that it is important how composition of permutations is defined here: (f ◦ g)(x) = g(f (x)). The group operation on the matrices is ordinary matrix multiplication. Alternative Composition 99 What if we use the other form of composition on permutations: (f ∗ g)(x) = f (g(x))? Then f 7→ Mf is an anti-homomorphism. Anti-homomorphisms are slightly less useful than homomorphisms, but this problem can be fixed by considering the transpose of Mf instead: f 7→ MfT is a group homomorphism from h Sn , ∗ i to h Mat, · i . Why would anyone care about these two different representations? They come in very handy in connection with group actions. Exercise Verify that Φ is a homomorphism and anti-homomorphism, respectively, given the two group structures on the set of permutations. A Matrix Group 100 Here is another example. Consider the set G of all integer matrices of the form e 0 k 1 where e ∈ {−1, +1} and k ∈ Z. Since the determinant of these matrices is e they are in fact invertible – though it is far from clear that the inverse is in G. Closure of G under matrix multiplication is easy to see, though: e 0 k 1 0 e · 0 k0 1 = ee0 0 k + ek0 1 Exercise Give a careful proof that G really forms a group. What else can you say about G? Modeling Dn 101 We could write down a multiplication table for the group, but that is not particularly helpful. There is a matrix representation: matrices of the form e 0 k 1 where e ∈ {−1, +1} and k ∈ Zn . The basic rotation and reflection are represented by 1 0 1 1 −1 0 This is nice, but not quite what we are looking for. 0 1 From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs Data Structures for Groups 5 Group Presentations Products Decision Problems Symmetric Groups Building Groups from Relations We have already seen how to construct the free group over A as a set of words Γ∗0 with concatenation plus cleanup as multiplication. So the basic idea is to use words and concatenation, combined with certain simplification rules. This approach can be pushed quite a bit further. First, an example: let’s try to construct the dihedral group D4 in this manner. 103 Representing D4 Here is one way to describe D4 . 1: identity α, α2 , α3 = α−1 : rotations β, α2 β: reflections along axes αβ, α3 β: reflection along diagonals Of course, we have to check that this is geometrically correct. This is clear for the rotations αi , but the reflections require a little check. In particular it is not clear that there is a single reflection β such that all others can be expressed in terms of β and rotations. Exercise Check the details. 104 Simplification Rules 105 Now for the important part: we don’t want a multiplication table and instead use concatenation of words over the alphabet {α, β}. For example, α2 · α3 β = α5 β = αβ Here we have used the first of the following simplification rules: α4 = 1, β 2 = 1, αβ = βα3 = βα−1 . As is customary in this context, we have written 1 to express the empty word. The General Case What is the structure of a dihedral group Dn in general? Exactly the same, we only need to replace 4 by n. No extra work is needed. αn = 1, β 2 = 1, αβ = βαn−1 = βα−1 . Very elegant. Exercise Check that this description holds in general for all n. Make sure to distinguish between even and odd n. 106 Normal Form 107 It follows that every element can be written in the form αi or βαi where 0 ≤ i < n. The αi are all the pure rotations. The βαi are all the combined rotations cum reflection along a particular axis, which produces arbitrary reflections. To multiply two elements, we concatenate the words and then apply the simplification rules until we are back in normal form. Simplification in D4 108 Here is an example of how this simplification process works: ααβββαβα ααβαβα αβα−1 αβα αββα α2 It is not clear that application of the rules in a different order could not produce a different result, but one can prove that one always gets to the same normal form. Representing Dn 109 Hence we can describe the dihedral group Dn very compactly by α, β | αn = 1, β 2 = 1, αβ = βα−1 This means: there are two special elements α and β, and all the other elements can be obtained from these two by arbitrary combinations subject to the rules indicated. Note that αβ = βα−1 could have been written as β −1 αβα = 1, so all rules can be made to look like w = 1. Again, there is no need for a multiplication table: we can just form products of α’s and β’s and apply the simplification rules given. Finitely Presented Groups More generally we can obtain groups over some set X of generators as follows: Select a set R ⊆ F (X), the set of relators. Define the normal closure R of R as the subgroup of F (X) generated by { grg −1 | r ∈ R, g ∈ F (G) }. Then the group G = F (X)/R is presented by X and R. One usually simply write h X | R i for the group so defined. Of course, the most interesting case is when X and R are finite. The groups is then finitely presented. 110 Finitely Presented It is very hard to find examples of groups that are finitely generated but not finitely presented. For example, one can show that there are 2ℵ0 non-isomorphic groups with 2 generators. Since there can be only countably many finitely presented such groups most of them are not. Cardinality arguments are usually frustrating. Concretely, in this case one can show that a wreath product of two infinite cyclic groups is not finitely presented, but the argument is difficult. 111 Relators versus Relations The idea behind this construction is that h X | R i is the group generated by X that has only the properties described in R (and whatever follows from there via the group axioms), but nothing else. By property we mean that r ∈ R is identified with the unit element. For example, for the dihedral group above we could choose R = α2 , β 2 , β −1 α−1 βαn−1 Exercise Show that R = αn , β 2 , (αβ)2 also works. 112 Von Dyck’s Lemma It is intuitively clear that for relators R ⊆ S ⊆ F (X) the group h X | S i is more specialized than the group h X | R i : we have imposed additional specifications. This is made explicit in the next lemma. Lemma Let G = h X | R i and H = h X | S i . For R ⊆ S ⊆ F (X) there exists an epimorphism f : G → H that is the identity on X and has kernel S − R. On the other hand, every factor of G has a presentation h X | S i where R ⊆ S. 113 An Example 114 Consider the Fibonacci group on three generators: F = h α, β, γ | αβ = γ, βγ = α, γα = β i Here is quaternion group: Q = a, b | a4 = 1, b2 = 1, aba = b Exercise Show that the two groups are isomorphic. Another Example 115 Here is just one other example of a finitely presented group. There are n − 1 generators g1 , g2 , . . . , gn−1 and the relations are g12 = 1 (gi gi+1 )3 = 1 2 (gi gj ) = 1 for i < n − 1 for j < i − 1 Note how it is entirely unclear what the size of this group is, or what its properties might be. It requires a bit of effort to establish the following characterization. Lemma The group defined by these rules is (isomorphic to) the symmetric group on n points. Hint: figure out what the gi are. A Question Is it possible to write down a contradictory set of relators? For example, suppose we write a = b2 , a = b5 , a2 = b−3 . Does this still describe a group? 116 Word Processing in Groups 117 Here is one last look at this idea of finite presentations. Recall our clever description for dihedral groups: we need a rotation α and a reflection β and have properties G = α, β; αn = 1, β 2 = 1, αβ = βα−1 Let’s write the letters a and b symbolically for α and β. Then there is a homomorphism from the monoid of all words over {a, b} to the group η : {a, b}? → G which is given by f (a) = α and f (b) = β. The word equations an = 1, b2 = 1, ab = ban−1 describe the kernel K of f . Quotients, Again In other words, for any w ∈ {a, b}? we have f (w) = 1 iff w can be reduced to 1 (if you prefer: the empty word) by repeated application of the rewrite rules. The quotient of the monoid {a, b}? by K is isomorphic to the group G. Algebraically, there is no difference between G and the quotient structure: exactly the same equations hold in both. The great advantage of this representation is that we can easily manipulate words, but may not have a direct handle on the group elements (even for dihedral groups where we can handle the group elements the word representation is computationally easier). 118 Automatic Groups In fact, we can use finite state machines to perform operations on the words representing group elements. For example, we might try to find a FSM M1 that, given a word w over {a, b} determines whether f (w) = 1. Likewise, we can have machines for multiplication. This is technically a little tricky since we need two words as input (and cannot simply read first u and then v; rather, we must read both words simultaneously using a product alphabet). Groups that can be described by finite state machines have a particularly good structure and are well understood. 119 Example: D4 120 The minimal DFA that checks identity in D4 . a b b a b a b a a a a b b a b b Interpretation: inner states: αi outer states: αi β Any state can be chosen as initial and final state. Digression: Counting Identities 121 How many words over {a, b}? of length n are there that denote the identity in D4 ? This may seem like a hard problem, but given the DFA one can easily experiment. Here is a census for words up to length 12: n # 0 1 1 0 2 1 3 0 4 4 5 0 6 16 7 0 8 64 9 0 10 256 11 0 12 1024 The conjecture is now obvious: for length 2n > 0 there are 22n−2 words that denote the identity. Exercise Prove this conjecture. From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs Data Structures for Groups Group Presentations 6 Products Decision Problems Symmetric Groups Direct Products 123 Given two groups A and B we can construct a new group G = A × B as follows: the carrier set is the Cartesian product A × B and multiplication is pointwise: (a1 , b1 )(a2 , b2 ) = (a1 a2 , b1 b2 ) The construction naturally generalizes to an arbitrary number of factors: Q G = i∈I Ai . A variant of this is the coproduct: a Ai = { a ∈ Y Ai | supp(a) finite } i∈I where supp(a) denotes the support of a: the indices i for which ai 6= 1. Unique Products Suppose we have G = AB where A and B are subgroups of G: every element of G can be written as a product ab where a ∈ A, b ∈ B. This particularly interesting when this decomposition is unique: a1 b1 = a2 b2 implies a1 = a2 , b1 = b2 . It is not hard to see that this type of uniqueness requires that A ∩ B = 1, and one of A or B is normal. Exercise Verify the last claim. 124 Semidirect Products 125 Suppose G = AB and the decomposition is unique, say A is normal. Can one write G as a product of the groups A and B? First note that the direct product A × B does not work in general, we need something slightly more complicated. To this end consider a homomorphism ϕ : B → Aut(A) . The semidirect product A oϕ B is defined on the Cartesian product of the carrier sets of A and B by (a1 , b1 )(a2 , b2 ) = (a1 ϕ(b1 )(a2 ), b1 b2 ) Thus if ϕ is the constant map to identity we get the ordinary direct product. Semidirect Examples 126 Example Let G = AB as above and define ϕ(b)(x) = bxb−1 Then G is isomorphic to A oϕ B. Example Let A = Zn and B = Z2 , define ϕ(1)(x) = x−1 (which is an automorphism since A is commutative). Then the dihedral group Dn is isomorphic to A oϕ B. Rotation corresponds to (1, 0) and reflection corresponds to (1, 1). Wreath Products 127 There is a special type of semidirect product that often comes in handy. Given two groups A and B define a left action of B on AB by (b ∗ a)i = ab−1 i Here we have written the index as i but note that i ∈ B. Thus, b simply permutes the elements of vector a which are indexed by B. Note that the map a 7→ b ∗ a is an automorphism ϕ(b) of AB . Definition The wreath product A o B of A and B is the semidirect product AB oϕ B. The Lamplighter Group 128 For simplicity write 2 for the additive group Z2 . The structure of G = 2 o Z is as follows. We are dealing with bi-infinite bitvectors a ∈ 2Z . An integer i acts on a by shifting the sequence i times. Writing σ for the shift we have (a, i)(b, j) = (a + σ i (b), i + j) One can show that this group has two generators a and t subject to (ati at−i )2 = 1 Here (e0 , 0) corresponds to a (flip the lamp at the origin) and (0, 1) corresponds to t (shift by one; the lamplighter moves). From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs Data Structures for Groups Group Presentations Products 7 Decision Problems Symmetric Groups Putting Things Together Here is a slightly more general problem: suppose we want to generate a group H that is given implicitly by some finite presentation H = h g1 , . . . , gk | E1 , . . . , El i where the Ei are equations using the generators such as g12 = 1, g2 g3 = g3 g2 and so on. In principle, there is a simple algorithm: we start with the identity element, and keep multiplying what we already have by the generators. Multiplication y = x * g is done by concatenating words, and then simplifying according to the rewrite rules Ei . Example h a; an = 1 i will produce the elements a, a2 , . . . , an−1 , 1, in this order. 130 Generating the Dihedral Group Suppose we use two generators a and b and the three rules a4 = 1, b2 = 1, ab = ba3 . Then our algorithm will produce the elements 1, a, b, aa, baaa, ba, aaa, baa in the given order. 131 Some Problems 132 In general, the group H will be infinite, so the algorithm may not terminate. E.g., think about H = h a; − i There is one generator, but no simplification rules at all. This should produce (a group isomorphic to) Z, rather than just a semigroup. At present, our algorithm fails in this sense (apart from not terminating). The solution is to add inverses to the generators: For every letter g also include another letter g and the rules gg = gg = 1 Enlarging the Alphabet 133 Then for the enlarged alphabet Σ = {g1 , . . . , gk , g 1 , . . . , g k } we have a homomorphism (of monoids) η : Σ? → H that evaluates the words over Σ to the corresponding group elements according to the defining relations. Needless to say η(g) = η(g)−1 . Exercise Explain why it is not necessary to enlarge the alphabet whenever H is finite. More Word Processing 134 Another problem is that the simplification may not be so easy: for this algorithm to work we need to be able to check if a newly generated word u represents the same group element as some already encountered word v. Since witnesses are not unique in general, to check equality we will need some kind of normal form, some canonical way to write u and v in terms of the generators. We could agree that the length-lex minimal word is the right normal form, but how do we compute this particular representation? Our only hope is to check whether uv −1 somehow simplifies to 1 using the given rewrite rules. Note that it is convenient to have formal inverses for this approach. The Word Problem Problem: Instance: Question: 135 Word Problem Generators A, rewrite rules R and a word w in Σ? Can w be simplified to 1, using the given rules? Theorem (Novikov 1955, Boone 1958) The Word Problem is undecidable in general. In fact, the Word Problem remains undecidable for some fixed A and R. But as we have seen, for some sufficiently simple groups the word problem can even be handled by a finite state machine. Opening the Flood Gates The proof ideas for this theorem were then used to show that just about any question about a finitely presented group G turns out to be undecidable. Word Problem: Given a word w, does it denote 1? Finiteness: Is G finite? Commutativity: Is G commutative? Cyclicity: Is G cyclic? Isomorphism: Given two such groups, are they isomorphic? Of course, special cases are decidable. But in general, finitely presented groups are too complicated to be handled computationally. 136 A Bizarre Result Here is a result that shows how atrociously complicated finitely presented groups can be. Theorem (Novikov) There is a finitely presented group that contains an isomorphic copy of every finitely presented group. This sounds utterly impossible at first glance: there are only countably many finitely presented groups and they can surely be wrapped up into a single group. But why should that group be finitely presented itself? But, Novikov’s theorem is a consequence of computability theory and a result in group theory: a finitely generated group is isomorphic to a subgroup of a finitely presented one if, and only if, it is recursively presented (replace finitely many equations with a semi-decidable set of equations). 137 Practical Computing in Groups There is still a lot that can be computed effectively and even efficiently in groups, though some of the algorithms are quite sophisticated (and incorporate a lot of group theory knowledge). An excellent public domain package for computational group theory is GAP, available at http://www-gap.dcs.st-and.ac.uk/~gap Rather large groups such as the group of motions of Rubik’s Cube can easily be handled easily by GAP. There is even a group at CUNY (Baumslag) that tries to implement an interactive system that can be used to solve undecidable problems in group theory – at least in some cases. 138 From Magmas to Groups Substructures, Morphisms and Congruences Generators and Cayley Graphs Data Structures for Groups Group Presentations Products Decision Problems 8 Symmetric Groups Permutations For our purposes the most important examples of groups are those comprised of permutations. Definition A permutation is a bijection f : A → A , in particular when A is a finite set. The collection of all permutations on A, an n-element set, under functional composition is the symmetric group (on n letters or points). Notation: Sn As we will see shortly, in most cases the full symmetric group is too large; we need to focus on subgroups of Sn . 140 Permutations 141 We will focus on the carrier set A = [n]. In this case, we can represent f by a 2 × n matrix of the form 1 2 3 ... n−1 n f (1) f (2) f (3) . . . f (n − 1) f (n) This is the so-called two-line representation of f . Needless to say, the first row in this matrix is really redundant, but this redundancy makes it a bit easier to read off specific values. Alternatively, we can use one-line representation: (f (1), f (2), . . . , f (n − 1), f (n)) Rearrangements 142 The one-line representation is interesting since it suggests a different interpretation: a permutation is a rearrangement of the values 1, 2, . . . , n (or some other ordered carrier set). (f (1), f (2), . . . , f (n − 1), f (n)) To explain precisely how the two notions are related we have to talk about actions (here, permutations acting on lists). More about this later, for the time being we just think of rearrangements informally. Notation: Note that this notation is a bit dangerous: it might be confused with all kinds of other lists. On occasion we may write T (a1 , . . . , an ) (where the T stands for transformation) for clarity. Too Many 143 No yawning, please. Lemma There are n! permutations on [n]. Proof. Induction on n. The base case n = 1 is obvious. For the step from n − 1 to n note that we can insert the new element n in n places (indicated by |) into any permutation of n − 1: | a1 | a2 | a3 | . . . | an−2 | an−1 | By IH, this produces (n − 1)! · n = n! permutations. 2 So this is worse than exponential: 2n = o(n!). Generating All Permutations 144 The counting argument in the last proof also produces a recursive algorithm to construct the collection Pn of all permutations on [n]: If n = 1 return ((1)). Else generate Pn−1 , and insert n in all possible positions for any π ∈ Pn−1 . This is correct but atrocious as far as memory requirements go. A much better approach is to construct a function f : Pn → Pn such that the orbit of any π ∈ Pn is all of Pn . Cycle Decomposition 145 Suppose f is a permutation. The functional digraph of f is particularly simple: it consists only of cycles (all transients are 0). Example Here is a permutation on n = 12 in two-line notation. 1 2 3 4 5 6 7 8 9 10 10 12 8 3 7 9 5 6 11 2 11 4 12 1 It produces the cycles (1, 10, 2, 12), (3, 8, 6, 9, 11, 4), (5, 7) There are 3 cycles of lengths 4, 6, 2, respectively. Note that there could be just a single cycle of length n: (1, 2, . . . , n) in cycle notation stands for the cyclic shift. Omitting Fixed Points 146 It is customary (and often very useful) to omit fixed points from the list of cycles. Example The cycle decomposition of T (4, 7, 1, 6, 8, 9, 11, 5, 2, 10, 3, 12, 14, 13) would be written as (1, 4, 6, 9, 2, 7, 11, 3), (5, 8), (13, 14), leaving out the fixed points 10 and 12. In standard mathematics texts you should expect to find the more compact notation used a lot. Computing the Cycle Decomposition Lemma We can compute the cycle decomposition of a permutation f : [n] → [n] in time and space linear in n. Here we tacitly assume that f (x) can be computed in time O(1) (which is safe since ordinarily f will be given by an explicit array). There are at least two ways to think about this: Compute the strongly connected components in the functional digraph of f. Compute the orbits of the function f , exploiting the fact that they are all periodic. Note that generating the cycle decomposition seems to require linear space (as opposed to Floyd’s algorithm for transients and period). 147 Canonical Cycle Decomposition Note that we can rearrange the cycles arbitrarily, and we can rotate each individual cycle without changing the underlying permutation. For example, the following two decompositions describe the same permutation on n = 14. ((7, 5), (11, 4, 3, 8, 6, 9), (12, 1, 10, 2)) ((1, 10, 2, 12), (3, 8, 6, 9, 11, 4), (5, 7)) The second representation may seem more natural from the implementor’s point of view, but it is the first that has better combinatorial properties. Definition The canonical cycle decomposition (CCD) of a permutation is obtained by rotating all cycles so that the largest element is up front and the cycles are ordered by first element. If the least element is in the first position we speak of the reverse canonical cycle decomposition (RCCD) 148 More Natural? Here is the prototype algorithm that almost everybody would write when asked to implement cycle decomposition. for x = 1,..,n do if( x unmarked ) mark x; res = (x); while( f(x) unmarked ) x = f(x); mark x; append( res, x ); output res; This program places the least element first in each cycle and returns the cycles sorted by first element. 149 CCD for Length 4 150 Here are the CCDs for all elements of S4 , enumerated in lex order. ((1), (2), (3), (4)) ((1), (4, 3, 2)) ((3, 1, 2), (4)) ((3, 2, 1), (4)) ((3, 1), (4, 2)) ((2), (4, 3, 1)) ((1), (2), (4, 3)) ((1), (3), (4, 2)) ((4, 1, 2, 3)) ((4, 2, 1, 3)) ((4, 1, 3, 2)) ((2), (3), (4, 1)) ((1), (3, 2), (4)) ((2, 1), (3), (4)) ((4, 3, 1, 2)) ((2), (3, 1), (4)) ((4, 3, 2, 1)) ((4, 2, 3, 1)) ((1), (4, 2, 3)) ((2, 1), (4, 3)) ((3), (4, 1, 2)) ((2), (4, 1, 3)) ((3), (4, 2, 1)) ((3, 2), (4, 1))) Exercise Find a good algorithm to compute the CCD of a given permutation. What is the running time of your algorithm? Flattening CCDs 151 Here are these CCDs flattened out. 1, 2, 3, 4 1, 4, 3, 2 3, 1, 2, 4 3, 2, 1, 4 3, 1, 4, 2 2, 4, 3, 1 1, 2, 4, 3 1, 3, 4, 2 4, 1, 2, 3 4, 2, 1, 3 4, 1, 3, 2 2, 3, 4, 1 1, 3, 2, 4 2, 1, 3, 4 4, 3, 1, 2 2, 3, 1, 4 4, 3, 2, 1 4, 2, 3, 1 1, 4, 2, 3 2, 1, 4, 3 3, 4, 1, 2 2, 4, 1, 3 3, 4, 2, 1 3, 2, 4, 1 We get all permutations. Could this be coincidence? A Bijection 152 From the data structure point of view, the cycle decomposition is a list of lists of integers. Hence we can flatten it to obtain a plain list of integers: flat : List(List(N)) → List(N) If we start with the full cycle decomposition (including fixed points) we obtain a permutation (in one-line representation) this way. For arbitrary decompositions this is of little interest, but if we start with the CCD we get the following proposition, which is helpful in enumeration problems related to permutations. Proposition The map CCD ◦ flat is a bijection on Sn . Questions Exercise Prove that CCD ◦ flat is indeed a bijection. Exercise What are the fixed points of this bijection? Exercise How about RCCD ◦ flat? 153 Algebraic Decomposition 154 Since permutations are functions we can compose them by ordinary functional composition f ◦ g. Recall that we write composition in diagrammatic form: (f ◦ g)(x) = g(f (x)) Some (misguided) texts use the opposite convention. Basis Problem: Find a small and/or simple set of permutations so that all permutations can be written as a product of these. Decomposition Problem: Given such a basis B, find a way to decompose a given permutations into a product of permutations in B. Transpositions 155 Definition A transposition is a permutation that consists of a single 2-cycle. In cycle notation, transpositions are exactly the permutations of the form (a, b) for a 6= b. Example Consider the following transpositions over [3], given in cycle notation. (1, 2) ◦ (2, 3) = (3, 1, 2) (2, 3) ◦ (1, 2) = (2, 3, 1) Thus, composition of permutations is not commutative (it is associative, though, since composition of functions is so associative). In Pictures 156 3 3 3 3 2 2 2 2 1 1 1 1 (1, 2) ◦ (2, 3) = (3, 1, 2) (2, 3) ◦ (1, 2) = (2, 3, 1) Basis Theorem 157 Lemma Every permutation can be written as a product of transpositions. Proof. (sketch) Since every permutation is composed of disjoint cycles, it suffices to show that every cycle (a1 , . . . , am ) is a product of transpositions. Show this by induction on m ≥ 2. The crucial step is (am , b) ◦ (a1 , . . . , am ) = (a1 , a2 , . . . , am−1 , am , b) 2 Exercise Fill in all the gaps in this argument. Exercise Find a direct decomposition (a1 , b1 ) ◦ (a2 , b2 ) ◦ . . . ◦ (am , bm ) = (c1 , c2 , . . . , cm , cm+1 ). In Pictures 158 For a simple cycle this is easy to see in the composition picture. 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 Another Easy Case 159 Here is another simple decomposition of a cycle intro transpositions. 5 5 4 4 3 3 2 2 1 1 So (1, 2)(2, 3)(3, 4)(4, 5) = (5, 4, 3, 2, 1). More Pictures 160 A more complicated permutation on n = 12, and its decomposition into transpositions. 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 Exercise Find an algorithm to generate the picture on the right. 12 11 10 9 8 7 6 5 4 3 2 1 More Identities 161 For the next proposition, we abuse notation and use exponents for permutations given in cycle notation. Proposition (a, b) ◦ (b, c) ◦ (a, b) = (a, c) i (1, . . . , n) ◦ (1, 2) ◦ (n, . . . , 1)i = (i + 1, i + 2) where 0 ≤ i ≤ n − 2. Exercise Prove these identities. Even and Odd Permutations Needless to say, the decomposition into transpositions is not unique. Definition A permutation is even if it can be written as the product of on even number of transpositions, and odd if it can be written as the product of on odd number of transpositions. Note the cautious wording: this does not say that every permutation is either even or odd. It leaves open the possibility that some permutation could be both even and odd. However, one can show that any permutation is either even or odd, never both. Lemma No permutation is even and odd. 162 Proof Sketch Proof. 163 Let σ be a permutation of [n]. Consider the polynomials Y P (x1 , . . . , xn ) = xi − xj i<j Pσ (x1 , . . . , xn ) = Y xσ(i) − xσ(j) i<j Then necessarily P = ±Pσ . One can show that P = +Pσ iff σ is even, and P = −Pσ iff σ is odd. 2 Note that σ is operating on the variables here. Exercise Fill in the details of this argument. Alternating Groups The composition of even permutations is again even, so we can assemble them into a new group. Definition The collection of all even permutations of A, an n-element set, is the alternating group on n points. Notation: An ⊆ Sn . As we will see, An is indeed a subgroup of Sn and has size n!/2. Part of the importance of alternating groups comes from the fact that for n ≥ 5 each alternating group An is simple: it has only trivial normal subgroups. 164 The Sign Homomorphism 165 Here is another look at the even-or-odd argument. One way to explain (and make precise) what is going on there is to consider the sign function from the group of all permutations sg : Sn → {+1, −1} sg(σ) = Pσ (x)/P (x) where the operation on the right is ordinary multiplication. It is not hard to see that sg is a homomorphism and the kernel of sg is exactly the collection of all even permutations. In other words, An is the kernel of the homomorphism sg. Computing the Inverse 166 Definition The order of a permutation f is the least m > 0 such that f m = I. Lemma Let the cycles of permutation f have lengths l1 , . . . , lk and let m be the LCM of l1 , . . . , lk . Then m is the order of f . This has the consequence that f −1 = f m−1 . Hence we can compute the inverse by iteration when the carrier set is finite. Of course, this does not work in the infinite case. Needless to say, no one would compute the inverse this way. Really Computing the Inverse Note that computing m and iterating f to get f m−1 is not a very good idea. Here is a computationally better way to get at the inverse. Define g by g(f (i)) = i for i = 1, . . . , n. Then g ◦ f = f ◦ g = I and thus g = f −1 . This takes linear time. Here is another way: sort the list of pairs (f (1), 1), (f (2), 2), . . . , (f (n), n) in the usual lexicographic order. Then throw away the first components. The resulting permutation is f −1 . Exercise Explain how the last method works. What is the running time? 167