OKlibrary  0.2.1.6
Commutativity.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 8.7.2008 (Swansea) */
00002 /* Copyright 2008, 2009 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/DataStructures/Lisp/Lists.mac")\$
00023
00024
00025 /* *********
00026    * Tests *
00027    *********
00028 */
00029
00030 /* Testing whether a groupoid is commutative, just using the definition: */
00031 commutative_bydef_grd(V) := block([counterexample : false],
00032  for x in V[1] unless counterexample do
00033   for y in V[1] unless counterexample do
00034    if V[2](x,y) # V[2](y,x) then counterexample : true,
00035  return(not counterexample))\$
00036
00037
00038 /* ********************
00039    * Central elements *
00040    ********************
00041 */
00042
00043 /* Tests whether a is element of the centraliser of X w.r.t. composition
00044    compo: */
00045 central_grd_p(a,X,compo) := every_s(lambda([x],is(compo(a,x)=compo(x,a))),X)\$
00046
00047 /* Centraliser and bicentraliser: */
00048 centraliser_grd(X,V) := subset(V[1], lambda([a], central_grd_p(a,X,V[2])))\$
00049 bicentraliser_grd(X,V) := centraliser_grd(centraliser_grd(X,V),V)\$
00050
00051 /* The centre of a groupoid: */
00052 centre_grd(V) := centraliser_grd(V[1],V)\$
00053 /* We have commutative_bydef_grd(V) = is(centre_grd(V)=V[1]). */
00054
```