OKlibrary  0.2.1.6
NeutralElements.mac
Go to the documentation of this file.
```00001 /* Oliver Kullmann, 7.7.2008 (Swansea) */
00002 /* Copyright 2008 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 /* Check whether e is left-neutral for groupoid V: */
00025 leftneutral_el_grd(V,e) := every_s(lambda([x],is(V[2](e,x)=x)), V[1])\$
00026 /* Check whether e is right-neutral for groupoid V: */
00027 rightneutral_el_grd(V,e) := every_s(lambda([x],is(V[2](x,e)=x)), V[1])\$
00028 /* Check whether e is neutral for groupoid V: */
00029 neutral_el_grd(V,e) := leftneutral_el_grd(V,e) and rightneutral_el_grd(V,e)\$
00030 /* Remarks:
00031  - The above tests do not check whether elementp(e,V[1]) is true.
00032 */
00033
00034 /* Check whether groupoid V has a left-neutral element: */
00035 has_leftneutral_el_grd(V) := some_s(lambda([x],leftneutral_el_grd(V,x)), V[1])\$
00036 /* Check whether groupoid V has a right-neutral element: */
00037 has_rightneutral_el_grd(V) := some_s(lambda([x],rightneutral_el_grd(V,x)), V[1])\$
00038 /* Check whether groupoid V has a neutral element: */
00039 has_neutral_el_grd(V) := some_s(lambda([x],neutral_el_grd(V,x)), V[1])\$
00040
00041
```