Skip to content

Commit

Permalink
feat: IsLeftRightAlternative method
Browse files Browse the repository at this point in the history
  • Loading branch information
limakzi committed Sep 5, 2024
1 parent f21bc56 commit 910b2ef
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/properties.gd
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,22 @@ DeclareProperty( "IsLeftFPFInducted", IsMagma );
#! @EndExampleSession
#!
#!
DeclareProperty( "IsRightFPFInducted", IsMagma );
DeclareProperty( "IsRightFPFInducted", IsMagma );

#! @Arguments M
#! @Description
#! is a left-alternatve magma <A>M</A>.
#!
#! @BeginExampleSession
#! @EndExampleSession
#!
DeclareProperty( "IsLeftAlternative", IsMagma );

#! @Arguments M
#! @Description
#! is a right-alternatve magma <A>M</A>.
#!
#! @BeginExampleSession
#! @EndExampleSession
#!
DeclareProperty( "IsRightAlternative", IsMagma );
10 changes: 10 additions & 0 deletions lib/properties.gi
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,14 @@ end);
InstallMethod(IsRightFPFInducted, "for a magma", [IsMagma],
function(M)
return ForAll(M, m -> Size( Unique( Elements(M) * m ) ) = 1 and First( Unique( Elements(M) * m ) ) <> m);
end);

InstallMethod(IsLeftAlternative, "for a magma", [IsMagma],
function(M)
return ForAll(EnumeratorOfTuples(M, 2), c -> c[1] * ( c[1] * c[2] ) = ( c[1] * c[1] ) * c[2] );
end);

InstallMethod(IsRightAlternative, "for a magma", [IsMagma],
function(M)
return ForAll(EnumeratorOfTuples(M, 2), c -> c[1] * ( c[2] * c[2] ) = ( c[1] * c[2] ) * c[2] );
end);
9 changes: 9 additions & 0 deletions tst/test_properties_magma_isleftrightalternative.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
gap> START_TEST( "test_properties_magma_isleftrightalternative.tst" );

gap> ForAny(AllSmallAntimagmas([2 .. 3]), M -> IsLeftAlternative(M) );
false

gap> ForAny(AllSmallAntimagmas([2 .. 3]), M -> IsRightAlternative(M) );
false

gap> STOP_TEST( "test_properties_magma_isleftrightalternative.tst" );

0 comments on commit 910b2ef

Please sign in to comment.