Skip to content

Added some functions for working with graph inverse semigroups and their congruences - #1204

Open
joe-dw wants to merge 18 commits into
semigroups:mainfrom
joe-dw:main
Open

Added some functions for working with graph inverse semigroups and their congruences#1204
joe-dw wants to merge 18 commits into
semigroups:mainfrom
joe-dw:main

Conversation

@joe-dw

@joe-dw joe-dw commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Functions have been added to find edges and paths with range or source of a given vertex in a graph inverse semigroup, as well as finding the positive and negative paths that form any given element. There is also a new definition for the trace of a congruence by Wang pair, and graph inverse semigroup specific implementations of CongruenceTestMembershipNC, ImagesElm and EquivalenceRelationPartition for both traces and congruences.

@joe-dw
joe-dw marked this pull request as ready for review July 29, 2026 10:50
joe-dw and others added 2 commits July 29, 2026 12:40
@james-d-mitchell james-d-mitchell mentioned this pull request Aug 20, 2026

@james-d-mitchell james-d-mitchell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs some more polishing and some more justification for the changes that you want to introduce. Please update and try again.

Comment thread doc/congsemigraph.xml
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="TraceOfCongruenceByWangPair">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed just now, I'm not sure that this needs to exist as a stand alone function, but should just be the method for TraceOfSemigroupCongruence (which itself should be TraceOfInverseSemigroupCongruence but that's another issue completely).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably update the doc for TraceOfSemigroupCongruence to include some of the doc here. In particular, it'd be useful to have a list of type of semigroup in the doc for TraceOfSemigroupCongruence that you can expect the function to work for.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this bit doc isn't actually included in the manual.

Comment thread doc/semigraph.xml
<Ref Filt="IsGraphInverseSemigroupElement"/>), then this attribute returns
the index of this vertex in its graph inverse semigroup.<P/>
<Ref Filt="IsGraphInverseSemigroupElement"/>), then this attribute returns the
index of this vertex in <A>S</A>.<P/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change, there's no argument S or any other mention of S.

Comment thread doc/semigraph.xml
<Returns>A list of graph inverse semigroup elements.</Returns>
<Description>
If <A>x</A> is a vertex of a graph inverse semigroup (i.e. it satisfies
<Ref Filt="IsGraphInverseSemigroupElement"/>), then this attribute returns a list

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and IsVertex or whatever it's called.

Comment thread doc/semigraph.xml

<#GAPDoc Label="EdgesWithRange">
<ManSection>
<Attr Name="EdgesWithRange" Arg="x"/>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Attr Name="EdgesWithRange" Arg="x"/>
<Attr Name="EdgesWithRange" Arg="v"/>

Comment thread doc/semigraph.xml
<Description>
If <A>x</A> is a vertex of a graph inverse semigroup (i.e. it satisfies
<Ref Filt="IsGraphInverseSemigroupElement"/>), then this attribute returns a list
of all edges <A>e</A> such that <A>Range(e)=x</A>. If <A>x</A> is not a vertex

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of all edges <A>e</A> such that <A>Range(e)=x</A>. If <A>x</A> is not a vertex
of all edges <A>e</A> such that <A>Range(e)=x</A>. If <A>x</A> is not a vertex,

classes := [];
fi;
for w in tr!.cong!.W do
if Intersection(InNeighbours(GraphOfGraphInverseSemigroup(Source(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if Intersection(InNeighbours(GraphOfGraphInverseSemigroup(Source(
if IsEmpty(Intersection(InNeighbours(GraphOfGraphInverseSemigroup(Source(

fi;
for w in tr!.cong!.W do
if Intersection(InNeighbours(GraphOfGraphInverseSemigroup(Source(
tr!.cong)))[w], tr!.cong!.W) = [] then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w_elt := VerticesOfGraphInverseSemigroup(Source(tr!.cong))[w];

od;
for p in pws do
for q in ps do
Add(classes, p * ImagesElm(TraceOfCongruenceByWangPair(cong),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of duplicate code here. Please clean it up and trying to make it a bit clearer.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like:

      ps := PathsWithRange(VerticesOfGraphInverseSemigroup(Source(cong))[w]);

      # pws := Filtered(ps, p -> (not IsVertex(p)) and (
      #        IndexOfVertexOfGraphInverseSemigroup(Source(
      #        EdgesOfGraphInverseSemigroup(Source(cong))[Last(p![1])]))
      #        in cong!.W));
      # ps := Difference(ps, pws);
        W_cond := BlistList(???);
      for p in ps do
            for q in ps do
                if W_cond[p![1]) or W_cond[Last(q![1])] or Last(p![1]) <> Last(q![1]) then
                    Add(classes, p * ImagesElm(TraceOfCongruenceByWangPair(cong),
                        VerticesOfGraphInverseSemigroup(Source(cong))[w]) * q ^ -1);
                fi;
            od;
        fi;
      od;
    fi;

instead would probably be better (not guaranteed!!)

[IsCongruenceByWangPair],
function(cong)
local classes, w, p, q, ps, pws;
classes := [Concatenation([MultiplicativeZero(Source(cong))],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImagesElm of zero again?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wider point also, we need some evidence that this is faster than the default methods, otherwise, it's hard to justify its inclusion.

q -> p * q ^ -1))))));
elif IsIdempotent(x) then
return ImagesElm(TraceOfCongruenceByWangPair(cong), x);
else

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else
fi;

and then unindent the rest of this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants