OKlibrary  0.2.1.6
SymmetricGroups.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 11.8.2012 (Swansea) */
00002 /* Copyright 2012 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac")\$
00023 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/BasicNotions.mac")\$
00024 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/Groups/SymmetricGroups.mac")\$
00025 oklib_include("OKlib/ComputerAlgebra/Algebra/Lisp/Groupoids/InvertibleElements.mac")\$
00026 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/SetSystems.mac")\$
00027
00028
00029 kill(f)\$
00030
00031
00032 /* **************************
00033    * Permutations as lists *
00034    **************************
00035 */
00036
00037 okltest_sym_l_ugrpi(f) := (
00038   assert(f(0) = [{[]},transformation_l_compo, [], permutation_l_inv(0)]),
00039   for n : 1 thru cokltl(3,4,5) do block([S : f(n)],
00040     assert(ugrpi_p(S) = true),
00041     assert(ugrpi2ugrp(S) = sym_l_ugrp(n))
00042   ),
00043   true)\$
00044
00045 okltest_sym_l_ougrp(f) := (
00046   assert(f(0) = [[[]],transformation_l_compo, []]),
00047   for n : 1 thru cokltl(3,4,5) do block([S : f(n)],
00048     assert(ougrp_p(S) = true),
00049     assert(ougrp2ugrp(S) = sym_l_ugrp(n))
00050   ),
00051   true)\$
00052
00053
00054 /* **********************
00055    * Cycle presentation *
00056    **********************
00057 */
00058
00059
00060 /* ********************
00061    * Basic operations *
00062    ********************
00063 */
00064
00065 okltest_inversion_vector_perl(f) := (
00066   assert(f([]) = []),
00067   assert(f([1]) = [0]),
00068   assert(f([1,2]) = [0,0]),
00069   assert(f([2,1]) = [1,0]),
00070   assert(f([4,6,2,5,3,1,8,7]) = [3,4,1,2,1,0,1,0]),
00071   true)\$
00072
00073 okltest_perl_inversion_vector(f) := (
00074   assert(f([]) = []),
00075   assert(f([0]) = [1]),
00076   for n : 0 thru cokltl(4,7) do
00077     for p in permutations(setn(n)) do
00078       assert(f(inversion_vector_perl(p)) = p),
00079   true)\$
00080
00081 okltest_numinvolutions_symgrp(f) := (
00082   assert(f(0) = 1),
00083   assert(f(1) = 1).
00084   assert(f(10) = 9496),
00085   for n : 0 thru cokltl(4,6) do
00086     assert(f(n) = 1 + length(involutions_ugrd(sym_l_ugrp(n)))),
00087   true)\$
00088
```