An Experimental Study of Forbidden Patterns in Geometric Permutations by Combinatorial Lifting

We study the problem of deciding if a given triple of permutations can be realized as geometric permutations of disjoint convex sets in $\mathbb{R}^3$. We show that this question, which is equivalent to deciding the emptiness of certain semi-algebraic sets bounded by cubic polynomials, can be"lifted"to a purely combinatorial problem. We propose an effective algorithm for that problem, and use it to gain new insights into the structure of geometric permutations.


Introduction
Consider pairwise disjoint convex sets C 1 , C 2 , . . . , C n and lines 1 , 2 , . . . , k in R d , where every line intersects every set. Each line i defines two orders on the sets, namely the orders in which the two orientations of i meet the sets; this pair of orders, one the reverse of the other, are identified to form the geometric permutation realized by i on C 1 , C 2 , . . . , C n . Going in the other direction, one may ask if a given family of permutations can occur as geometric permutations of a family of pairwise disjoint convex sets in R d , i.e. whether it is geometrically realizable in R d .
In R 2 there exist pairs of permutations that are unrealizable, while in R 3 , every pair of permutations is realizable by a family of segments with endpoints on two skew lines. The simplest non-trivial question is therefore to understand which triples of permutations are geometrically realizable. This question is equivalent to testing the non-emptiness of certain semi-algebraic sets bounded by cubic polynomials. We show that the structure of these polynomials allow to "lift" this algebraic question to a purely combinatorial one, then propose an algorithm for that combinatorial problem, and present some new results on geometric permutations obtained with its assistance. The smallest known triple of geometric permutations forbidden in R 3 has size 6 (see Section 1.2), so Theorem 1 proves that it is minimal. We also obtained the complete list of forbidden triples of size 6 (see Appendix C). Interestingly, although everything is realizable up to size 5, something can be said on geometric permutations of size 4. Recall that the side operator (pq) (rs) of the two lines (pq) and (rs), oriented respectively from p to q and from r to s, is the orientation of the tetrahedron pqrs; it captures the mutual disposition of the two lines. We prove: Theorem 2. Let 1 and 2 be two oriented lines intersecting four pairwise disjoint convex sets in the order 1234. Any oriented line 3 that intersects those four sets in the order 2143 satisfies 1 3 The pattern (1234, 2143) is known to be forbidden in some cases (see Section 1.2), but this is the first condition valid for arbitrary disjoint convex sets. We could prove Theorem 2 because our algorithm solves a more constrained problem than just realizability of permutations. Given three lines in general position in R 3 , there is a unique parallelotope with three disjoint edges supported on these three lines (see Figure 1). Combinatorial lifting, and therefore our algorithm, can decide whether three permutations can be realized with the vertices of that parallelotope in prescribed positions in the permutations.
We label the vertices of the parallelotope with 0 and 1 as in Figure 1 and work with permutations where two extra elements, 0 and 1 , are inserted; we call them tagged permutations. We examine triples of tagged permutations realizable on a canonical system of lines (see Equation (1)), and characterize those minimally unrealizable up to size 4 (Proposition 10); for size 2 and 3, we provide independent, direct, geometric proofs of unrealizability (Section 7). We conjecture that no other minimally unrealizable triples of tagged permutations exist, and verified this experimentally up to size 6 (not counting 0 and 1 ). A weaker conjecture is: There exists a polynomial time algorithm that decides the geometric realizability of a triple of permutations of size n in R 3 .

Discussion and related work
We now put our contribution in context, starting with motivations for studying geometric permutations.
Geometric transversals. In the 1950's, Grünbaum [8] conjectured that, given a family of disjoint translates of a convex figure in the plane, if every five members of the family can be met by a line, then there exists a line that meets the entire family. (Such a statement, if true, is an example of Helly-type theorem.) Progress on Grünbaum's conjecture was slow until the 1980's, when the notion of geometric permutations of families of convex sets was introduced [14,15]. Their systematic study in the plane was refined by Katchalski [13] in order to prove a weak version of Grünbaum's conjecture (with 128 in place of 5). Tverberg [26] soon followed up with a proof of the conjecture, again using a careful analysis of planar geometric permutations. This initial success and further conjectures about Helly-type theorems stimulated a more systematic study of geometric permutations realizable under various geometric restrictions; cf. [11] and the references therein.
Another motivation to study geometric permutations comes from computational geometry, more precisely the study of geometric structures such as arrangements. There, geometric permutations appear as a coarse measure of complexity of the space of line transversals to families of sets, and relates to various algorithmic problems such as ray-shooting or smallest enclosing cylinder computation [20, §7.6]. From this point of view, the main question is to estimate the maximum number g d (n) of distinct geometric permutations of n pairwise disjoint convex sets in R d . Broadly speaking, while g 2 (n) is known to equal 2n − 2 [7], even the order of magnitude of g d (n) as n → ∞ is open for every d ≥ 3; the gap is between Ω(n d−1 ) and O(n 2d−3 log n). Bridging this gap has been identified as an important problem in discrete geometry [20, §7.6], yet, over the last fifteen years, the only progress has been an improvement of the upper bound from O(n 2d−2 ) down to O(n 2d−3 log n); moreover, while the former bound follows from a fairly direct argument, the latter is a technical tour de force [22]. We hope that a better understanding of small forbidden configurations will suggest new approaches to this question.
Geometric realizability problems. Combinatorial structures that arise from geometric configurations such as arrangements, polytopes, or intersection graphs are classical objects of enquiry in discrete and computational geometry (see e.g. [25, § 1, 5, 6, 10, 15, 17, 28]). We are concerned here with the membership testing problem: given an instance of a combinatorial structure, decide if there exists a geometric configuration that induces it. Such problems can be difficult: for instance, deciding whether a given graph can be obtained as intersection graph of segments in the plane is NP-hard [17].
A natural approach to membership testing is to parameterize the candidate geometric configuration and express the combinatorial structure as conditions on these parameters. This often results in a semi-algebraic set. In the real-RAM model 1 , the emptiness of a semi-algebraic set in R d with real coefficients can be tested in time (nD) O(d) [21,Prop. 4.1], where n is the number of polynomials and D their maximum degree. (Other approaches exist but have worse complexity bounds, see [6,18,12,5]). Given three permutations of size n, we describe their realizations as a semi-algebraic set defined by O(n 2 ) cubic polynomials in n variables; the above method thus has complexity n O(n) , making our O 6 n n 10 solution competitive in theory. Practical effectiveness is usually difficult to predict as it depends on the geometry of the underlying algebraic surfaces; for example, deciding if two geometric permutations of size four are realizable by disjoint unit balls in R 3 was recently checked to be out of reach [10].
Some geometric realizability problems, for example the recognition of unit disk graphs, are ∃R-hard [23] and therefore as difficult from a complexity point of view as deciding the emptiness of a general semi-algebraic set. We do not know whether deciding the emptiness of semi-algebraic sets amenable to our combinatorial lifting remains ∃R-hard; we believe, however, that deciding if a triple of permutations is realizable is not (c.f. Conjecture 3).

Forbidden patterns.
A dimension count shows that any k permutations are realizable in R 2k−1 . Our most direct predecessor is the work of Asinowski and Katchalski [3] who proved that this argument is sharp by constructing, for every k, a set of k permutations that are not realizable in R 2k−2 . They also showed that the triple (123456, 321654, 246135) is not realizable in R 3 , a fact that follows easily from our list of obstructions.
In a sense, our work tries to generalize some arguments previously used to analyze geometric permutations in the plane. For example, the (standard) proof that the pair (1234, 2143) is non-realizable as geometric permutations in R 2 essentially analyzes tagged permutations. Indeed, if we augment the permutations by an additional label 0 marking the intersection of the lines realizing the two orders, we get that ( 0 ab, 0 ba), ( 0 ab, ab 0 ), (ba 0 , 0 ba) and (ba 0 , ab 0 ) are forbidden, and there is nowhere to place 0 in (1234, 2143). (See also Section 4 and Observation 12.) We should, however, emphasize that already in R 3 the geometry is much more subtle.
Forbidden patterns were used to bound the number of geometric permutations for certain restricted families of convex sets. For pairwise disjoint translates of a convex planar figure [13,26,27], it is known that a given family can have at most three geometric permutations, and the possible sets of realizable geometric permutations have been characterized. The situation is similar for families of pairwise disjoint unit balls in R d . Here, an analysis of forbidden patterns in geometric permutations showed that a given family can have at most a constant number of geometric permutations (in fact only two if the family is sufficiently large) [24,4,10]. Another example is [1], where it is shown that the maximum number of geometric permutations for convex objects in R d induced by lines that pass through the origin, is in Θ(n d −1) . The restriction that the lines pass through the origin, allows them to deal with permutations augmented by one additional label, and their argument relies on the forbidden tagged pattern ( 0 ab, 0 ba) [1, Lemma 2.1].
In these examples, the bounds use highly structured sets of forbidden patterns. In general, one cannot expect polynomial bounds on the sole basis of excluding a handful of patterns; for instance it is not hard to construct an exponential size family of permutations of [n] which avoids the pattern (1234, 2143). Such questions are well-studied in the area of "pattern-avoidance" and usually the best one could hope for is an exponential upper bound on the size of the family [19].

Semi-algebraic parameterization
Let P = (π 1 , π 2 , π 3 ) denote a triple of permutations of {1, 2, . . . , n}. We now describe a semi-algebraic set that is nonempty if and only if P has a geometric realization in R 3 .

Canonical realizations.
We say that a geometric realization of P is canonical if the oriented line transversals are and if the convex sets are triangles with vertices on x , y and z .

Lemma 4.
If P is geometrically realizable in R 3 , then it has a canonical realization, possibly after reversing some of the permutations π i .
Proof. Consider a realization of P by three lines and n pairwise disjoint sets. For each convex set we select a point from the intersection with each of the lines and replace it by the (possibly degenerate) triangle spanned by these points. This realizes P by compact convex sets. By taking the Minkowski sum of each set with a sufficiently small ball, the sets remain disjoint and the line intersect the sets in their interior. We may now perturb the lines into three lines L x , L y and L z that are pairwise skew and not all parallel to a common plane. We then, again, crop each set to a triangle with vertices on L x , L y and L z .
We now use an affine map to send our three lines to x , y and z . An affine transform is defined by 12 parameters and fixing the image of one line amounts to four linear conditions on these parameters; these constraints determine a unique transform because the lines are in general position. Note, however, that the oriented line L x is mapped to either x or − x , so π 1 may have to be reversed; the same applies to the permutations π 2 and π 3 .
We equip the line x (resp. y , z ) with the coordinate system obtained by projecting the x-coordinate (resp. y-coordinate, z-coordinate) of R 3 . This parameterizes the space of canonical realizations by R 3n . Specifically, we equip R 3n with a coordinate system (O, x 1 , x 2 , . . . , x n , y 1 , y 2 , . . . , y n , z 1 , z 2 , . . . , z n ) and for any point c ∈ R 3n we put Each element of T (c) is thus a triangle with a vertex on each of x , y and z . We define: R = {c ∈ R 3n : T (c) consists of disjoint triangles and realizes P }.
The triple P is realizable if and only if R is non-empty.
Triangle disjointedness. We now review an algorithm of Guigue and Devillers [9] to decide if two triangles are disjoint, and use it to formulate the condition that two triangles X i Y i Z i and X j Y j Z j be disjoint as a semi-algebraic condition on x i , . . . , z j .
The algorithm and our description are expressed in terms of orientations, where the orientation of four points p, q, r, s ∈ R 3 is Intuitively, the orientation indicates whether point s is "above" (+1), on (0), or "below" (-1) the plane spanned by p, q, r, where above and below refer to the orientation of the plane that makes the directed triangle pqr positively oriented. We only consider orientations of non-coplanar quadruples of points, so orientations take values in {±1}.
If one triangle is on one side of the plane spanned by the other, then the triangles are disjoint. We check this by computing  [9]. The renaming is done as follows. Since the first test is inconclusive, the plane spanned by a triple of points separates the other triple of points. We let (A i , B i , C i ) be the circular permutation of (X i , Y i , Z i ) such that A i is separated from B i and C i by the plane spanned by X j , Y j , and Z j . We let (A j , B j , C j ) be the circular permutation of (X j , Y j , Z j ) such that A j is separated from B j and C j by the plane spanned by

Then, the triangles are disjoint if and only if [
Semi-algebraicity. Every step in the Guigue-Devillers algorithm can be expressed as a logical proposition in terms of orientation predicates which are, when specialized to our parameterization, conditions on the sign of polynomials in the coordinates of c. Checking that each of x , y and z intersects the triangles in the prescribed order amounts to comparing coordinates of c. Altogether, the set R is a semi-algebraic subset of R 3n .

Combinatorial lifting
We now explain how to test combinatorially the emptiness of our semi-algebraic set R.

Definitions.
We start by decomposing each orientation predicate used in the definition of R as indicated in Table 1. For the last three rows, this is not a factorization since one of the factors is of the form In light of the third column of Table 1, it may seem natural to "linearize" the problem by considering the map ( Indeed, the order on the lifted coordinates and 1 determines the sign of all polynomials defining R. We must, however, identify the orders on the coordinates in R 6n that can be realized by lifts of points from R 3n . Perhaps surprisingly, the task gets easier if we lift to even higher dimension. For convenience we let R * def = R \ {0, 1}. The lifting map we use is: To determine the image of Λ R 3n * , we will use the following properties of f : and (1, +∞) circularly, and f is monotone on each of these intervals.
Let us denote the points of R 9n by vectors (t 1 , t 2 , . . . , t 9n ). We next "lift" the semi-algebraic description of R: We pick a Boolean formula φ describing R in terms of orientations (for the triangle disjointedness) and comparisons of coordinates (for the geometric permutations).

2.
We decompose every orientation predicate ocurring in φ as in the third row of Table 1.

3.
We then construct another Boolean formula ψ by substituting 2 in φ every f (x 1 ) by the variable t 2 (to which it is mapped under Λ). We similarly substitute every f (x i ), f (y i ) and f (z i ), then every remaining x i , y i and z i by the corresponding variable t * . 4. We let S ⊂ R 9n be the (semi-algebraic) set of points that satisfy ψ.
We finally let H denote the arrangement in R 9n of the set of hyperplanes: Note that the full-dimensional (open) cells in H are in bijection with the total orders on {0, 1, t 1 , . . . , t 9n } in which 0 comes before 1. We write ≺ A for the order associated with a full-dimensional cell A of H.

Lemma 6. Every full-dimensional cell of H is disjoint from or contained in S. Moreover, R is nonempty if and only if there exists a full-dimensional cell of H that is contained in S and intersects Λ R 3n
* . Proof. The set S is defined by the positivity or negativity of polynomials, each of which is a product of terms of the form (t i − t j ) or (t i − 1). The first statement thus follows from the fact the coordinates of all points in a full-dimensional cell realize the same order on {0, 1, t 1 , . . . , t 9n }. By the perturbation argument used in the proof of Lemma 4, if R is non-empty, then it contains a point with no coordinate in {0, 1}. Thus, R is non-empty if and only if Λ(R) is non-empty. The construction of S ensures that Λ(R) = S ∩ Λ R 3n * . Again, a perturbation argument ensures that if Λ(R) is nonempty, it contains a point outside of the union of the hyperplanes of H. The second statement follows.

Zone characterization. Inspired by Lemma 6, we now characterize the orders ≺
We also define an operator f that shifts the variables cyclically within each individual block: By convention, f 0 means the identity. The fact that f mimicks, symbolically, the action of f yields the following characterization.
Proof. Let us first see why the conditions are necessary. To examine sufficiency we need some notations. We let We also write (·, a) ≺ for the set of elements smaller than a, and (a, ·) ≺ for the set of elements larger than a, and We next pick 3n real numbers 1 < r 1 < r 2 < . . . < r 3n , put and let p = (x 1 , . . . , x n , y 1 , . . . , y n , z 1 , . . . , z n ) ∈ R 3n . Note that Λ(p) lies in a full-dimensional cell of the arrangement H; let us denote it by A. Now, 0 precedes 1 in both ≺ * and ≺ A . Also, [1, ·) ≺ * = [1, ·) ≺ A and the two orders coincide on that interval by construction of p. Remark that f acts similarly for both orders: We therefore also have (·, 0] ≺ * = (·, 0] ≺ A and the orders coincide on that interval as well. The same argument applied to f 2 shows that [0, 1] ≺ * = [0, 1] ≺ A and that the two orders coincide on that interval as well. Altogether, ≺ * and ≺ A coincide.

Geometric interpretation of the combinatorial lifting
Let us take a moment to consider the geometric meaning of our parameterization and lifting. Summary. In short, Section 2 reduced our initial problem to the more specialized one of realizing a triple of permutations by the lines x , y , z and triangles with a vertex on each line (Lemma 4). The canonical coordinate system of R 3 induces natural coordinate systems on each of these lines, and we use it to parameterize the positions of the triangles' vertices. The set of parameters that correspond to a geometric realization of our three permutations is then seen to form a semi-algebraic set R. In Section 3, we introduced the lift Λ to analyze R combinatorially provided that we specify some extra information: the comparisons between each variable and the constants 0 and 1 (Lemma 6 and Proposition 7).

Tags.
Let us reformulate this extra information geometrically. Consider three oriented lines in R 3 . Each line can be translated so as to simultaneously intersect the other two lines; we mark these intersection points on the two (non-translated) lines. Altogether, we collect two points per line, which we label 0 and 1 with the convention that 0 comes before 1 in the orientation of the line. Equivalently, these six points can be obtained by considering the unique parallelotope that has three disjoint edges supported by the lines, and marking the vertices of these edges (see Figure 2-left). Now, specifying how t 3i+1 (say for 0 ≤ i < n) compares to 0 and 1 in V is equivalent to specifying where x i lies compared to 0 and 1 on x . The combinatorial lifting therefore highlights that the position of the triangle vertices' with respect to the parallelotope is a useful information for checking geometric realizability.
Analogy with the planar case. A similar observation was used in the plane (see e.g. [16]). Consider two lines in R 2 , crossing in 0 , and a family of segments, where each segment has an endpoint on each line (see Figure 2-right). Every segment lies in a (closed) quadrant formed by the lines, and two segments intersect if and only if they lie in the same quadrant and appear in different orders when seen "from 0 ". The quadrant containing a given segment is determined by the positions of that segment's endpoints with respect to 0 . As mentioned in the introduction, a simple case analysis then yields that (1234, 2143) has no geometric realization in the plane. (See [2, Figure 3.4] for another example of such case analysis.) Changes between two and three dimensions. In the plane, given two permutations and the position of the crossing point of the two lines, either all choices of positions yield pairwise disjoint segments, or none of them does. In R 3 , the polynomials describing whether two triangles are disjoint requires in some cases to compare pairs (Table 1). This makes it possible for two pairs of triangles, one crossing and the other disjoint, to realize the same three tagged permutations, i.e. have their vertices in the same position relative to the parallelotope of the lines.
Tagged permutations and patterns. Formally, we define a tagged permutation as a permutation of { 0 , 1 , 1, 2, . . . , n} in which 0 precedes 1 . We call a triple of tagged permutations a tagged pattern. A canonical realization of a tagged pattern is a set of triangles, with vertices on x , y and z , such that x (resp. y , z ) intersects the triangles in the first (resp. second, third) permutation and such that the tagged corners of the parallelotope appear in the right position on each line.
Our experiments will use two more notions. Two tagged patterns are equivalent for canonical realizability if one can be transformed into the other by (i) relabeling the symbols other than 0 and 1 bijectively, and (ii) applying a circular permutation to the triple. A tagged pattern is minimally forbidden if it has no canonical realization, and deleting any symbol other than 0 and 1 from the three tagged permutations produces a tagged pattern which has a canonical realization.

Algorithm
We now present an algorithm that takes a tagged pattern as input and decides if it admits a canonical realization. Our initial problem of testing the geometric realizability of a triple of permutations of size n reduces to 8 n+2 2 3 instances of that problem.

Outline
Following Sections 2 and 3, we search for an order on {0, 1, t 1 , t 2 , . . . , t 9n } satisfying the conditions of Proposition 7 and the formula ψ (which defines S). To save breath, we call such an order good. We say that triangles i and j are disjoint in a partial order P if for every c ∈ R 3n such that the order on Λ(c) is a linear extension of P, the triangles i and j of T (c) are disjoint.
Our algorithm gradually refines a set of partial orders on {0, 1, t 1 , t 2 , . . . , t 9n } with the constraint that, at any time, every good order is a linear extension of at least one of these partial orders. (Note that we do not need to make ψ explicit.) Every partial order is refined until all or none of its extensions are good, so that we can report success or discard that partial order. Refinements are done in two ways: branching over an uncomparable pair, meaning duplicating the partial order and adding the comparison in one copy, and its reverse in the other copy, forcing a comparison when it is required for the formula S to be satisfiable.
We keep our algorithm as simple as possible to facilitate the verification of the algorithm, the code in Appendix B, and the geometric results proven with their aid. This comes at the cost of some efficiency, but we discuss some possible improvements in Section 5.3.
The graph has 3n vertices, by Lemma 6. To compare two variables, we first retrieve the intervals containing them. If they differ, we can return the comparison readily. If they agree, then up to composing by f or f (2) we can assume that both variables are in (1, ·) and we use the graph to reply. We ensure throughout that the graph is saturated, i.e. is its own transitive closure. In our implementation, initialization takes O(n 3 ) time, elements comparison takes O(1) time, and edge addition to the graph takes O(n 2 ) time.
We start with the poset of the comparisons forced by the tagged pattern: all pairs ( (2) (z j ) as well as pairs separated by 0 or 1. We next collect in a set U the comparisons missing to compute the vectors v(i, j).

Lemma 8. U contains only pairs of the form
Proof. Every orientation predicate considered involves three points of the same index. Table 1, this decomposes into (x i − x j )(y i − 1)(z i − f (y i )) and only the sign of the last term may be undecided. Other cases are similar and show that U can only contain terms the form Every pair in U corresponds to two variables with same index, so |U | ≤ 3n. If U contains the three pairs with a given index, then two of the eight choices for these three comparisons are cyclic, and can thus be ignored. We thus have at most 6 n ways to decide the order of the undeterminate pairs of U ; call them candidates. For each candidate, we make a separate copy of our current graph and perform the following operations on that copy:

1.
We add the |U | edges ordering the undecided pairs as fixed by the candidate and compute its transitive closure. We check that the result is acyclic; if not, we discard that candidate (as it makes contradictory choices) and move to the next candidate.

2.
Let P denote the resulting partial order. We consider every 1 ≤ i < j ≤ n in turn. (Note that v(i, j) is determined and equal for all linear extensions of P.) 6 then triangles i and j are disjoint in P. We move on to the next pair (i, j).
2b Otherwise, the extensions of P in which the triangles i and j are disjoint are those in which [A i , B i , A j , B j ] = 1 or [A i , C i , C j , A j ] = 1 (in the notations of Section 2). Lemma 9 asserts that P already determines at least one of these two predicates.
2b1 If both tests are determined to false, then triangles i and j intersect in P. We then discard P and move on to the next candidate.
2b2 If one test is determined to false and the other is undetermined, then that second test must evaluate to true in every good extension of P. Again, by Table 1 we are missing exactly one comparison to decide that test. We add it to our graph.
2b3 In the remaining cases, at least one test is determined to true, so triangles i and j are disjoint in P. We move on to the next pair (i, j).

3.
If we exhaust all (i, j) for a candidate, then we report "realizable".

4.
If we exhaust the candidates without reaching step 3, then we report "unrealizable".
This algorithm relies on property whose computer-aided proof is discussed in Section 6:

Discussion
Let us make a few comments on our algorithm.

Correctness.
Let P 0 denote the initial poset. First, remark that we explore the candidates exhaustively, so every good extension of P 0 is a good extension of P 0 augmented by (at least) one of the candidates. Next, consider the poset P obtained in step 2. When processing a pair (i, j), we either discard P if we detect that i and j intersects in it (2b1) or we move on to the next pair (i, j) after having checked (2a, 2b3) or ensured (2b2) that triangles i and j are disjoint in P. If we reach step 3, then all extensions of the current partial order are good and we correctly report feasibility. If a candidate is discarded then no linear extension of P augmented by that candidate is a good order. If we reach Step 4, then every candidate has been discarded, so no linear extension of P 0 was a good order to begin with, and we correctly report unfeasibility. Improvements. In practice, the algorithm we presented can be sped up in several ways. For example, it is much better to branch over the pairs of U one by one. Once a branching is done, we can update U by removing the pairs that have become comparable, and thus avoid examining candidates that would get discarded at Step 1. Also, it pays off to record the forbidden tagged patterns of small size, and, given a larger tagged pattern to test, check first that it does not contain a small forbidden pattern.
One-sided certificate. If the algorithm reaches Step 3, we actually know a poset for which every linear extension is good. This means that we can compute an arbitrary linear extension to obtain an order on the variables in (1, ·). We can then assign to these variables any values that satisfy this order, say by choosing the integers from 2 to 3n + 1, and then propagate these values via f and f (2) to all lifted variables. From there, we can extract the values of x 1 , x 2 , . . . , z n of a concrete realization of our tagged pattern. In this way, all computations are done on (relatively small) rationals and are therefore easy to do exactly.

Experimental results
We now discuss our implementation of the above algorithm as well as its experimental use. Remember that we call a tagged pattern forbidden if it admits no canonical realization. We make the raw data available (see Appendix A).

Implementation.
We implemented the algorithm of Section 5 in Python 3, and comment on its key functions in Appendix B. For simplicity, our implementation makes one adjustment to the algorithm: we branch over all 2 |U | choices for the pairs of undecided variables; so, we take 8 choice per k, rather than 6. Altogether, the implementation amounts to ∼ 470 lines of (commented) code and is sufficiently effective for our experiments: on a standard desktop computer, finding all realizable triples of size 6 (and a realization when it exists) takes about 40 minutes, whereas verifying that no minimally forbidden tagged pattern of size 6 exists took up about a month of computer time; the difference of course is that in the former, for realizable triples we do not have to look at all positions of tags.
Proof of Lemma 9. The statement concerns only two triangles and can be shown by a simple case analysis. Our code sets up an exception that is raised if the statement of the lemma fails (cf line 94 in the code in Appendix B.1). Checking the realizability of all tagged patterns on two elements exhausts the case analysis, and the exception is not raised.

Minimally forbidden patterns.
To state the minimally forbidden tagged patterns of size 3 we compress the notation as follows. We use {uv} to mean "uv or vu". Symbols that are omitted may be placed anywhere (this may include 0 and 1 ). We use x i = y j to mean "any pattern in which the ith symbol on the 1st tagged permutation equals the jth symbol of the 2nd tagged permutation". (iii) For size 4, the taggings of (abcd, badc, cdab) that contains , 1 a, a 0 ), and the taggings of (abcd, badc, dcba) that contains (iv) None for size 5 and 6.
Realization database. For every tagged pattern that our algorithm declared realizable, we computed a realization (as explained in Section 5.3) and checked it independently. Proof of Theorem 2. We argue by contradiction. Consider four disjoint convex sets met by lines 1 , 2 in the order abcd and 3 in the order badc; assume that 1 3 = − 2 3 . By the perturbation argument of Lemma 4, we can assume that the three lines are pairwise skew and that the convex sets are triangles with vertices on these lines. Moreover, there exists a nonsingular affine transform A that maps the unoriented lines 1 to x , 2 to y and 3 to z . Remark that A either preserves or reverses all side operators. Since x z = y z and 1 3 = − 2 3 , the map A sends the oriented lines ( 1 , 2 ) to either ( x , − y ) or (− x , y ). We used our program to check that none of (abcd, dcba, badc), (dcba, abcd, badc), (abcd, dcba, cdab), (dcba, abcd, cdab) admits a canonical realization. The statement follows.

Geometric analysis
We present here an independent proof that the tagged patterns of size 2 and 3 listed in Proposition 10 do not have a (canonical) realization. We do not prove the patterns are minimal, nor do we prove that the list is exhaustive; these facts come from the completeness of our computer-aided enumeration.

Size two
The following observation was used by Asinowski and Katchalski [3]: Observation 11. Let X and Y be compact convex sets and let P and Q be points in R 3 . Assume that X, Y, P, Q are pairwise disjoint and that there exist lines inducing the geometric permutation (P XY ) and (QY X). Any oriented line with direction − − → P Q that intersects X and Y , must intersect X before Y . Let h be a plane that separates X and Y . The existence of the geometric permutations (P XY ) and (QY X) ensure that h also separates P and Q. Moreover, the halfspace bounded by h that contains X also contains P , so any line with direction − − → P Q traverses h from the side of X to the side of Y .
Observation 11 implies that (ab 0 , 1 ab, ab), ( 0 ab, ab 1 , ba), (ab 0 , ba 1 , ab), and ( 0 ab, 1 ba, ba), are forbidden. Indeed, consider, by contradiction, a realization of one of these tagged patterns. Let P be the point 0 on x and Q the point 1 on y . In each case, we can map X and Y to a and b so that some line P ∈ { x , − x } realizes P XY and Q ∈ { y , − y } realizes QY X. Then, Observation 11 implies that any line with same direction as the line from P to Q must intersect X before Y ; this applies to the line z and contradicts the fact that the configuration realizes the chosen tagged pattern.

Size three
To argue that the tagged patterns of size 3 of Proposition 10 are forbidden we first need a basic observation concerning planar geometric permutations.

Observation 12.
Suppose the x-axis and the y-axis are transversal to three disjoint convex sets in R 2 . Suppose furthermore that all the sets intersect the x-axis in points Proof. Lets call the sets A 1 , A 2 , A 3 . Up to symmetry we may assume that the sets intersect the x-axis in the points 0 ≤ x 1 < x 2 < x 3 where x i ∈ A i . This means that A 3 is the extreme element of the x-axis. Now suppose for contradiction that A 3 is the middle element of the geometric permutation determined by the y-axis, so the y-axis meets the sets in points y i < y 3 < y j , with y k ∈ A k . If 0 < y 3 , then the segment [x j , y j ] intersects the segment [x 3 , y 3 ], and if y 3 < 0, then the segment [x i , y i ] intersects the segment [x 3 , y 3 ].  are forbidden. The basic idea of the proof of this fact is to show under the given conditions we can find another transversal line that intersects one of the lines x , y , z to obtain a pair of crossing lines where we can apply Observation 12.
For patterns 1-4, the line we are looking for is just a translate of the line z . The translation can be found by considering an appropriate projection. In Figure 3 we see projections of patterns 1-4 to the xy-plane. Specifically: In cases 1 and 3 we see that the line parallel to z which passes through the point c y (the point of c on the line y ) is transversal to all the sets. Therefore we can apply Observation 12 with y as the x-axis and as the y-axis.
In cases 2 and 4 we see that the line parallel to z which passes through the point c x is transversal to all the sets. Therefore we can apply Observation 12 with x as the x-axis and as the y-axis.
For cases 5 and 6 we will need one additional observation: Since a , b and c are in general position, these lines and all their common transversals are contained in a quadric surface H, specifically a hyperbolic paraboloid. The quadric H has two families of rulings, one which contains { a , b , c } and the other that we denote as R. Every line in one family of rulings intersects or is parallel to every line in the other family of rulings.
Consider a space parameterizing the lines of R 3 bicontinuously (for instance via Plücker coordinates) and identify a line with its parameter point. In that space, R forms a closed loop and it contains five points of interest to us: 1 and 2 , as well as three special lines, which are transversals to two of { a , b , c } and parallel to the third one. Let us denote the special lines by * a , * b and * c , where * s is parallel to s . The special lines * a , * b and * c therefore split R into three open arcs, and two line transversals to { a , b , c } realize the same (untagged) geometric permutation if and only if these lines belong to the same arc. Indeed, as a line moves continuously on R, its intersection points with a , b and c change continuously -and in particular the order in which the line meets a , b and c remains unchanged -except as the reaches one of the special line * s : when that happens, the intersection with s jumps from one "end" of to its other "end". Formally, as passes one of * a , * b and * c , the order in which the moving line intersects a , b and c changes by a circular permutation. Now consider the set of lines γ = { (t) : 0 ≤ t ≤ 1}. This is an arc contained in R, bounded by 1 and 2 and, by assumption, not containing * a . It follows that 1 and 2 realize the same geometric permutation of {a, b, c} if and only if γ contains neither * b nor * c . This is precisely the reformulation of the statement.
Let us now get back to proving that the tagged patterns 5 and 6 are forbidden. Notice that in both cases, the directed lines y and − z induce the same permutations. Thus, by Observation 13 there is a continuous family of directed lines { (t) : 0 ≤ t ≤ 1} that are all transversal to the segments a, b and c in the same order; moreover, (0) = y and (1) = − z . Next notice that y and − z lie on opposite sides of the line x (that is, y x = (− z ) x ), so by continuity there exists 0 < t < 1 such that the directed line = (t ) intersects the line x . We now apply Observation 12 to the pair of lines x and .
We start with Case 5. The line intersects the segments in the order b ≺ a ≺ c, and we will consider where the intersection point P = x ∩ fits into this ordering. If the order of intersection along is b ≺ a ≺ c ≺ P , then we can apply Observation 12 with as the x-axis and x as the y-axis. We may therefore assume that P ≺ c. If we in addition have b ≺ P , then it follows that the x-coordinate of P is non-negative. To see this observe that the x-coordinates of the points on segments [b y , b z ] and [c y , c z ] are between 0 and 1, so the same holds for any point on the line which is between b and c, in particular for the point P . Since the points a x , b x , c x all have negative x-coordinates it follows that the line x intersects the points in the order a ≺ b ≺ c ≺ P , and we may therefore apply Observation 12 with x as the x-axis and as the y-axis. The final situation to be considered is if intersects the points in the order P ≺ b ≺ a ≺ c. However the plane {y + z = 1} strictly separates the segment [b y , b z ] from [a y , a z ] ∪ [c y , c z ] ∪ x , and so if the order along was P ≺ b ≺ a ≺ c, this would force to intersect the plane {y = z + 1} twice, a contradiction. Now for Case 6 which is similar. The line intersects the segments in the order b ≺ c ≺ a and we want to place the intersection point P = x ∩ in this ordering. If we have b ≺ c ≺ a ≺ P then we can apply Observation 12 with as the x-axis and x as the y-axis. If we have b ≺ P ≺ a, then the x-coordinate of the point P is at most 1 (since the x-coordinates of the points on the segments [b y , b z ] and [a y , a z ] are between 0 and 1). We may therefore apply Observation 12 with x as the x-axis and as the y-axis. The final situation is the

A Additional material
We provide the following additional material: The python code. See the README.txt file for how to invoke it.
Some output files summarizing the results of our experiments: The list of triples of permutations of size five with, for each, the coordinates of a geometric realization. The triples are normalized in the sense defined in Appendix C.
The list of triples of size six with, for each, either the coordinates of a geometric realization or the statement that none exists.

B Code
We present here the implementation that we used for our experiments. We do not reproduce the entire code as it is not so informative, but explain how its key functions operate. Readers interested in the full code can get it from the url given in Appendix A.

B.1 compute_realization_tagged
The function compute_realization_tagged is the main algorithm. It checks whether a given triplet of tagged permutations is canonically realizable, and output a realization if the answer is positive.
Our algorithm first consists of collecting the information that is missing to compute the sign vectors of Guigue-Devillers' algorithm in a set U . As stated in Lemma 8, it only contains specific pairs, such as x k − f (z k ), which are encoded by the number associated with x k . The numbers of x i , y j and z k are i, n + j and 2n + k, respectively.
In M we keep the transitive closure of the adjacency matrix of the graph that collects the orientations induced by the tagged permutations and by the current orientations of the elements in U . This graph represents the poset of the relative orders of the variables greater than one: if x 2 is between 0 and 1, the associated vertex number 2 represents f (x 2 ) and if y 1 is smaller than 0, the associated vertex n + 1 represents f 2 (y 1 ).
Auxiliary functions. The function compute_realization_tagged uses the following simple algorithms, for which we do not give the code here: compute_base_graph build the adjacency matrix of the graph with an edge v → w whenever v and w are on the same line, in the same interval, and v is before w in the associated permutation. transitive_acyclic(M) add an edge v → w whenever there is a non-trivial path from v to w, using Warshall algorithm. Halts and return false if M is not acyclic. add_edge_closure(M,v,w) add an edge v → w and update the transitive closure. topological_sort(M) compute an ordering of the vertices compatible with the graph, using the classical depth-first algorithm.

Code of the function.
1 def c o m p u t e _ r e a l i z a t i o n _ t a g g e d ( p e r m _ t r i p l e t , t a g _ t r i p l e t ) :  Notice line 94 of the code, which sets up an exception. The fact that it is never raised as we examine all tagged patterns on two elements is what proves Lemma 9.

B.2 compute_initial_orientation and compute_last
These two functions are used to compute orientations. Note that, because of the very specific underlying determinants, we compute them "by hand" instead of relying on computer algebra system. v(i, j)). The first one is called while building the sign vectors, collecting unknowns in U . We are therefore only interested in orientations of (X i , Y i , Z i , L j ), which factorizes as (z i − z j )(x i − 1)(y i − f (x i )) or alike. The sign of the first factor is given by a permutation, the one of the second factor by the tags, so it only remains to compare y i to f (z i ): if they are not in the same interval it is determined, otherwise we add it in U . Second step (relabelling and final condition). The second one is more complicated, since it is called when computing the last two orientations of Devillers-Guigue's algorithm and any situation can occur. So we first sort the points (while computing the number of inversions performed to have a correct sign), then refer to Table 1. Once again, either we have the required information directly or in M , or we output the missing v − f (w) as a pair (v, w). Note that the code is quite long on purpose, to stick with Table 1: a more factorized code would be more difficult to read.

B.3 output_realization
We conclude this presentation of the main parts of the code with function output_realization, which computes a realization. It simply ranges through the vertices in the order given by the topological sort, and assigns a value from 2 to 3n + 2 to the associated variable known to be larger than 1: it is then brought back to the correct interval by applying f or f 2 if needed.

C Forbidden triples of size six
We finally present in a normalized form the complete list of triples of permutations of size 6 that are not geometrically realizable in R 3 .
The normalization goes as follows. Recall that we write permutations as words, so we can order them using the lexicographic order on the associated words. Starting from a triple (P 1 , P 2 , P 3 ) of geometric permutations, consider the six triples obtained by the following method: Choose P 1 , P 2 , P 3 or one of their reverse as first permutation. Relabel so that this first permutation becomes the identity, and propagate the relabeling to the other two permutations and their reverses. Pick as second permutation the lexicographically smallest one among the two remaining (relabelled) permutations and their (relabelled) reverses. Pick as third permutation the lexicographically smallest one among the remaining (relabelled) permutation and its (relabelled) reverse.
The normalization of (P 1 , P 2 , P 3 ) is, among these six triples, the one that is lexicographically smallest (smallest first permutation, then among tied, smallest second permutation, etc.).
The next table lists the normalized triples of permutations that are not geometrically realizable in R 3 .