Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing tests and doc for IsSelfDualSemigroup and friends #892

Merged
merged 3 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions doc/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1194,3 +1194,36 @@ false]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="IsSelfDualSemigroup">
<ManSection>
<Prop Name="IsSelfDualSemigroup" Arg="S"/>
<Returns><K>true</K> or <K>false</K>.</Returns>
<Description>
Returns <K>true</K> if the semigroup <A>S</A> is self dual and
<K>false</K> otherwise.
<P/>

A semigroup is <E>self dual</E> if it is isomorphic to its dual,
that is, the semigroup <C>T</C> with multiplication <C>*</C> defined
by <C>x*y=yx</C> where <C>yx</C> denotes the product in <A>S</A>.

<Example><![CDATA[
gap> F := FreeSemigroup("a", "b");
<free semigroup on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, a], [b ^ 2, b], [(a * b) ^ 2, a]];
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, a ] ]
gap> S := F / R;
<fp semigroup with 2 generators and 3 relations of length 14>
gap> IsSelfDualSemigroup(S);
false
gap> IsSelfDualSemigroup(FreeBand(3));
true
gap> S := DualSymmetricInverseMonoid(3);
<inverse block bijection monoid of degree 3 with 3 generators>
gap> IsSelfDualSemigroup(S);
true]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
36 changes: 36 additions & 0 deletions doc/semifp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,40 @@ true]]></Example>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="AntiIsomorphismDualFpSemigroup">
<ManSection>
<Attr Name="AntiIsomorphismDualFpSemigroup" Arg="S"/>
<Attr Name="AntiIsomorphismDualFpMonoid" Arg="S"/>
<Returns>A finitely presented semigroup or monoid.</Returns>
<Description>
<C>AntiIsomorphismDualFpSemigroup</C> returns an anti-isomorphism (<Ref
Func="MappingByFunction" BookName="ref"/>) from the
finitely presented semigroup <A>S</A> to another finitely presented
semigroup. The range finitely presented semigroup is obtained from <A>S</A>
by reversing the relations of <A>S</A>.<P/>

<C>AntiIsomorphismDualFpMonoid</C> works analogously when <A>S</A> is a
finitely presented monoid, and the range of the returned anti-isomorphism
is a finitely presented monoid.

<Example><![CDATA[
gap> F := FreeSemigroup("a", "b");
<free semigroup on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, a], [b ^ 2, b], [(a * b) ^ 2, a]];
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, a ] ]
gap> S := F / R;
<fp semigroup with 2 generators and 3 relations of length 14>
gap> map := AntiIsomorphismDualFpSemigroup(S);
MappingByFunction( <fp semigroup with 2 generators and
3 relations of length 14>, <fp semigroup with 2 generators and
3 relations of length 14>
, function( x ) ... end, function( x ) ... end )
gap> RelationsOfFpSemigroup(Range(map));
[ [ a^3, a ], [ b^2, b ], [ (b*a)^2, a ] ]
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>


1 change: 1 addition & 0 deletions doc/z-chap06.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ gap> AsSemigroup(IsPBRSemigroup, M);
<#Include Label = "RZMSNormalization">
<#Include Label = "RMSNormalization">
<#Include Label = "IsomorphismReesZeroMatrixSemigroup">
<#Include Label = "AntiIsomorphismDualFpSemigroup">

</Section>

Expand Down
2 changes: 1 addition & 1 deletion doc/z-chap12.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<#Include Label = "IsZeroRectangularBand">
<#Include Label = "IsZeroSemigroup">
<#Include Label = "IsZeroSimpleSemigroup">

<#Include Label = "IsSelfDualSemigroup">
</Section>

<Section>
Expand Down
2 changes: 1 addition & 1 deletion gap/attributes/properties.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DeclareOperation("IsNormalInverseSubsemigroup",
[IsInverseSemigroup, IsInverseSemigroup]);

if not IsBoundGlobal("IsSelfDualSemigroup") then
DeclareProperty("IsSelfDualSemigroup", IsSemigroup);
DeclareProperty("IsSelfDualSemigroup", IsSemigroup and CanUseFroidurePin);
fi;

DeclareSynonymAttr("IsRectangularGroup",
Expand Down
6 changes: 6 additions & 0 deletions gap/attributes/properties.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,12 @@ InstallMethod(IsSelfDualSemigroup,
[IsSemigroup and CanUseFroidurePin],
function(S)
local T, map;
if IsCommutativeSemigroup(S) then # TODO(later) any more?
return true;
elif NrRClasses(S) <> NrLClasses(S) then
return false;
fi;

T := AsSemigroup(IsFpSemigroup, S);
map := AntiIsomorphismDualFpSemigroup(T);
return SemigroupIsomorphismByImages(T,
Expand Down
19 changes: 19 additions & 0 deletions tst/standard/attributes/properties.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,25 @@ gap> IsNormalInverseSubsemigroup(G,
> InverseSemigroup(G.1, rec(acting := true)));
false

# IsSelfDualSemigroup
gap> F := FreeSemigroup("a", "b");
<free semigroup on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, a], [b ^ 2, b], [(a * b) ^ 2, a]];
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, a ] ]
gap> S := F / R;
<fp semigroup with 2 generators and 3 relations of length 14>
gap> IsSelfDualSemigroup(S);
false
gap> IsSelfDualSemigroup(FreeBand(3));
true
gap> S := DualSymmetricInverseMonoid(3);
<inverse block bijection monoid of degree 3 with 3 generators>
gap> IsSelfDualSemigroup(S);
true
gap> IsSelfDualSemigroup(MonogenicSemigroup(7, 8));
true

# SEMIGROUPS_UnbindVariables
gap> Unbind(D);
gap> Unbind(I);
Expand Down
64 changes: 64 additions & 0 deletions tst/standard/semigroups/semifp.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,70 @@ gap> w := Factorization(F, One(F));
gap> EvaluateWord(GeneratorsOfSemigroup(F), w) = One(F);
true

# Reversed for elements of a fp semigroup/monoid
gap> F := FreeSemigroup("a", "b");
<free semigroup on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, a], [b ^ 2, b], [(a * b) ^ 2, a]];
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, a ] ]
gap> S := F / R;
<fp semigroup with 2 generators and 3 relations of length 14>
gap> Reversed(a * b * b);
b^2*a
gap> Reversed(a * b * b * a);
a*b^2*a
gap> Reversed(a * b * b) = b * b * a;
true
gap> Reversed(a * b * b * a) = a * b * b * a;
true
gap> F := FreeMonoid("a", "b");
<free monoid on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := ParseRelations([a, b], "a ^ 3=a, b ^ 2= b, (ab) ^ 2= 1");
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, <identity ...> ] ]
gap> S := F / R;
<fp monoid with 2 generators and 3 relations of length 13>
gap> Reversed(a * b * b) = b * b * a;
true
gap> Reversed(a * b * b * a) = a * b * b * a;
true
gap> Reversed(a * b * b);
b^2*a
gap> Reversed(a * b * b * a);
a*b^2*a
gap> Reversed(One(S));
<identity ...>

# AntiIsomorphismDualFpMonoid/Semigroup
gap> F := FreeSemigroup("a", "b");
<free semigroup on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, a], [b ^ 2, b], [(a * b) ^ 2, a]];
[ [ a^3, a ], [ b^2, b ], [ (a*b)^2, a ] ]
gap> S := F / R;
<fp semigroup with 2 generators and 3 relations of length 14>
gap> map := AntiIsomorphismDualFpSemigroup(S);
MappingByFunction( <fp semigroup with 2 generators and
3 relations of length 14>, <fp semigroup with 2 generators and
3 relations of length 14>, function( x ) ... end, function( x ) ... end )
gap> RelationsOfFpSemigroup(Range(map));
[ [ a^3, a ], [ b^2, b ], [ (b*a)^2, a ] ]
gap> F := FreeMonoid("a", "b");
<free monoid on the generators [ a, b ]>
gap> AssignGeneratorVariables(F);
gap> R := [[a ^ 3, One(F)], [b ^ 2, One(F)], [(a * b) ^ 2, One(F)]];
[ [ a^3, <identity ...> ], [ b^2, <identity ...> ],
[ (a*b)^2, <identity ...> ] ]
gap> S := F / R;
<fp monoid with 2 generators and 3 relations of length 11>
gap> map := AntiIsomorphismDualFpMonoid(S);
MappingByFunction( <fp monoid with 2 generators and 3 relations of length 11>
, <fp monoid with 2 generators and 3 relations of length 11>
, function( x ) ... end, function( x ) ... end )
gap> RelationsOfFpMonoid(Range(map));
[ [ a^3, <identity ...> ], [ b^2, <identity ...> ],
[ (b*a)^2, <identity ...> ] ]

# SEMIGROUPS_UnbindVariables
gap> Unbind(a);
gap> Unbind(b);
Expand Down