Saturday, January 23, 2016

More about subgroups

[Attention, this code is not included in the code site!]

My first try to compute the set of subgroups of a group was to compute the set of subsets and test which subsets that was groups. But Sym(4), the group of all permutations of 1234, has 16777216 subsets. My next thought was to divide the set of subsets P(S) into subsets of equal cardinality P(S,k). This works for small k but


Not very efficient thinking nor code so far! But even a blind dog can follow a track and I think that following algorithm is correct and "efficient":
  1. set Subs={{123..}}, the set of the set of the identity
  2. for each x in S include x in all sets in a copy of Subs and compute the set of subgroups generated by the sets in the copy
  3. set Subs=Subs+copy (union)
Repetition of some set words and group words.
  • fence ( x -- {x} ) and x could be an integer or a set
  • nfence ( s -- s') any object in s' is a fenced object of s
  • incl ( s x -- su{x}) the object x is included to s
  • nincl ( s x -- s') the elements in s' is the sets that are elements of s where x is included
  • generate ( s -- s') s' is the group generated by the permutations in s
A set on the stack is represented by a negative-counted bundle on the stack and the count specifies the number of integers in the bundle. A semiotic word foreach prepares for processing of the elements in a do-loop:

: foreach ( s -- x1...xn n 0 )
  ndup               \ s s  duplicates the bundle
  card               \ s n  computes n=|s|
  nip 0 ;            \ drop the bundle count and prepare for do loop
: ngenerate ( s -- s')
  0 >>yst            \ empty set on yst stack
  foreach            \ for each element in the set s
  do generate        \ the sets in s generates cyclic groups
     fence           \ fence the group
     yst>> union >>yst
  loop yst>> ;

Here s' is the set of groups generated by the sets of permutations that are elements of s.

And now finally the set of all subgroups

: psubs ( s -- s')
  over numb identity fence fence >>yst  \ {{123...}} pushed to yst
  do >r yst>> ndup r> nincl ngenerate union >>yst
  loop yst>> ;

4 sym psubs cr set. 


The normal subgroups:

: pnsubs ( s -- s')
  ndup >>xst
  0 >>yst
  psubs foreach
  do ndup nxst@ pnormal
     if fence yst>> union >>yst else ndrop then
  loop nxstdrop yst>> ;

4 sym pnsubs cr set.
{{1234},{3412,4321,2143,1234},{3412,4213,1423,1342,2314,2431,3241,4321,3124,4132,2143,1234},{4123,2134,3412,4213,1423,2341,3421,3142,4312,2413,1342,2314,2431,3241,4321,4231,1243,1324,1432,3214,3124,4132,2143,1234}} ok

Some reflections and facts:
Any finite group is isomorphic to a subgroup of Sym(n) for some n. For all n>2, Sym(n) can be generated by two permutations. A consequence of the Structure Theorem for Abelian Groups, (a group where ab=ba for all a and b in the group) is that for any positive number m there is an Abelian group that can be generated by m but not by m-1 elements. So for n big enough, Sym(n) can be generated by 2 elements, but has subgroups needing m>2 generators.

No comments:

Post a Comment