• No results found

Kernel and trace from generating pairs

3.2 Converting between representations

3.2.5 Kernel and trace from generating pairs

Given a set of generating pairsRover a semigroupS, we may wish to consider the congruence ρ = R] and ask questions such as whether a pair lies in the congruence, or the number of

congruence classes. This is certainly possible by various methods, for example the variety of algorithms mentioned in Chapter 2 – however, ifS is an inverse semigroup then the congruence has an associated kernel–trace pair, as described in Section 3.1.4. If we know this kernel–trace pair, then we can use methods associated with it to carry out calculations, and benchmarking in [Tor14b, §6.1.3] indicates that these calculations are likely to be much faster than by using other methods. We therefore wish for an algorithm that determines the kernel and trace ofρ.

One way of calculating the kernel and trace would be simply to enumerate all the elements in all the classes of ρ, and to search for the idempotents to compute the kernel and trace. However, enumerating all the classes is very time-consuming, and the main reason to calculate the kernel–trace pair in the first place is probably to avoid this work. Hence, we want to find the kernel–trace pair directly from the generating pairsR, enumerating as few pairs inR] as

possible.

A new way of finding the kernel and trace directly from the generating pairs is presented in pseudo-code in Algorithm 3.28, which will require some explanation. It is based on a simple idea: firstly, populate K and τ with those elements that are implied directly by the pairs in

R; then, add further elements toKandτ to satisfy the conditions of a kernel–trace pair. This means we return the least kernel–trace pair (K, τ) that implies the pairs in R – that is, we return the kernel–trace pair that corresponds to R]. This idea is explained more explicitly

below.

To understand why the algorithm is correct, we make use of the following lemma, akin to Lemma 3.23 for linked triples.

Lemma 3.29. Let ρandσbe congruences on S with kernel–trace pairs(Kρ, τρ)and(Kσ, τσ)

respectively. We have ρ⊆σif and only ifKρ≤Kσ andτρ⊆τσ.

Proof. AssumeKρ≤Kσandτρ⊆τσ, and let (x, y)∈ρ. By Theorem 3.17, we havexy−1∈Kρ

and (x−1x, y−1y) τ

ρ. Hence xy−1 ∈ Kσ and (x−1x, y−1y) ∈ τσ, which together imply

(x, y)∈σ. Henceρ⊆σ.

Conversely, assume ρ ⊆ σ. If k ∈ Kρ then k = xy−1 for some (x, y) ∈ ρ; this means

(x, y) ∈ σ, so k = xy−1 K

Algorithm 3.28 TheKerTraceFromPairsalgorithm

Require: S an inverse semigroup with idempotentsE

Require: R⊆S×S

1: procedureKerTraceFromPairs(R) 2: K:=E

3: τ:= ∆E

4: LetS0 be a generating set forS 5: LetE0 be a generating set forE 6: X ← {ab−1: (a, b)∈R}

7: T← {(a−1a, b−1b) : (a, b)∈R}

8: τ←(τ∪T)e

9: repeat

10: δ←false . Nothing has changed yet

11: EnumerateKernel( ) 12: EnforceConditions( ) 13: EnumerateTrace( ) 14: . K ⊆kerR] andτtrR]

15: untilδ=false . Exit loop if nothing changed

16: return(K, τ) 17: procedureEnumerateKernel( ) 18: if X\K6=∅then 19: K← hhK, Xii 20: δ←true 21: X ←∅ 22: procedureEnforceConditions( ) 23: fora∈S do 24: if a∈K then 25: if (aa−1, a−1a)∈/ τ then 26: T←T∪ {(aa−1, a−1a)} 27: τ ←τ∪ {(aa−1, a−1a)} 28: δ←true 29: else 30: fore∈[a−1a] τ do 31: if ae∈K then 32: X←X∪ {a} 33: δ←true

34: . (i) and (ii) from Definition 3.16 hold for each elementa∈S considered so far

35: procedureEnumerateTrace( )

36: while T6=∅do

37: Pick any (x, y)∈T

38: fore∈E0 do

39: if (xe, ye)∈/τ then

40: δ←true

41: T←T∪ {(xe, ye)}

42: τ ←(τ∪ {(xe, ye)})e

43: fora∈S0 do

44: if (a−1xea, a−1yea)/ τ then

45: T←T∪ {(a−1xea, a−1yea)}

46: τ←(τ∪ {(a−1xea, a−1yea)})e 47: .(a−1xea, a−1yea)∈τ

48: .(xe, ye),(ex, ey)∈τ 49: T←T\ {(x, y)}

50: . τ satisfies Definition 3.15 for all a∈S0 and all(x, y)∈τ considered so far

(x, y)∈ρ; this means (x, y)∈σ, so (e, f) = (x−1x, y−1y)∈τσ. HenceKρ ≤Kσ andτρ ⊆τσ,

as required.

The kernelK starts out containing just the idempotentsE (line 2), and the traceτ starts out as the trivial congruence onE (line 3). Every kernel and trace must contain at least these elements – in fact, after line 3, (K, τ) corresponds to the trivial congruence ∆S. We assume

that we have generating setsS0 forS andE0 for E (lines 4–5). In the worst case, we can use S and E themselves, but the algorithm is likely to run faster with a smaller generating set. Certainly in computational settings such as theSemigroupspackage forGAP[M+19] semigroups such as S and E have a generating set stored, and a smaller generating set can sometimes be created by eliminating unnecessary elements.

Once these setup steps have been done, we add information from the known pairs of ρ– that is, from the pairs in R. Theorem 3.17 tells us that a pair (a, b) lies in ρ if and only if ab−1∈K and (a−1a, b−1b)∈τ. Now instead of usingK andτ to determine whether a pair is in ρ, we are using a pair inρ to impose conditions onK and τ. We have two sets,X and T, which act as queues for elements that need to be processed inK and τ respectively. For each (a, b)∈Rwe putab−1 into X (line 6) and (a−1a, b−1b) intoT(line 7); elements inX will be

added toK next time we callEnumerateKernel, and we addTtoτ straight away (line 8). Once this has been done, the rule that (a, b) lies in ρ if and only if ab−1 ∈ K and (a−1a, b−1b) τ is satisfied for all pairs (a, b) R. All that is left to do is to add any

elements to K and pairs to τ required to make (K, τ) a kernel–trace pair. The rest of the algorithm (lines 9–16 and the three sub-procedures) focuses on this task.

Recall from Definitions 3.14, 3.15 and 3.16 the conditions for a kernel–trace pair. We require (K, τ) to satisfy these conditions, and we must make any additions necessary until they are all fulfilled. For this purpose we have three sub-procedures – EnumerateKernel,

EnumerateTrace, and EnforceConditions – that test the conditions for a kernel–trace pair and add any elements necessary. Any of these methods might add toKorτ, which might in turn imply that another method has more information to find. Hence, the three methods are run repeatedly until an entire run is completed in which no new information is found (δ remains false throughout the entire run). If no new information is found, (K, τ) is guaranteed to be a kernel–trace pair, and we can return. The three methods could be run in any order without the correctness of the algorithm being affected, but the order shown in Algorithm 3.28 seems to have the best time performance, based on informal experiments. All three methods are considered to have access to any of the variables in the overall algorithm.

The first method,EnumerateKernel, first checks whether there are any new elements in X that have not already been added toK(line 18). If there are, it adds all the elements fromX toK, and then on line 19 it adds any necessary elementsa−1xatoK, as in Definition 3.14, to

ensure thatKremains self-conjugate. This process of adding elements to ensure self-conjugacy is denoted with the notation hh·ii, as for normal closure in a group. Since K containsE from the beginning, this is enough to guarantee thatK is a normal subsemigroup, a fact we can be certain of at the end of EnumerateKernel. If a change was made, we setδ to true, and in any case we empty the set X to indicate that no new elements have been found since this sub-procedure was run.

It considers all the pairs that have been added toτ since the last call toEnumerateTrace– these are precisely the pairs in T– and makes sure that any pairs implied by them are added toτ andT. For each (x, y)∈T, the left and right multiples of (x, y) must be inτ (as required by the definition of a congruence). In fact, only the right-multiples (xe, ye) need to be added, since idempotents commute in an inverse semigroup, and the trace is only a relation on the idempotents. If any of these pairs are new, they are added toTso that further multiples can be found; this is why we only need to multiply by the generators fromE0, rather than all elements in E. So, inEnumerateTrace, we go through all the pairs (x, y) in Tone at a time (lines 36–37) and apply each generator e∈E0 to its right-hand side to make the pair (xe, ye) (lines 38–39), which is equal to (ex, ey) by commutativity. For each one of these pairs that is not already inτ, we have to add it toτto ensure thatτremains a congruence (line 42), and we have to add it toT(line 41) to ensure that we process all of its right-multiples in a future iteration of the while-loop. In order to ensure that τ is normal, we also need to conjugate the pair by each generator of the semigroup a, and add any of these to τ and T if they are not already present (lines 43–47). At the end of a call toEnumerateTrace, we can thus be sure that τ is a normal congruence (line 51). If any changes are made in this call to EnumerateTrace, then we must of course setδ to true (line 40).

Finally, EnforceConditions deals with conditions (i) and (ii) from Definition 3.16. It adds any necessary elements to X and any necessary pairs to T and τ, and when finished, (K, τ) is guaranteed to satisfy conditions (i) and (ii). To achieve this, we iterate through each element ain the semigroup (line 23). Ifais in the kernelK (line 24), then we need to ensure that (aa−1, a−1a) is in the traceτ to enforce condition (ii); we add it if necessary (lines 25–27).

If a /∈K but ae∈K and (e, a−1a)τ for some idempotent e, then we need to add ato the

kernel in order to satisfy condition (i). Hence, ifais not in the kernel (line 29), we check any idempotentsethat areτ-related to a−1a(line 30), and ifaeis in the kernel (line 31) then we addato the listX of elements to be added to the kernel in the next run ofEnumerateKernel (line 32). If we make any changes to TorX in this procedure, we again setδto true (lines 28 and 33). Lines 24–33 thus ensure that conditions (i) and (ii) hold for the particular value ofa in question, hence the assertion on line 34.

If all three methods complete without any new information being found, they will have acted as a test ensuring that K is a normal subsemigroup ofS, thatτ is a normal congruence onE, and that the two conditions in Definition 3.16 are satisfied; in other words, that (K, τ) is a valid kernel–trace pair. This means that (K, τ) corresponds to a congruence (K, τ)Ψ−1, and

we know that this congruence contains every pair inR. HenceR](K, τ−1. Since we did

not add any elements toK orτ except those implied byRor those required by the definition of a kernel–trace pair, we can also be sure that (K, τ)Ψ−1R], by Lemma 3.29. Hence (K, τ)

is the kernel–trace pair corresponding to the congruenceR].

Note that, so long as S is finite, the KerTraceFromPairs algorithm is guaranteed to complete in finite time. Due to the way δ is set, the repeat-loop can only continue so long as the last iteration of the loop added something new to K or τ. Since K can only contain elements from S, and τ can only contain elements from E×E, we therefore have an upper bound of |K|+|E|2 times that the loop can be executed, and the likely number of times it

will be executed is much lower. Similarly, there are no loops inside any of the sub-procedures that can run indefinitely. Hence the algorithm is certain to terminate and return an answer

eventually.