Skip to content

Commit 8becc41

Browse files
acting: add OnePseudoInverseOfSemigroupElement for more types
1 parent b83e727 commit 8becc41

File tree

6 files changed

+140
-12
lines changed

6 files changed

+140
-12
lines changed

doc/attr.xml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,13 +1207,19 @@ gap> GeneratorsSmallest(T);
12071207

12081208
<#GAPDoc Label="OneInverseOfSemigroupElement">
12091209
<ManSection>
1210-
<Attr Name="OneInverseOfSemigroupElement" Arg="S, x"/>
1211-
<Returns> One inverse of an element of a semigroup.</Returns>
1210+
<Oper Name="OneInverseOfSemigroupElement" Arg="S, x"/>
1211+
<Returns> One inverse of an element of a semigroup or <K>fail</K>.</Returns>
12121212
<Description>
12131213
<C>OneInverseOfSemigroupElement</C> returns one inverse of the element
1214-
<C>x</C> in the semigroup <A>S</A> and returns fail if this
1215-
element has no inverse in <A>S</A>.
1216-
<A>x</A> in the semigroup <A>S</A>.
1214+
<C>x</C> in the semigroup <A>S</A> and returns <K>fail</K> if this
1215+
element has no inverse in <A>S</A>.<P/>
1216+
1217+
An <E>inverse</E> of an element <A>x</A> in a semigroup <A>S</A> is an
1218+
element <C>y</C> of <A>S</A> such that <C><A>x</A> * y * <A>x</A> =
1219+
<A>x</A></C> and <C>y * <A>x</A> * y = <A>y</A></C>.
1220+
1221+
See also <Ref Oper="OnePseudoInverseOfSemigroupElement"/>.
1222+
12171223
<Example><![CDATA[
12181224
gap> S := FullTransformationMonoid(4);
12191225
<full transformation monoid of degree 4>
@@ -1233,6 +1239,70 @@ Error, the semigroup is not finite]]></Example>
12331239
</ManSection>
12341240
<#/GAPDoc>
12351241

1242+
<#GAPDoc Label="OnePseudoInverseOfSemigroupElement">
1243+
<ManSection>
1244+
<Oper Name="OnePseudoInverseOfSemigroupElement" Arg="x"/>
1245+
<Returns> One pseudo-inverse of an element of a semigroup.</Returns>
1246+
<Description>
1247+
<C>OnePseudoInverseOfSemigroupElement</C> returns one pseudo-inverse of the
1248+
element <A>x</A>. This is an element of the same type as <A>x</A> belonging
1249+
to some semigroup or monoid containing <A>x</A>.
1250+
<P/>
1251+
1252+
An <E>pseudo-inverse</E> of an element <A>x</A> is an element <C>y</C> such
1253+
that <C><A>x</A> * y * <A>x</A> = <A>x</A></C>.
1254+
<P/>
1255+
1256+
Methods are installed for this operation for the following types of elements:
1257+
<List>
1258+
<Mark>transformations</Mark>
1259+
<Item>
1260+
<Ref Prop="IsTransformation" BookName="ref"/>;
1261+
</Item>
1262+
<Mark>partial perms</Mark>
1263+
<Item>
1264+
<Ref Prop="IsPartialPerm" BookName="ref"/>;
1265+
</Item>
1266+
<Mark>bipartitions</Mark>
1267+
<Item>
1268+
<Ref Prop="IsBipartition"/>;
1269+
</Item>
1270+
<Mark>matrices over finite fields</Mark>
1271+
<Item>
1272+
&GAP; matrices with entries in a finite field;
1273+
</Item>
1274+
<Mark>elements of McAlister triple semigroups</Mark>
1275+
<Item>
1276+
<Ref Prop="IsMcAlisterTripleSemigroupElement"/>;
1277+
</Item>
1278+
<Mark>elements of regular Rees 0-matrix semigroups over groups</Mark>
1279+
<Item>
1280+
<Ref Prop="IsReesZeroMatrixSemigroupElement" BookName="ref"/>.
1281+
</Item>
1282+
</List>
1283+
1284+
See also <Ref Oper="OneInverseOfSemigroupElement"/>.
1285+
1286+
<Example><![CDATA[
1287+
gap> s := Transformation([2, 3, 1, 1]);
1288+
Transformation( [ 2, 3, 1, 1 ] )
1289+
gap> OnePseudoInverseOfSemigroupElement(s);
1290+
Transformation( [ 3, 1, 2, 1 ] )
1291+
gap> e := IdentityTransformation;
1292+
IdentityTransformation
1293+
gap> OnePseudoInverseOfSemigroupElement(e);
1294+
IdentityTransformation
1295+
gap> F := FreeSemigroup(1);
1296+
<free semigroup on the generators [ s1 ]>
1297+
gap> OnePseudoInverseOfSemigroupElement(F, F.1);
1298+
Error, no method found! For debugging hints type ?Recovery from NoMeth\
1299+
odFound
1300+
Error, no 1st choice method found for `OnePseudoInverseOfSemigroupElem\
1301+
ent' on 2 arguments]]></Example>
1302+
</Description>
1303+
</ManSection>
1304+
<#/GAPDoc>
1305+
12361306
<#GAPDoc Label="IndecomposableElements">
12371307
<ManSection>
12381308
<Attr Name="IndecomposableElements" Arg="S"/>

doc/maxplusmat.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<ManSection Label = "IsXMatrix">
1313
<Heading>Matrix filters</Heading>
1414
<Filt Name = "IsBooleanMat" Arg = "obj" Type = "Category"/>
15-
<Filt Name = "IsMatrixOverFiniteField" Arg = "obj" Type = "Category"/>
1615
<Filt Name = "IsMaxPlusMatrix" Arg = "obj" Type = "Category"/>
1716
<Filt Name = "IsMinPlusMatrix" Arg = "obj" Type = "Category"/>
1817
<Filt Name = "IsTropicalMatrix" Arg = "obj" Type = "Category"/>

doc/z-chap11.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
Operations for elements in a semigroup
6565
</Heading>
6666
<#Include Label = "OneInverseOfSemigroupElement">
67+
<#Include Label = "OnePseudoInverseOfSemigroupElement">
6768
</Section>
6869

6970
<!--**********************************************************************-->

gap/greens/acting.gi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,8 @@ function(S, a, b)
17491749
p := LambdaPerm(S)(result * a, b);
17501750
# Apply the inverse of the bijection \Psi in Proposition 3.11 of the Citrus
17511751
# paper, to convert p from acting on the right to action on the left
1752-
return result * StabilizerAction(S)(a, p) * WeakInverse(a);
1752+
return result * StabilizerAction(S)(a, p)
1753+
* OnePseudoInverseOfSemigroupElement(a);
17531754
end);
17541755

17551756
InstallMethod(RightGreensMultiplierNC,
@@ -1771,7 +1772,8 @@ function(S, a, b)
17711772
# At this point StabilizerAction(a * result, LambdaPerm(S)(a * result, b)) =
17721773
# b.
17731774
p := LambdaPerm(S)(a * result, b);
1774-
return WeakInverse(a) * StabilizerAction(S)(a * result, p);
1775+
return OnePseudoInverseOfSemigroupElement(a)
1776+
* StabilizerAction(S)(a * result, p);
17751777
end);
17761778

17771779
#############################################################################

gap/main/setup.gd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ DeclareOperation("ConvertToInternalElement",
5858
[IsSemigroup, IsMultiplicativeElement]);
5959
DeclareOperation("ConvertToExternalElement",
6060
[IsSemigroup, IsMultiplicativeElement]);
61-
DeclareOperation("WeakInverse", [IsMultiplicativeElement]);
61+
62+
DeclareOperation("OnePseudoInverseOfSemigroupElement",
63+
[IsMultiplicativeElement]);
64+
DeclareOperation("OnePseudoInverseOfSemigroupElementNC",
65+
[IsMultiplicativeElement]);

gap/main/setup.gi

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,11 +1084,63 @@ function(S, mat)
10841084
return Matrix(Unpack(mat){[1 .. n]}{[1 .. n]}, mat);
10851085
end);
10861086

1087-
InstallMethod(WeakInverse, "for a transformation",
1087+
InstallMethod(OnePseudoInverseOfSemigroupElement,
1088+
"for a multiplicative element",
1089+
[IsMultiplicativeElement], OnePseudoInverseOfSemigroupElementNC);
1090+
1091+
InstallMethod(OnePseudoInverseOfSemigroupElementNC, "for a transformation",
10881092
[IsTransformation], InverseOfTransformation);
10891093

1090-
InstallMethod(WeakInverse, "for a partial perm",
1094+
InstallMethod(OnePseudoInverseOfSemigroupElementNC, "for a partial perm",
10911095
[IsPartialPerm], InverseMutable);
10921096

1093-
InstallMethod(WeakInverse, "for a bipartition",
1097+
InstallMethod(OnePseudoInverseOfSemigroupElementNC, "for a bipartition",
10941098
[IsBipartition], Star);
1099+
1100+
InstallMethod(OnePseudoInverseOfSemigroupElementNC, "for a matrix over ff",
1101+
[IsMatrixObjOverFiniteField], RightInverse);
1102+
1103+
InstallMethod(OnePseudoInverseOfSemigroupElementNC,
1104+
"for a McAlister triple semigroup element",
1105+
[IsMcAlisterTripleSemigroupElement], INV);
1106+
1107+
InstallMethod(OnePseudoInverseOfSemigroupElement,
1108+
"for a Rees 0-matrix semigroup",
1109+
[IsReesZeroMatrixSemigroupElement],
1110+
function(x)
1111+
local R;
1112+
1113+
R := ReesMatrixSemigroupOfFamily(FamilyObj(x));
1114+
if not IsRegularSemigroup(R) then
1115+
ErrorNoReturn("the parent semigroup of the 1st argument ",
1116+
"(an element of a Rees 0-matrix semigroup) ",
1117+
"is not regular");
1118+
elif not IsGroup(UnderlyingSemigroup(R)) then
1119+
ErrorNoReturn("the underlying semigroup of the parent semigroup of ",
1120+
"the 1st argument (an element of a Rees 0-matrix ",
1121+
"semigroup) is not a group");
1122+
fi;
1123+
return OnePseudoInverseOfSemigroupElementNC(x);
1124+
1125+
end);
1126+
1127+
InstallMethod(OnePseudoInverseOfSemigroupElementNC,
1128+
"for a Rees 0-matrix semigroup",
1129+
[IsReesZeroMatrixSemigroupElement],
1130+
function(x)
1131+
local R, mat, i, j, k, l;
1132+
1133+
R := ReesMatrixSemigroupOfFamily(FamilyObj(x));
1134+
if IsMultiplicativeZero(R, x) then
1135+
return x;
1136+
fi;
1137+
1138+
mat := Matrix(R);
1139+
i := x[1];
1140+
j := x[3];
1141+
1142+
k := First(Rows(R), k -> mat[j][k] <> 0);
1143+
l := First(Columns(R), l -> mat[l][i] <> 0);
1144+
1145+
return RMSElement(R, k, mat[j][k] ^ -1 * x[2] ^ -1 * mat[l][i] ^ -1, l);
1146+
end);

0 commit comments

Comments
 (0)