From c0dc9dc4416831d146bb886914be7253ffa5c00d Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Fri, 2 Oct 2026 14:37:55 +0100 Subject: [PATCH 1/6] Add Full domain partition monoid method in semiex.gi,gd,tst --- gap/semigroups/semiex.gd | 2 ++ gap/semigroups/semiex.gi | 22 ++++++++++++++++++++++ tst/standard/semigroups/semiex.tst | 16 ++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/gap/semigroups/semiex.gd b/gap/semigroups/semiex.gd index fb262d845..f7ba7b063 100644 --- a/gap/semigroups/semiex.gd +++ b/gap/semigroups/semiex.gd @@ -74,6 +74,8 @@ DeclareOperation("SingularPlanarPartitionMonoid", [IsPosInt]); DeclareOperation("ModularPartitionMonoid", [IsPosInt, IsPosInt]); DeclareOperation("SingularModularPartitionMonoid", [IsPosInt, IsPosInt]); +DeclareOperation("FullDomainPartitionMonoid", [IsInt]); + # Matrix over finite field semigroups DeclareOperation("GeneralLinearMonoid", [IsPosInt, IsPosInt]); diff --git a/gap/semigroups/semiex.gi b/gap/semigroups/semiex.gi index 67696fefe..f963b8e53 100644 --- a/gap/semigroups/semiex.gi +++ b/gap/semigroups/semiex.gi @@ -1353,6 +1353,28 @@ function(n) return Monoid(UnitriangularBooleanMatMonoid(n), gens); end); +InstallMethod(FullDomainPartitionMonoid, "for an integer", +[IsInt], +function(n) + local gens, rels; + + if n<0 then + ErrorNoReturn("the argument (an int) is not >= 0"); + elif n = 0 then + return Monoid(Bipartition([])); + elif n = 1 then + return Monoid(Bipartition([[1], [-1]])); + fi; + + gens := List(GeneratorsOfGroup(SymmetricGroup(n)), x -> AsBipartition(x,n)); + Add(gens, Bipartition(Concatenation([[1, 2, -1, -2]], + List([3 .. n], x -> [x, -x])))); + Add(gens, Bipartition(Concatenation([[1,2,-2], [-1]], + List([3..n], x -> [x, -x])))); + + return Monoid(gens); +end); + ############################################################################# ## 3. Standard examples - calculated generators ############################################################################# diff --git a/tst/standard/semigroups/semiex.tst b/tst/standard/semigroups/semiex.tst index bda823392..907e55aa0 100644 --- a/tst/standard/semigroups/semiex.tst +++ b/tst/standard/semigroups/semiex.tst @@ -2008,6 +2008,22 @@ gap> S := TriangularBooleanMatMonoid(n); gap> Size(S); 64 +#Test FullDomainPartitionMonoid +gap> FullDomainPartitionMonoid(-1); +Error, the argument (an int) is not >= 0 +gap> FullDomainPartitionMonoid(0); + +gap> FullDomainPartitionMonoid(1); + +gap> FullDomainPartitionMonoid(5); + +gap> Size(FullDomainPartitionMonoid(5)); +19921 +gap> Size(FullDomainPartitionMonoid(8)) = Sum([1..8], i -> Su +m( [i..8], j -> Stirling2(8,i)*Stirling2(8,j)*Factorial(j)/Fac +torial(j-i))); +true + # Test ReflexiveBooleanMatMonoid gap> ReflexiveBooleanMatMonoid(1); From 0b13090197136bde1076d3fd201e36ece6e0944c Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Tue, 6 Oct 2026 12:53:26 +0100 Subject: [PATCH 2/6] Updates to documentation and test files regarding FullDomainPartitionMonoid --- doc/semiex.xml | 19 +++++++++++++++++++ doc/z-chap07.xml | 1 + tst/standard/semigroups/semiex.tst | 4 +--- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/semiex.xml b/doc/semiex.xml index cbd9c45cd..8199fd9a9 100644 --- a/doc/semiex.xml +++ b/doc/semiex.xml @@ -8,6 +8,25 @@ ############################################################################# ## +<#GAPDoc Label="FullDomainPartitionMonoid"> + + + A full domain partition monoid. + + If n is a non-negative integer, then FullDomainPartitionMonoid + returns the full domain partition monoid of degree n. The full domain partition monoid is the subsemigroup of the partition monoid consisting of all bipartitions with their domain equal to [1 .. n] (the domain of a bipartition is defined in Chapter , see ) + + S := FullDomainPartitionMonoid(5); + +gap> Size(S); +19921]]> + + +<#/GAPDoc> + + + <#GAPDoc Label="EndomorphismsPartition"> diff --git a/doc/z-chap07.xml b/doc/z-chap07.xml index 426f890cf..e816257ab 100644 --- a/doc/z-chap07.xml +++ b/doc/z-chap07.xml @@ -68,6 +68,7 @@ <#Include Label = "PlanarPartitionMonoid"> <#Include Label = "ModularPartitionMonoid"> <#Include Label = "ApsisMonoid"> + <#Include Label = "FullDomainPartitionMonoid"/> diff --git a/tst/standard/semigroups/semiex.tst b/tst/standard/semigroups/semiex.tst index 907e55aa0..55097e6de 100644 --- a/tst/standard/semigroups/semiex.tst +++ b/tst/standard/semigroups/semiex.tst @@ -2019,9 +2019,7 @@ gap> FullDomainPartitionMonoid(5); gap> Size(FullDomainPartitionMonoid(5)); 19921 -gap> Size(FullDomainPartitionMonoid(8)) = Sum([1..8], i -> Su -m( [i..8], j -> Stirling2(8,i)*Stirling2(8,j)*Factorial(j)/Fac -torial(j-i))); +gap> Size(FullDomainPartitionMonoid(8)) = Sum([1..8], i -> Sum( [i..8], j -> Stirling2(8,i)*Stirling2(8,j)*Factorial(j)/Factorial(j-i))); true # Test ReflexiveBooleanMatMonoid From 68b0de0c703f9f698fc46753e351d12f62e7aa4d Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Tue, 6 Oct 2026 13:50:38 +0100 Subject: [PATCH 3/6] Implement the gaplint changes and reduce n to speed up testing --- gap/semigroups/semiex.gi | 18 +++++++++--------- tst/standard/semigroups/semiex.tst | 5 ++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gap/semigroups/semiex.gi b/gap/semigroups/semiex.gi index f963b8e53..7ba716801 100644 --- a/gap/semigroups/semiex.gi +++ b/gap/semigroups/semiex.gi @@ -1356,21 +1356,21 @@ end); InstallMethod(FullDomainPartitionMonoid, "for an integer", [IsInt], function(n) - local gens, rels; + local gens; - if n<0 then - ErrorNoReturn("the argument (an int) is not >= 0"); + if n < 0 then + ErrorNoReturn("the argument (an int) is not >= 0"); elif n = 0 then - return Monoid(Bipartition([])); + return Monoid(Bipartition([])); elif n = 1 then - return Monoid(Bipartition([[1], [-1]])); + return Monoid(Bipartition([[1], [-1]])); fi; - gens := List(GeneratorsOfGroup(SymmetricGroup(n)), x -> AsBipartition(x,n)); + gens := List(GeneratorsOfGroup(SymmetricGroup(n)), x -> AsBipartition(x, n)); Add(gens, Bipartition(Concatenation([[1, 2, -1, -2]], - List([3 .. n], x -> [x, -x])))); - Add(gens, Bipartition(Concatenation([[1,2,-2], [-1]], - List([3..n], x -> [x, -x])))); + List([3 .. n], x -> [x, -x])))); + Add(gens, Bipartition(Concatenation([[1, 2, -2], [-1]], + List([3 .. n], x -> [x, -x])))); return Monoid(gens); end); diff --git a/tst/standard/semigroups/semiex.tst b/tst/standard/semigroups/semiex.tst index 55097e6de..4ae08ef73 100644 --- a/tst/standard/semigroups/semiex.tst +++ b/tst/standard/semigroups/semiex.tst @@ -2019,7 +2019,10 @@ gap> FullDomainPartitionMonoid(5); gap> Size(FullDomainPartitionMonoid(5)); 19921 -gap> Size(FullDomainPartitionMonoid(8)) = Sum([1..8], i -> Sum( [i..8], j -> Stirling2(8,i)*Stirling2(8,j)*Factorial(j)/Factorial(j-i))); +gap> Size(FullDomainPartitionMonoid(6)) = Sum([1 .. 6], i -> + Sum([i .. 6], j -> Stirling2(6, i) * + Stirling2(6, j) * Factorial(j) / + Factorial(j - i))); true # Test ReflexiveBooleanMatMonoid From 03c43371a768e0efd122a9d0589f49e45f0bc8a8 Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Tue, 6 Oct 2026 15:36:56 +0100 Subject: [PATCH 4/6] Changes to testing to reduce runtime --- tst/standard/semigroups/semiex.tst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tst/standard/semigroups/semiex.tst b/tst/standard/semigroups/semiex.tst index 4ae08ef73..7df5d9733 100644 --- a/tst/standard/semigroups/semiex.tst +++ b/tst/standard/semigroups/semiex.tst @@ -2019,9 +2019,9 @@ gap> FullDomainPartitionMonoid(5); gap> Size(FullDomainPartitionMonoid(5)); 19921 -gap> Size(FullDomainPartitionMonoid(6)) = Sum([1 .. 6], i -> - Sum([i .. 6], j -> Stirling2(6, i) * - Stirling2(6, j) * Factorial(j) / +gap> Size(FullDomainPartitionMonoid(4)) = Sum([1 .. 4], i -> + Sum([i .. 4], j -> Stirling2(4, i) * + Stirling2(4, j) * Factorial(j) / Factorial(j - i))); true From 3f1d254839fbaec23d87fd972d320fc5b50acb3e Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Fri, 9 Oct 2026 11:50:25 +0100 Subject: [PATCH 5/6] Update test Co-authored-by: James Mitchell --- tst/standard/semigroups/semiex.tst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tst/standard/semigroups/semiex.tst b/tst/standard/semigroups/semiex.tst index 7df5d9733..391b22cbf 100644 --- a/tst/standard/semigroups/semiex.tst +++ b/tst/standard/semigroups/semiex.tst @@ -2020,9 +2020,9 @@ gap> FullDomainPartitionMonoid(5); gap> Size(FullDomainPartitionMonoid(5)); 19921 gap> Size(FullDomainPartitionMonoid(4)) = Sum([1 .. 4], i -> - Sum([i .. 4], j -> Stirling2(4, i) * - Stirling2(4, j) * Factorial(j) / - Factorial(j - i))); +> Sum([i .. 4], j -> Stirling2(4, i) * +> Stirling2(4, j) * Factorial(j) / +> Factorial(j - i))); true # Test ReflexiveBooleanMatMonoid From 609e2f628fd5a9321334bbb82448b87e3dccd3e2 Mon Sep 17 00:00:00 2001 From: kpd-0 Date: Fri, 9 Oct 2026 13:44:56 +0100 Subject: [PATCH 6/6] Add Citation --- doc/semiex.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/semiex.xml b/doc/semiex.xml index 8199fd9a9..f1a00a095 100644 --- a/doc/semiex.xml +++ b/doc/semiex.xml @@ -14,7 +14,7 @@ A full domain partition monoid. If n is a non-negative integer, then FullDomainPartitionMonoid - returns the full domain partition monoid of degree n. The full domain partition monoid is the subsemigroup of the partition monoid consisting of all bipartitions with their domain equal to [1 .. n] (the domain of a bipartition is defined in Chapter , see ) + returns the full domain partition monoid of degree n. The full domain partition monoid is the subsemigroup of the partition monoid consisting of all bipartitions with their domain equal to [1 .. n] (the domain of a bipartition is defined in Chapter , see ). As described in S := FullDomainPartitionMonoid(5);