Added some functions for working with graph inverse semigroups and their congruences - #1204
Added some functions for working with graph inverse semigroups and their congruences#1204joe-dw wants to merge 18 commits into
Conversation
Added functions, documentation and tests for graph inverse semigroup congruence and trace.
Removed undefined declaration of MinimalHereditarySubsetsVertex
james-d-mitchell
left a comment
There was a problem hiding this comment.
This needs some more polishing and some more justification for the changes that you want to introduce. Please update and try again.
| </ManSection> | ||
| <#/GAPDoc> | ||
|
|
||
| <#GAPDoc Label="TraceOfCongruenceByWangPair"> |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Note that this bit doc isn't actually included in the manual.
| <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/> |
There was a problem hiding this comment.
Please revert this change, there's no argument S or any other mention of S.
| <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 |
There was a problem hiding this comment.
and IsVertex or whatever it's called.
|
|
||
| <#GAPDoc Label="EdgesWithRange"> | ||
| <ManSection> | ||
| <Attr Name="EdgesWithRange" Arg="x"/> |
There was a problem hiding this comment.
| <Attr Name="EdgesWithRange" Arg="x"/> | |
| <Attr Name="EdgesWithRange" Arg="v"/> |
| <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 |
There was a problem hiding this comment.
| 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( |
There was a problem hiding this comment.
| 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 |
There was a problem hiding this comment.
w_elt := VerticesOfGraphInverseSemigroup(Source(tr!.cong))[w];
| od; | ||
| for p in pws do | ||
| for q in ps do | ||
| Add(classes, p * ImagesElm(TraceOfCongruenceByWangPair(cong), |
There was a problem hiding this comment.
Lots of duplicate code here. Please clean it up and trying to make it a bit clearer.
There was a problem hiding this comment.
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))], |
There was a problem hiding this comment.
ImagesElm of zero again?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
| else | |
| fi; |
and then unindent the rest of this function.
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.