Skip to content

Commit

Permalink
conglatt: perf improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Apr 20, 2022
1 parent 8d922a1 commit 584bc0c
Show file tree
Hide file tree
Showing 56 changed files with 3,615 additions and 2,452 deletions.
94 changes: 48 additions & 46 deletions doc/cong.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,47 +204,49 @@ gap> RightSemigroupCongruence(S, pair1, pair2);
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="GeneratingPairsOfSemigroupCongruence">
<ManSection>
<!--
<#GAPDoc Label="GeneratingPairsOfSemigroupCongruence">
<ManSection>
<Attr Name = "GeneratingPairsOfSemigroupCongruence" Arg = "cong"/>
<Attr Name = "GeneratingPairsOfLeftSemigroupCongruence" Arg = "cong"/>
<Attr Name = "GeneratingPairsOfRightSemigroupCongruence" Arg = "cong"/>
<Returns>A list of lists.</Returns>
<Description>
If <A>cong</A> is a semigroup congruence, then
<C>GeneratingPairsOfSemigroupCongruence</C> returns a list of pairs of
elements from <C>Range(<A>cong</A>)</C> that <E>generates</E> the
congruence; i.e. <A>cong</A> is the least congruence on the semigroup
which contains all the pairs in the list. <P/>

If <A>cong</A> is a left or right semigroup congruence, then
<C>GeneratingPairsOfLeft/RightSemigroupCongruence</C> will instead give a
list of pairs which generate it as a left or right congruence. Note that,
although a congruence is also a left and right congruence, its generating
pairs as a left or right congruence may differ from its generating pairs
as a two-sided congruence. <P/>

A congruence can be defined using a set of generating pairs: see
<Ref Func = "SemigroupCongruence"/>,
<Ref Func = "LeftSemigroupCongruence"/>, and
<Ref Func = "RightSemigroupCongruence"/>. <P/>
If <A>cong</A> is a semigroup congruence, then
<C>GeneratingPairsOfSemigroupCongruence</C> returns a list of pairs of
elements from <C>Range(<A>cong</A>)</C> that <E>generates</E> the
congruence; i.e. <A>cong</A> is the least congruence on the semigroup
which contains all the pairs in the list. <P/>
If <A>cong</A> is a left or right semigroup congruence, then
<C>GeneratingPairsOfLeft/RightSemigroupCongruence</C> will instead give a
list of pairs which generate it as a left or right congruence. Note that,
although a congruence is also a left and right congruence, its generating
pairs as a left or right congruence may differ from its generating pairs
as a two-sided congruence. <P/>
A congruence can be defined using a set of generating pairs: see
<Ref Func = "SemigroupCongruence"/>,
<Ref Func = "LeftSemigroupCongruence"/>, and
<Ref Func = "RightSemigroupCongruence"/>. <P/>
<Example><![CDATA[
gap> S := Semigroup([Transformation([3, 3, 2, 3]),
> Transformation([3, 4, 4, 1])]);;
gap> pairs :=
> [[Transformation([1, 1, 1, 1]), Transformation([2, 2, 2, 3])],
> [Transformation([2, 2, 3, 2]), Transformation([3, 3, 2, 3])]];;
gap> cong := SemigroupCongruence(S, pairs);;
gap> GeneratingPairsOfSemigroupCongruence(cong);
[ [ Transformation( [ 1, 1, 1, 1 ] ),
Transformation( [ 2, 2, 2, 3 ] ) ],
[ Transformation( [ 2, 2, 3, 2 ] ),
Transformation( [ 3, 3, 2, 3 ] ) ] ]
]]></Example>
<Example><![CDATA[
gap> S := Semigroup([Transformation([3, 3, 2, 3]),
> Transformation([3, 4, 4, 1])]);;
gap> pairs :=
> [[Transformation([1, 1, 1, 1]), Transformation([2, 2, 2, 3])],
> [Transformation([2, 2, 3, 2]), Transformation([3, 3, 2, 3])]];;
gap> cong := SemigroupCongruence(S, pairs);;
gap> GeneratingPairsOfSemigroupCongruence(cong);
[ [ Transformation( [ 1, 1, 1, 1 ] ),
Transformation( [ 2, 2, 2, 3 ] ) ],
[ Transformation( [ 2, 2, 3, 2 ] ),
Transformation( [ 3, 3, 2, 3 ] ) ] ]
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
</ManSection>
<#/GAPDoc>
-->

<#GAPDoc Label="CongruencesOfSemigroup">
<ManSection>
Expand Down Expand Up @@ -331,7 +333,7 @@ gap> congs[pos];
gap> S := Semigroup(Transformation([1, 3, 2]),
> Transformation([3, 1, 3]));;
gap> min := MinimalCongruencesOfSemigroup(S);
[ <semigroup congruence over <transformation semigroup of size 13,
[ <2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs> ]
gap> minl := MinimalLeftCongruencesOfSemigroup(S);
[ <left semigroup congruence over <transformation semigroup
Expand Down Expand Up @@ -389,15 +391,15 @@ gap> minl := MinimalLeftCongruencesOfSemigroup(S);
gap> S := Semigroup(Transformation([1, 3, 2]),
> Transformation([3, 1, 3]));;
gap> congs := PrincipalCongruencesOfSemigroup(S);
[ <semigroup congruence over <transformation semigroup of size 13,
[ <2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs>,
<semigroup congruence over <transformation semigroup of size 13,
<2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs>,
<semigroup congruence over <transformation semigroup of size 13,
<2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs>,
<semigroup congruence over <transformation semigroup of size 13,
<2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs>,
<semigroup congruence over <transformation semigroup of size 13,
<2-sided semigroup congruence over <transformation semigroup of
degree 3 with 2 generators> with 1 generating pairs> ]
]]></Example>
</Description>
Expand Down Expand Up @@ -552,11 +554,11 @@ gap> cong := SemigroupCongruence(S, [Transformation([1, 2, 1]),
> Transformation([2, 1, 2])]);;
gap> classes := NonTrivialEquivalenceClasses(cong);;
gap> Set(classes);
[ <congruence class of Transformation( [ 1, 2, 2 ] )>,
<congruence class of Transformation( [ 3, 1, 3 ] )>,
<congruence class of Transformation( [ 3, 1, 1 ] )>,
<congruence class of Transformation( [ 2, 1, 2 ] )>,
<congruence class of Transformation( [ 3, 3, 3 ] )> ]
[ <2-sided congruence class of Transformation( [ 1, 2, 2 ] )>,
<2-sided congruence class of Transformation( [ 3, 1, 3 ] )>,
<2-sided congruence class of Transformation( [ 3, 1, 1 ] )>,
<2-sided congruence class of Transformation( [ 2, 1, 2 ] )>,
<2-sided congruence class of Transformation( [ 3, 3, 3 ] )> ]
gap> cong := RightSemigroupCongruence(S, [Transformation([1, 2, 1]),
> Transformation([2, 1, 2])]);;
gap> classes := NonTrivialEquivalenceClasses(cong);;
Expand All @@ -583,7 +585,7 @@ gap> cong := SemigroupCongruence(S, [Transformation([1, 2, 1]),
> Transformation([2, 1, 2])]);;
gap> class := EquivalenceClassOfElement(cong,
> Transformation([3, 1, 1]));
<congruence class of Transformation( [ 3, 1, 1 ] )>
<2-sided congruence class of Transformation( [ 3, 1, 1 ] )>
gap> IsCongruenceClass(class);
true]]></Example>
</Description>
Expand Down
8 changes: 4 additions & 4 deletions doc/conginv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gap> I := InverseSemigroup([
gap> cong := SemigroupCongruence(I,
> [[PartialPerm([0, 1, 3]), PartialPerm([0, 1])],
> [PartialPerm([]), PartialPerm([1, 2])]]);
<semigroup congruence over <inverse partial perm semigroup
<2-sided semigroup congruence over <inverse partial perm semigroup
of size 19, rank 3 with 2 generators> with 2 generating pairs>
gap> TraceOfSemigroupCongruence(cong);
[ [ <empty partial perm>, <identity partial perm on [ 1 ]>,
Expand Down Expand Up @@ -55,7 +55,7 @@ gap> I := InverseSemigroup([
gap> cong := SemigroupCongruence(I,
> [[PartialPerm([0, 1, 3]), PartialPerm([0, 1])],
> [PartialPerm([]), PartialPerm([1, 2])]]);
<semigroup congruence over <inverse partial perm semigroup
<2-sided semigroup congruence over <inverse partial perm semigroup
of size 19, rank 3 with 2 generators> with 2 generating pairs>
gap> KernelOfSemigroupCongruence(cong);
<inverse partial perm semigroup of size 19, rank 3 with 5 generators>
Expand Down Expand Up @@ -84,8 +84,8 @@ gap> I := InverseSemigroup([
gap> cong := SemigroupCongruenceByGeneratingPairs(I,
> [[PartialPerm([0, 1, 3]), PartialPerm([0, 1])],
> [PartialPerm([]), PartialPerm([1, 2])]]);
<semigroup congruence over <inverse partial perm semigroup of rank 3
with 2 generators> with 2 generating pairs>
<2-sided semigroup congruence over <inverse partial perm semigroup of
rank 3 with 2 generators> with 2 generating pairs>
gap> cong2 := AsInverseSemigroupCongruenceByKernelTrace(cong);
<semigroup congruence over <inverse partial perm semigroup
of size 19, rank 3 with 2 generators> with congruence pair (19,1)>]]></Example>
Expand Down
73 changes: 40 additions & 33 deletions doc/conglatt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
<Example><![CDATA[
gap> S := SymmetricInverseMonoid(2);;
gap> poset := LatticeOfCongruences(S);
<poset of 4 congruences over <symmetric inverse monoid of degree 2>>
<lattice of 4 two-sided congruences over
<symmetric inverse monoid of degree 2>>
gap> IsCongruencePoset(poset);
true
gap> IsDigraph(poset);
true
gap> OutNeighbours(poset);
[ [ 1 .. 4 ], [ 2, 3, 4 ], [ 3 ], [ 3, 4 ] ]
[ [ 1, 2, 3, 4 ], [ 2 ], [ 2, 3 ], [ 2, 3, 4 ] ]
gap> T := FullTransformationMonoid(3);;
gap> congs := PrincipalCongruencesOfSemigroup(T);;
gap> poset := JoinSemilatticeOfCongruences(congs,
> JoinSemigroupCongruences);
<poset of 6 congruences over <full transformation monoid of degree 3>>
gap> poset := JoinSemilatticeOfCongruences(PosetOfCongruences(congs),
> WrappedTwoSidedCongruence);
<lattice of 6 two-sided congruences over
<full transformation monoid of degree 3>>
gap> IsCongruencePoset(poset);
true
gap> Size(poset);
gap> DigraphNrVertices(poset);
6
]]></Example>
</Description>
Expand Down Expand Up @@ -91,22 +93,23 @@ gap> Size(poset);
<Example><![CDATA[
gap> S := OrderEndomorphisms(2);;
gap> LatticeOfCongruences(S);
<poset of 3 congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
<lattice of 3 two-sided congruences over <regular transformation
monoid of size 3, degree 2 with 2 generators>>
gap> LatticeOfLeftCongruences(S);
<poset of 3 congruences over <regular transformation monoid
<lattice of 3 left congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
gap> LatticeOfRightCongruences(S);
<poset of 5 congruences over <regular transformation monoid
<lattice of 5 right congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
gap> OutNeighbours(LatticeOfRightCongruences(S));
[ [ 1 .. 5 ], [ 2, 5 ], [ 3, 5 ], [ 4, 5 ], [ 5 ] ]
[ [ 1, 2, 3, 4, 5 ], [ 2 ], [ 2, 3 ], [ 2, 4 ], [ 2, 5 ] ]
gap> S := FullTransformationMonoid(4);;
gap> restriction := [Transformation([1, 1, 1, 1]),
> Transformation([1, 1, 1, 2]),
> Transformation([1, 1, 1, 3])];;
gap> latt := LatticeOfCongruences(S, restriction);
<poset of 2 congruences over <full transformation monoid of degree 4>>
gap> latt := LatticeOfCongruences(S, Combinations(restriction, 2));
<lattice of 2 two-sided congruences over
<full transformation monoid of degree 4>>
]]></Example>
</Description>
</ManSection>
Expand Down Expand Up @@ -148,20 +151,21 @@ gap> latt := LatticeOfCongruences(S, restriction);
Label = "for a semigroup"/>. <P/>

<Example><![CDATA[
gap> S := Semigroup([Transformation([1, 3, 1]),
> Transformation([2, 3, 3])]);;
gap> S := Semigroup(Transformation([1, 3, 1]),
> Transformation([2, 3, 3]));;
gap> PosetOfPrincipalLeftCongruences(S);
<poset of 12 congruences over <transformation semigroup of size 11,
degree 3 with 2 generators>>
<poset of 12 left congruences over <transformation semigroup
of size 11, degree 3 with 2 generators>>
gap> PosetOfPrincipalCongruences(S);
<poset of 3 congruences over <transformation semigroup of size 11,
degree 3 with 2 generators>>
<lattice of 3 two-sided congruences over <transformation semigroup
of size 11, degree 3 with 2 generators>>
gap> restriction := [Transformation([3, 2, 3]),
> Transformation([3, 1, 3]),
> Transformation([2, 2, 2])];;
gap> poset := PosetOfPrincipalRightCongruences(S, restriction);
<poset of 3 congruences over <transformation semigroup of size 11,
degree 3 with 2 generators>>
gap> poset := PosetOfPrincipalRightCongruences(S,
> Combinations(restriction, 2));
<poset of 3 right congruences over <transformation semigroup
of size 11, degree 3 with 2 generators>>
]]></Example>
</Description>
</ManSection>
Expand All @@ -183,7 +187,7 @@ gap> poset := PosetOfPrincipalRightCongruences(S, restriction);
<Example><![CDATA[
gap> S := OrderEndomorphisms(2);;
gap> latt := LatticeOfRightCongruences(S);
<poset of 5 congruences over <regular transformation monoid
<lattice of 5 right congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
gap> CongruencesOfPoset(latt);
[ <right semigroup congruence over <regular transformation monoid
Expand Down Expand Up @@ -213,7 +217,7 @@ gap> CongruencesOfPoset(latt);
gap> S := OrderEndomorphisms(2);
<regular transformation monoid of degree 2 with 2 generators>
gap> latt := LatticeOfRightCongruences(S);
<poset of 5 congruences over <regular transformation monoid
<lattice of 5 right congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
gap> UnderlyingSemigroupOfCongruencePoset(latt) = S;
true
Expand Down Expand Up @@ -246,8 +250,8 @@ gap> coll := [RightSemigroupCongruence(S, pair1),
> RightSemigroupCongruence(S, pair2),
> RightSemigroupCongruence(S, [])];;
gap> poset := PosetOfCongruences(coll);
<poset of 3 congruences over <regular transformation monoid of
degree 2 with 2 generators>>
<poset of 3 right congruences over <regular transformation monoid
of size 3, degree 2 with 2 generators>>
gap> OutNeighbours(poset);
[ [ 1 ], [ 2 ], [ 1, 2, 3 ] ]
]]></Example>
Expand Down Expand Up @@ -282,13 +286,15 @@ gap> OutNeighbours(poset);
gap> S := SymmetricInverseMonoid(2);;
gap> pair1 := [PartialPerm([1], [1]), PartialPerm([2], [1])];;
gap> pair2 := [PartialPerm([1], [1]), PartialPerm([1, 2], [1, 2])];;
gap> pair3 := [PartialPerm([1, 2], [1, 2]),
gap> pair3 := [PartialPerm([1, 2], [1, 2]),
> PartialPerm([1, 2], [2, 1])];;
gap> coll := [RightSemigroupCongruence(S, pair1),
> RightSemigroupCongruence(S, pair2),
> RightSemigroupCongruence(S, pair3)];;
gap> JoinSemilatticeOfCongruences(coll, JoinRightSemigroupCongruences);
<poset of 4 congruences over <symmetric inverse monoid of degree 2>>
gap> JoinSemilatticeOfCongruences(PosetOfCongruences(coll),
> WrappedRightCongruence);
<poset of 4 right congruences over
<symmetric inverse monoid of degree 2>>
]]></Example>
</Description>
</ManSection>
Expand Down Expand Up @@ -326,16 +332,17 @@ gap> pair3 := [PartialPerm([1, 2], [1, 2]),
gap> coll := [RightSemigroupCongruence(S, pair1),
> RightSemigroupCongruence(S, pair2),
> RightSemigroupCongruence(S, pair3)];;
gap> MinimalCongruences(coll);
gap> MinimalCongruences(PosetOfCongruences(coll));
[ <right semigroup congruence over <symmetric inverse monoid of degree\
2> with 1 generating pairs>,
<right semigroup congruence over <symmetric inverse monoid of degree\
2> with 1 generating pairs> ]
gap> poset := LatticeOfCongruences(S);
<poset of 4 congruences over <symmetric inverse monoid of degree 2>>
<lattice of 4 two-sided congruences over
<symmetric inverse monoid of degree 2>>
gap> MinimalCongruences(poset);
[ <semigroup congruence over <symmetric inverse monoid of degree 2> wi\
th 0 generating pairs> ]
[ <2-sided semigroup congruence over <symmetric inverse monoid of degr\
ee 2> with 0 generating pairs> ]
]]></Example>
</Description>
</ManSection>
Expand Down
2 changes: 1 addition & 1 deletion doc/congrms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ gap> rowBlocks := [[1], [2], [3]];;
gap> cong := RZMSCongruenceByLinkedTriple(S, N, colBlocks, rowBlocks);;
gap> class := RZMSCongruenceClassByLinkedTriple(cong,
> RightCoset(N, (1, 5)), 2, 3);
<congruence class of (2,(3,4),3)>]]></Example>
<2-sided congruence class of (2,(3,4),3)>]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
Expand Down
20 changes: 10 additions & 10 deletions doc/congsemigraph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ e_1
gap> e_3 := S.3;
e_3
gap> cong := SemigroupCongruence(S, [[e_1, e_3]]);
<semigroup congruence over <finite graph inverse semigroup with 4 vert\
ices, 5 edges> with 1 generating pairs>
<2-sided semigroup congruence over <finite graph inverse semigroup wit\
h 4 vertices, 5 edges> with 1 generating pairs>
gap> IsCongruenceByWangPair(cong);
false
]]></Example>
Expand Down Expand Up @@ -98,15 +98,15 @@ gap> S := GraphInverseSemigroup(D);
gap> CongruenceByWangPair(S, [4], [2]);
<graph inverse semigroup congruence with H = [ 4 ] and W = [ 2 ]>
gap> cong := AsSemigroupCongruenceByGeneratingPairs(last);
<semigroup congruence over <finite graph inverse semigroup with 4 vert\
ices, 4 edges> with 2 generating pairs>
<2-sided semigroup congruence over <finite graph inverse semigroup wit\
h 4 vertices, 4 edges> with 2 generating pairs>
gap> AsCongruenceByWangPair(cong);
<graph inverse semigroup congruence with H = [ 4 ] and W = [ 2 ]>
gap> CongruenceByWangPair(S, [3, 4], [1]);
<graph inverse semigroup congruence with H = [ 3, 4 ] and W = [ 1 ]>
gap> cong := AsSemigroupCongruenceByGeneratingPairs(last);
<semigroup congruence over <finite graph inverse semigroup with 4 vert\
ices, 4 edges> with 3 generating pairs>
<2-sided semigroup congruence over <finite graph inverse semigroup wit\
h 4 vertices, 4 edges> with 3 generating pairs>
gap> AsCongruenceByWangPair(cong);
<graph inverse semigroup congruence with H = [ 3, 4 ] and W = [ 1 ]>
]]></Example>
Expand All @@ -133,15 +133,15 @@ gap> S := GraphInverseSemigroup(D);
gap> CongruenceByWangPair(S, [4], [2]);
<graph inverse semigroup congruence with H = [ 4 ] and W = [ 2 ]>
gap> cong := AsSemigroupCongruenceByGeneratingPairs(last);
<semigroup congruence over <finite graph inverse semigroup with 4 vert\
ices, 4 edges> with 2 generating pairs>
<2-sided semigroup congruence over <finite graph inverse semigroup wit\
h 4 vertices, 4 edges> with 2 generating pairs>
gap> AsCongruenceByWangPair(cong);
<graph inverse semigroup congruence with H = [ 4 ] and W = [ 2 ]>
gap> CongruenceByWangPair(S, [3, 4], [1]);
<graph inverse semigroup congruence with H = [ 3, 4 ] and W = [ 1 ]>
gap> cong := AsSemigroupCongruenceByGeneratingPairs(last);
<semigroup congruence over <finite graph inverse semigroup with 4 vert\
ices, 4 edges> with 3 generating pairs>
<2-sided semigroup congruence over <finite graph inverse semigroup wit\
h 4 vertices, 4 edges> with 3 generating pairs>
gap> AsCongruenceByWangPair(cong);
<graph inverse semigroup congruence with H = [ 3, 4 ] and W = [ 1 ]>
]]></Example>
Expand Down
1 change: 0 additions & 1 deletion doc/z-chap13.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<#Include Label = "SemigroupCongruence">
<#Include Label = "LeftSemigroupCongruence">
<#Include Label = "RightSemigroupCongruence">
<#Include Label = "GeneratingPairsOfSemigroupCongruence">

</Section>

Expand Down
Loading

0 comments on commit 584bc0c

Please sign in to comment.