The undecidability of joint embedding for 3-dimensional permutation classes

As a step towards resolving a question of Ru\v{s}kuc on the decidability of joint embedding for hereditary classes of permutations, which may be viewed as structures in a language of 2 linear orders, we show the corresponding problem is undecidable for hereditary classes of structures in a language of 3 linear orders.

However, we believe there is a strong possibility Ruškuc's problem is undecidable in general. We are not aware of many undecidability results in the permutation class literature, although Garrabrant and Pak (2015), using methods that seem quite different from ours, proves an undecidability result about comparing the parity of the number of permutations of size n in two permutation classes.
The author took a first step towards Ruškuc's problem in Braunfeld (2019), proving the JEP is undecidable for hereditary graph classes. Although it is not yet clear whether that proof can be adapted to permutations, we here adapt it to 3-dimensional permutations, i.e. structures in a language of 3 linear orders, proving the following theorem via a reduction from the string tiling problem. Theorem 1.3 There is no algorithm that, given a finite set of forbidden 3-dimensional permutations, decides whether the corresponding 3-dimensional permutation class has the JEP.
A very rough sketch of the proof is as follows. We use a reduction from the (string) tiling problem, which asks whether we can tile an infinite grid using a given collection of tile types, subject to local constraints. The first two steps below ensure that the tiling problem is equivalent to whether we can jointly embed two particular 3-dimensional permutations, and the third step ensures that joint embedding for the class is equivalent to joint embedding for those two 3-dimensional permutations.
1. Construct two 3-dimensional permutations A * , representing a grid, and B * representing a suitable collection of tiles.
2. Choose a finite set of constraints to ensure that if C jointly embeds A * and B * , then it encodes a solution to the string tiling problem.
3. Show that if the string tiling problem admits a solution, then the chosen class has joint embedding.

The (string) tiling problem
Rather than using a reduction from the halting problem to prove undecidability, we will use the string tiling problem, a variant of the tiling problem. The input to a tiling problem consists of a finite set T iles of tile types, as well as a set of rules of the form "Tiles of type i cannot be placed directly above tiles of type j" and "Tiles of type k cannot be placed directly right of tiles of type ". A solution to a tiling problem is a surjective function τ : N 2 → T iles, interpreted as placing tiles on a grid, that respects the tiling rules.
Theorem 2.1 (Berger (1966)) There is no algorithm that, given a sets of tile types and tiling rules, decides whether the corresponding tiling problem has a solution.
We will use a variant, called string tiling problems in Cherlin (2011). Here there are only two tile types, but there is some D ∈ N such that for every d ≤ D, tiling rules may restrict which tiles are placed at distance d to the right of a given tile, or directly above a given tile. An encoding of tiling problems as string tiling problems is given in Lemma 7.6 of Cherlin (2011), the idea being to use several tiles in the string tiling problem to encode a single tile from the standard tiling problem. This proves the analogue of Theorem 2.1 for the string tiling problem.
As we will be reducing from the string tiling problem, which is co-recursively enumerable, we point out here that if C is a hereditary class of finite structures in a finite relational language, then the JEP for C is also co-recursively enumerable. To see this, consider A, B ∈ C that can be jointly embedded, as witnessed by C ∈ C and embeddings f : A → C and g : B → C. As C is hereditary, the substructure of C induced on f (A) ∪ g(B) is also in C. Thus, given A, B ∈ C, |A| + |B| is a bound on the size of the possible witnesses for joint embedding, and they can be exhaustively checked.

The argument for hereditary graph classes
We will now sketch the argument from Braunfeld (2019) for hereditary graph classes (in an expanded language with colored vertices and edges, and both directed and undirected edges), since our argument in this paper will attempt to re-encode it using 3-dimensional permutations. Although we are concerned with the JEP for finite structures in a hereditary class C, the compactness theorem implies that the JEP for the finite members of C is equivalent to the JEP for countable members of C. Rather than work with families of increasingly large finite structures, we prefer to take our canonical models to be countable. Fig. 1: A portion of the canonical models A * G and B * G , with the grid points in A * G tiled by tiles attached to grid points with the same coordinates in B * G . Path points are blue, with the origin a different shade. Grid points are red, their y-coordinate determined by an orange edge and their x-coordinate by a green edge. Tile points are purple. Points in 0-superscripted predicates have a black border, while points in 1-superscripted predicates do not. This encodes a tiling of (0,0) with tile-type 2, (1,0) with tile-type 2, and (2,0) with tile-type 1.
Suppose we are given a tiling problem T . First, we describe graphs corresponding to A * and B * from the rough sketch in the introduction. A * G (see Figure 1) will contain a 1-way infinite directed path. To every pair of points in this path, we attach a point, representing a grid point with coordinates taken from the attached path points. Because we must distinguish between x and y-coordinates, we use the colored edges to attach each grid point to its coordinates. Furthermore the path points are colored distinctly from the grid points, and the origin of the path is also colored distinctly. B * G will look like a copy of A * G , although using a disjoint set of vertex colors. Furthermore, to each grid point in B * G , path of length t (where t is the number of tile types in the given tiling problem), using a new color for these points. These represent a full tile set available at each coordinate, with the different tile-types being distinguished by their distance from the corresponding grid point.
We then choose our constraints so that when we try to jointly embed A * G and B * G , the following is forced: for every grid point in A * G , with coordinates (x, y), we must add an edge to one tile point attached to the grid point in B with the same coordinates. This is interpreted as tiling the point (x, y) by the corresponding tile-type, and our constraints should further enforce the local tiling rules.
As A * G and B * G will be in our hereditary class C T , if C T has the JEP, then T must have a solution, since we can read a valid tiling off the structure embedding A * G and B * G . We must then show that if T has a solution τ : N 2 → T iles, then we may jointly embed any A, B ∈ C T . For this, we add a variety of additional constraints ensuring that if we must add edges due to the constraints in the previous paragraph, and thus are attempting to encode a valid tiling, then A and B look approximately like one of our canonical models A * G and B * G . Crucially, we ensure that every grid point involved in our attempted tiling has unique coordinates (x, y) on a unique path; we thus have a well-defined input to give to τ , and add edges from grid points in A to tile points in B (or vice versa) as τ dictates.
The additional difficulties with (3-dimensional) permutations arise from the transitivity of the orders, which places severe limitations on how we may jointly embed a given pair of structures. Also, some concerns that are in common with the graph case shift in their difficulty. A key point in the graph case is that grid points and tile sets have unique coordinates. While that was simple to enforce in the graph case, it, and even the proper definition of coordinates, will be a significant concern here. On the other hand, the point of most concern in the graph case was ensuring that none of the configurations used to encode unary predicates were accidentally created by our joint embedding procedure, i.e. our method for constructing a third structure jointly embedding two given structures. Here this problem will be trivialized by taking advantage of the third linear order, but it returns to the fore when working with permutation classes.

Preliminary definitions
We first mention that the primary reason for using a third linear order is to obtain the first claim at the beginning of Lemma 6.3. The third order can largely be ignored otherwise, which may help in picturing the constructions.  Bóna and Spielman (2000). The root is 13.
We choose an antichain A of 3-dimensional permutations on which < 1 = < 3 opp , i.e. the opposite order of < 3 , and containing at least 20 members (10 are used for the unary predicates in this section, and we will double that number later), which we will use to encode unary predicates, which may be thought of as coloring points. We also require that each element of A have at least 5 points, and that the < 1 -greatest, < 1 -least, < 2 -greatest, and two < 2 -least points of each element are distinct, with the < 1 -greatest point < 2 -below the < 1 -least point. For example, let A be the infinite antichain from Bóna and Spielman (2000) (see Figure 2; in this figure and all others, < 1 is horizontal and < 2 is vertical), with the third order defined by and let E be the set of these members. Elements with a 0-superscript will be used to encode grid points, i.e. structures like the graph A * G and their coordinates, while those with a 1-superscript will encode tile sets and their coordinates, i.e. structures like the graph B * G . If E ∈ E, we say x is the root of E if it is the < 1 -least point. We will think of roots as actually representing points in the colored graph we are trying to encode, and almost all other points as being auxiliary to assist the encoding.
We also define the following unary predicates.
Note that we do not encode points representing tile-type 2 by roots. Since these will always be paired with points representing tile-type 1, we instead represent tiles by two different points in E 1 T . The antichain condition is meant to stop the following kind of situation. Suppose that E 0 P embedded into E G 0 . Then whenever we encode a grid point by adding a copy of E G 0 , we would also be adding a copy of E P 0 , and thus unintentionally be adding a path point. In addition to encoding unary predicates, we will use elements of E to encode edges between their roots and other points, using the following notion of capture.
Given a point x and E a copy of an element in E\ { E 1 T }, we say x is captured by E if x is < 2 -between the two < 2 -least points of E, E < 1 x, and E < 3 x. This should be thought of as encoding a graph edge between x and the root of E.
An example of capture is shown in Figure 3. There are two copies of an element of E projected onto < 1 and < 2 , although the left copy should be taken < 3 -below the right copy. We view this as encoding a directed edge from the root of the left copy to the root of the right copy, and we may encode a directed path by continuing to daisy-chain such copies.
Before giving the remaining definitions, we discuss the stylized portion of the canonical models shown in Figure 4, which should be compared to the graph version in Figure 1. We have projected onto < 1 and < 2 , and we will later see that < 3 will be determined by < 1 . Since the precise structure of the elements of E is unimportant, copies of those elements are represented by colored lines with two < 2 -least points marked to display capture. As in Figure 1, the blue points represent path points, with the origin a different shade. Grid points are in red and tile points in purple, with their x-coordinates determined by the path point captured by the copy of E i X denoted in green, and their y-coordinates determined by the path point captured by the copy of E i Y denoted in orange. Pairs of tiles at a given coordinate are connected by a line, with the tile of type 2 above and right of the tile of type 1. Finally, the copies of E 0 G are the black lines connected to grid points, and they capture a tile from the pair of tiles at the corresponding coordinate. If the dividing line between A * <1 and B * <1 is ignored, this picture encodes a tiling of both (0, 0) and (1, 0) with tile-type 2. The dotted horizontal lines separate different regions of the picture, but are not part of the structure. The following definitions may all be seen in Figure 4, with the exception that the P i -paths shown only have length 2 instead of being infinite.
We say x ∈ G 0 is tiled by y ∈ T 1 if x is the root of a copy of E 0 G that captures y.
We say t 1 ∈ T 1 1 and t 2 ∈ T 1 2 form a tile set if there exists E a copy of E 1 T with root t 1 and < 2 -greatest point t 2 .
Given a point g ∈ G 0 and x, y ∈ P 0 or g ∈ T 1 1 and x, y ∈ P 1 , we say g is coordinatized by (x, y) if g is the root of a copy of E 0 X that captures x and of E 0 Y that captures y (or in the second case, we use E 1 X and E 1 Y ). We say p is a path-successor of p if p, p ∈ P i and p is the root of a copy of E i P or E i O that captures p . We say h is a horizontal successor of g if g, h ∈ G 0 or g, h ∈ T 1 1 and there are x, y, x ∈ P 0 (or P 1 in the second case) such that g is coordinatized by (x, y), h is coordinatized by (x , y), and x is a path-successor of x. Vertical successor is defined similarly, but h is coordinatized by (x, y ) and y is a path-successor of y. Horizontal predecessor and vertical predecessor are defined conversely.
We define an infinite one-way P i -path to be a copy of E i O with root p 0 and a sequence of copies of E i P , with roots (p 1 , p 2 , . . . ) arranged such that p k+1 is captured by the copy of E i P (or E i O ) rooted at p k , and the copy of E i p (or E i O ) rooted at p k is < 1 -below that rooted at p k+1 . In this case, we say p 0 is the path-origin of the path. We We say g is on the x-axis if y ∈ O i (for the appropriate i), and g is on the y-axis if x ∈ O i (we will sometimes also refer to a tile set being on an axis if its first tile is). Note that a grid-origin or tile-origin is on both the x-axis and y-axis.
We define a connector interval to be the open < 2 -interval defined by the two < 2 -least points of a copy of E 0 G . We define a tile set interval to be the open < 2 -interval defined by the < 1 -least point and the < 2 -greatest point (i.e. by the two tiles) of a copy of E 1 T . Finally, we define a special interval to be either a connector interval or a tile set interval.
Given a special interval defined by some E ∈ E, we call the < 2 -greater endpoint of the special interval its top endpoint, and the < 2 -lesser endpoint its bottom endpoint.
Although we defined a special interval as a < 2 -interval corresponding to a copy of an element of E, we will often conflate the special interval with its corresponding copy of an element of E. However, intersection of special intervals will always refer to intersection of the < 2 -intervals.

The canonical models
Our proof proceeds in two steps. First we prove the undecidability of the < 1 -JEP, defined below, following the rough sketch from the introduction. This will be finished by Section 6.1. Then, in Section 6.2, we quickly reduce from the < 1 -JEP to the JEP. In this section, we describe our canonical models for the first step.
Definition 3.1 We say that a class of 3-dimensional permutations has the < 1 -JEP if it admits a joint embedding procedure in which, given factors labeled A and B, the procedure places A < 1 B.
We now describe our canonical models A * <1 and B * <1 for the < 1 -JEP, corresponding to the graphs A * G and B * G from §2.2. We only describe < 1 and (sometimes) < 2 , since < 3 will be determined as follows: if x, y are in the same copy of an element of E that we specify below, then x < 1 y ⇐⇒ x > 3 y. Otherwise, x < 1 y ⇐⇒ x < 3 y. Note that this will ensure that the only copies of elements of E appearing in either A * <1 or B * <1 will be those specified below. For suppose there is some further, unintended copy E of an E ∈ E. By the antichain condition, it cannot embed into any single copy of an E ∈ E, so there must be x, y ∈ E occurring in two distinct specified copies of elements of E. Suppose that x < 1 y, so then x < 3 y. But this contradicts that < 1 and < 3 disagree within E.
It would be helpful to keep in mind the image of part of A * <1 and B * <1 given in Figure 4 when reading the following construction. We start constructing A * <1 by placing an infinite one-way P 0 -path with roots (p 0 , p 1 , . . . ). Then, < 1 -below and < 2 -above the path, we place a sequence of points indexed by N 2 , increasing antilexicographically with respect to < 1 and < 2 (we say (x, y) < antilex (x , y ) if y < y or y = y and x < x ); so, identifying a point with its indices, if g < antilex g then g < 1,2 g . We now make each such point, which we will call grid points, the root of 3 different copies of elements of E. Consider the point g indexed by (x, y). We make g the root of a copy E g, 4. Let g < antilex g . Then for every E, E ∈ E (not necessarily distinct), any copy of E rooted at g is < 1 -less than any copy of E rooted at g . Furthermore, E g,G < 2 E g ,G .
We construct B * <1 similarly, except using 1-superscripted elements of E instead of 0-superscripted elements, and using copies of E 1 T instead of E 0 G . As in the graph case, we will choose our constraints so that when performing the < 1 -JEP on A * <1 and B * <1 , i.e. constructing a C that jointly embeds both, we will be forced to tile each grid point in A * <1 by a tile from the corresponding tile set in B * <1 .

Picturing joint embedding
In this subsection, we refer back to Figure 4 to help picture the process of performing < 1 -joint embedding. This should explain some choices we made in constructing our canonical models and should help motivate some of the constraints in the next section. Also, although Figure 4 depicts the canonical models, what we say will apply to any 3-dimensional permutations we consider. Suppose we want to < 1 -joint embed the structures A = A * <1 and B = B * <1 depicted in Figure 4. We must place A < 1 B. We will also choose to place A < 3 B since, as in the construction of our canonical models, this will mean we don't create unintended copies of elements of E. Given this choice, our only freedom is in determining the < 2 -relation between points in A and points in B. We may view our procedure as erasing the dividing line between the two structures, keeping the points in A fixed, and keeping the horizontal positions of the points in B fixed but being able to slide them around vertically while maintaining their vertical ordering. By sliding the points around, we may make certain special intervals in A and B intersect, and in particular make certain tiles fall into corresponding connector intervals. Figure 4 was drawn so that minimal sliding is required. If we just erase the line and leave all the points fixed, this produces a tiling of both (0, 0) and (1, 0) by 2-tiles. If we instead wish to tile (0, 0) by a 1-tile, we may slide the two tiles at (0, 0) upwards while keeping all other points fixed until the 1-tile falls into the connector interval at (0, 0) in A and the 2-tile falls out. (Since we are keeping the tiles at (1, 0) fixed, the tiles at (0, 0) will also be "compressed" closer together as we slide them upward. But this is an artifact of the picture, since in the actual structures there is no notion of distance, just relative ordering.) Our freedom to move the tile set at (0, 0) independently of the tile set at (1, 0) stems from the fact that they form disjoint < 2 -intervals.
Also note that it is crucial that given an enumeration of the coordinates, the connector intervals in A and the tile sets in B occur in the same < 2 -order. For if A were unchanged but the (0, 0)-tile set appeared < 2 -above the (1, 0)-tile set in B, then it would be impossible for both the connector intervals in A to capture tiles from the corresponding tile set. In the canonical models, the disjointness and ordering are ensured by point (4), requiring that the connector intervals and tile set intervals are < 2 -increasing when ordered antilexicographically.

Constraints
For a given string tiling problem T , we now describe the forbidden substructures in our class P T , which will impose constraints on arbitrary 3-dimensional permutations in our class and how they may be jointly embedded. We will give some discussion of the constraints before listing them, dividing them into three groups.
The first group of constraints is meant to ensure that when we attempt to perform < 1 -joint embedding on the canonical models, we must produce a solution to T . This includes Constraints 7, 8, and 12. In §2.2, we noted that we would wish our constraints to force a grid point to be tiled using a tile from a tile set with the same coordinates. However, as we are forbidding a finite number of finite structures, our constraints must have a local character. Since determining the coordinates of a grid point requires walking back to the origin, and thus looking at an unbounded number of vertices, we cannot use our constraints to directly say that a grid point with given coordinates should be tiled using the tile set with the same coordinates. Instead, we will start the tiling at the origin (Constraint 7), and then propagate it by local constraints (Constraint 8). Finally, Constraint 12 ensures this tiling gives a valid solution of T .
The next group of constraints is meant to ensure that elements of P T look like the canonical models in certain ways. This includes Constraints 1-6. These ensure that the origin, path, and grid points/tile sets actually encode something grid-like. They also enforce some conventions we chose for the canonical models, such as that the grid points/tile sets should be antilexicographically increasing in < 2 . We would like to demand even more from the structures in P T : for example, we would like every path to have an origin point, or every grid point to have coordinates from a path. However, we cannot enforce such "totality" conditions since P T must be closed under substructure, so we must allow for partial structures.
In addition to allowing for partial grids, we don't impose any constraints to ensure the uniqueness of grids or paths, so a structure in P T can have multiple distinct paths each with its own grid attached. While we could enforce uniqueness by forbidding substructures, this would require us to make points in distinct factors equal when performing joint embedding (for example, if we demand a unique path origin, then if there is a path origin in each factor, they must be identified with each other). While this may be viable, it seemed as though it would greatly increase the complexity of the arguments.
Our final group of constraints is concerned with the intersection of special intervals, primarily to control the interaction between multiple copies of a grid, some of which may be partial grids. For example, if we have multiple grids of connector intervals in a single structure, all connector intervals with given coordinates (x, y) should intersect, otherwise we could not insert a given tile into all of them when performing joint embedding. This group, which will play a more technical role, includes Constraints 7-11.
The reason for the overlap between the first and last groups is that forcing tilings is essentially a special case of forcing the intersection of special intervals. If I G is a connector interval and I T a tile interval, then the grid point of I G is tiled by a tile from I T if and only if I G and I T intersect and I G < 1,3 I T .
Given a string tiling problem T , we now define a class P T of 3-dimensional permutations by forbidding substructures to enforce the constraints below. Some constraints are initially described informally, with the formal description of the forbidden substructures nested below. For a few other constraints, we describe the forbidden substructures after the entire list.
1. Path points have at most 1 predecessor and at most 1 successor.
2. Path origins have no predecessor.
3. Special intervals are coordinatized by at most one pair of points.
4. Path points, and their associated copies of E i P (or E i O ), are < 2 -below all copies of E 0 G and E 1 T .
5. Special intervals are antilexicographically increasing in < 2 with respect to their coordinates.
(a) Let I, I be a pair of special intervals, with I a horizontal or vertical successor of I. Then I < 2 I .
(b) Let I, I be a pair of special intervals. Suppose that I is on the y-axis, and I has a horizontal predecessor I hp with I hp < 2 I . Then I < 2 I .
6. No point can belong to a copy of both a 0-superscripted and 1-superscripted element of E 7. All special intervals corresponding to grid-origins or tile-origins intersect. Furthermore, if I 0 corresponds to a grid-origin and I 1 to a tile-origin and I 0 < 1 I 1 , then I 0 < 3 I 1 .
8. Two special intervals must intersect if their respective predecessors intersect.
Let I, I be special intervals.
(a) Suppose I is on neither the x nor y-axis. Suppose I has horizontal predecessor I hp and vertical predecessor I vp , and I has horizontal predecessor I hp and vertical predecessor I vp . If I hp intersects I hp and I vp intersects I vp , then I must intersect I .
(b) Suppose I is on the x-axis. Suppose I has horizontal predecessor I hp and I has horizontal predecessor I hp . If I hp intersects I hp , then I must intersect I .
(c) Suppose I is on the y-axis. Suppose I has vertical predecessor I vp and I has vertical predecessor I vp . If I vp intersects I vp , then I must intersect I .
Furthermore, if I < 1 I in any of the above cases, then I < 3 I .
9. If two special intervals intersect, then their respective predecessors must intersect.
Let I, I be special intervals (allowing I = I ).
(a) Suppose I is on neither the x nor y-axis. Suppose I has horizontal predecessor I hp and vertical predecessor I vp , and I has horizontal predecessor I hp and vertical predecessor I vp . If I intersects I , then I hp must intersect I hp and I vp must intersect I vp .
(b) Suppose I is on the x-axis. Suppose I has horizontal predecessor I hp and I has horizontal predecessor I hp . If I intersects I , then I hp must intersect I hp .
(c) Suppose I is on the y-axis. Suppose I has vertical predecessor I vp and I has vertical predecessor I vp . If I intersects I , then I vp must intersect I vp .
10. If I 1 , I 2 , and I 3 are special intervals, and I 1 and I 2 intersect I 3 , then I 1 and I 2 intersect.
11. Let I and I be special intervals that intersect, and suppose I is on the x-axis (resp. y-axis). If I is coordinatized, then I is on the x-axis (resp. y-axis).
12. The tiling rules of T are respected.
We now describe the forbidden substructures corresponding to Constraints 2, 3, 11, and 12. For Constraint 2, we first forbid any structure consisting of a copy of E i O with its root captured by a copy of E i P . Note that this corresponds to several forbidden substructures, since there are many ways the points of the copy of E i O can interleave with those of the copy of E i P in < 2 , while still having the root of E i O be captured. This will be true in all other constraints, i.e. the forbidden configurations we describe will correspond to many forbidden substructures, depending on how the points of the copies of the elements of E interleave. For Constraint 2, we also forbid any structure consisting of a copy of E i O with its root captured by another copy of E i O . For Constraint 3, we forbid any structure consisting of two copies of E i X (or of E i Y ) intersecting at their root. We also forbid any copy of E i X or E i Y capturing two points that are in P i . For Constraint 11, we forbid any structure consisting of the intervals I and I as described, where the x-coordinate (resp. y-coordinate) of I is in O i and the x-coordinate (resp. y-coordinate) of I is in P i \O i .
For Constraint 12, suppose T forbids a tile of type j at distance d to the right of (resp. above) a tile of type i. Then we forbid any substructure consisting of g, g ∈ G 0 such that g is a d-fold horizontal (resp. direct vertical) successor of g (note that this implies the existence of suitable copies of E 0 G , E 0 X , E 0 Y , and E 0 P ), t ∈ T 1 i , t ∈ T 1 j such that t is the d-fold horizontal (resp. direct vertical) successor of t, and finally g is tiled by t and g is tiled by t .

Weak coordinates
When we perform joint embedding on two structures A and B, where A contains a G 0 -grid, and B a grid of tile-sets, Constraints 7 and 8 will force that the connector intervals in the G 0 -grid in A are tiled using points from B, since tiling is a particular case of special intervals intersecting, as discussed before the constraint list. However, connector intervals may be forced to capture tiles for other reasons.
Consider the following scenario. There is a connector interval I ⊂ A that is part of the G 0 -grid and another connector interval I ⊂ A that is part of another G 0 -grid that is missing a grid-origin. Constraints 7 and 8 will not force us to tile I . However, it may be that the endpoints of I are < 2 -between the endpoint of I , so by tiling I we must also inadvertently tile I . Then, if I has successors in its own partial G 0 -grid, Constraint 8 takes effect and we may be forced to tile them as well.
We see that in addition to the tiling of a connector interval being forced by the usual propagation along coordinate paths, the tiling can also be forced due to intersection properties, and then propagate as usual. Thus, in addition to considering a special interval to have coordinates (x, y) if it is coordinatized by the x th and y th points on a path with a path-origin, we will also want to consider all special intervals that intersect such intervals to have coordinates (x, y).
Definition 5.1 Given a special interval I, we say I is weakly coordinatized by (x, y) ∈ N 2 if one of the following cases holds.
2. x = 0, y = 0: I has a vertical predecessor weakly coordinatized by (0, y − 1) or intersects some special interval I with such a predecessor.
3. x = 0, y = 0: I has a horizontal predecessor weakly coordinatized by (x − 1, 0) or intersects some special interval I with such a predecessor.
4. x, y = 0: I has a horizontal predecessor weakly coordinatized by (x − 1, y) and a vertical predecessor weakly coordinatized by (x, y − 1), or intersects some special interval I with such predecessors.
We say a point is weakly coordinatized by (x, y) if it is an endpoint of some special interval, i.e. either part of a tile set or one of the two < 2 -least points of E 0 G , weakly coordinatized by (x, y). In the definition above, instead of specifying that I has weak coordinates (x, y) if it intersects an appropriate I , we might have only required that there is a chain of special intervals (I 0 = I, I 1 , . . . , I n = I ) with each I i intersecting I i+1 . But then by Constraint 10, we would have I intersects I , so this does not yield anything new.
We will now show that several properties enforced by our constraints for our earlier notion of coordinates will also hold for weak coordinates.
Lemma 5.2 The weak coordinates of special intervals are unique.
Proof: Suppose I has weak coordinates (x, y) and (x , y ). First, suppose (x, y) = (0, 0). Then I must intersect a grid origin or path origin J (allowing I = J), and also I intersects a special interval J (allowing I = J ) such that J has predecessor(s) with weak coordinates (x − 1, y ) and/or (x , y − 1), so J has coordinates on a path. By Constraint 10, J and J intersect. By Constraint 11, the x and y-coordinates of J must be path origins, and so cannot have predecessors, which is a contradiction. Now suppose (x, y), (x , y ) = (0, 0), with (x, y) < antilex (x , y ). We will further suppose x, x = 0, y, y = 0, although we will return to these cases afterward. By induction, we may assume all special intervals with weak coordinates antilexicographically less than (x, y) have unique weak coordinates.
Then we may find special intervals J and J (possibly equal to I) such that the following hold.
(i) J and J intersect I, and thus intersect each other.
As J and J intersect, by Constraint 9 the horizontal predecessor of J must intersect that of J , and similarly for vertical predecessors. By induction, we may assume the predecessors of J and J have unique weak coordinates. Thus we have x = x , y = y .
In the case y = 0 (the case x = 0 is similar), we must also have that y = 0 by Constraint 11. We then only get horizontal predecessors for J and J , but we may still finish as in the previous case. 2 Lemma 5.3 All special intervals weakly coordinatized by (x, y) intersect.

Proof:
We proceed by antilexicographic induction on (x, y). If (x, y) = (0, 0), then this is immediate from Constraint 7. Otherwise, assume x, y = 0 (as in Lemma 5.2, these cases just require using Constraint 11 and a single predecessor), and let I 1 , I 2 have weak coordinates (x, y). Then I 1 intersects a special interval I 1 such that I 1 has a horizontal predecessor weakly coordinatized by (x − 1, y) and a vertical predecessor weakly coordinatized by (x, y − 1), and I 2 similarly intersects some interval I 2 . By induction, the respective predecessors intersect. Thus by Constraint 8, I 1 and I 2 intersect, and so I 1 and I 2 intersect by Constraint 10. 2 Corollary 5.4 (1) Suppose a is the endpoint of a special interval I and is < 2 -between 2 points weakly coordinatized by (x, y). Then a is weakly coordinatized by (x, y).
(3) Suppose I is weakly coordinatized by (x, y). If x, y = 0 and I hp and I vp are horizontal and vertical predecessors of I, then I hp is weakly coordinatized by (x − 1, y) and I vp by (x, y − 1). If y = 0 (resp. x = 0), the same holds, but only with I hp (resp. I vp ).
Proof: (1) Suppose a is < 2 -between b, c weakly coordinatized by (x, y). If b, c belong to the same copy of an element of E, then that copy intersects I, and we are done by Lemma 5.3. If b, c belong to different copies of elements of E, their respective special intervals intersect each other by Lemma 5.3, and so intersect I, and we are again done.
(2) If not, there would be a pair of non-intersecting tile-intervals weakly coordinatized by (x, y), contradicting Lemma 5.3.
(3) If not, the weak coordinates of I would not be unique, contradicting Lemma 5.2. 2 Lemma 5.5 Suppose I is weakly coordinatized by (x, y), I is weakly coordinatized by (x , y ), and (x, y) < antilex (x , y ). Then I < 2 I .
Proof: Fix I with weak coordinates (x, y) and I with weak coordinates (x , y ). By induction, it is sufficient to consider the cases (x , y ) = (x + 1, y) and (x , y ) = (x , y + 1).
Claim 1 Let I, I , J, J be special intervals. Suppose I intersects I , J intersects J , and I < 2 J . Then I < 2 J.
Proof of Claim: Suppose not. Then I must intersect J. But then by Constraint 10, I must intersect J . ♦ First assume (x , y ) = (x + 1, y). Then I intersects some interval J with a horizontal predecessor J hp weakly coordinatized by (x, y), which in turn intersects I by Lemma 5.3. By Constraint 5(a), we have J hp < 2 J , and so I < 2 I by the Claim. By induction, we get the same result for (x , y ) = (x + i, y), i > 0.
The case (x , y ) = (x , y + 1) is similar, though more involved. Then, I intersects some interval J with a vertical predecessor J vp weakly coordinatized by (x , y). If x < x , then by the previous case, I < 2 J vp , and if x = x then I intersects J vp by Lemma 5.3. As J vp < 2 J by Constraint 5(a), the Claim gives J vp < 2 I , and so I < 2 I .
So suppose x = x + i, i ≥ 0. It suffices to consider the case x = 0, since increasing x only increases the < 2 -position of I , by the first case. We proceed by induction on i, with the case i = 0 handled above. We get J vp as above, and similarly get that I intersects some interval J with a horizontal predecessor J hp weakly coordinatized by (x + (i − 1), y). By induction, J hp < 2 I . Then by Constraint 5(b), J < 2 I , so the Claim gives I < 2 I . 2 6 Reductions 6.1 Reductions with the < 1 -JEP We begin with the easy direction, that if P T has the < 1 -JEP then performing joint embedding on our canonical models will encode a solution to T .
Lemma 6.1 Let T be a string tiling problem, and P T the corresponding 3-dimensional permutation class.
If P T has the < 1 -JEP, then T has a solution.
Proof: Let A * <1 and B * <1 be the canonical models from §3.2. Then A * <1 , B * <1 ∈ P T , so we can apply the < 1 -JEP yielding C * <1 . As A * <1 < 1 B * <1 there can be no identifications of points between the factors, so we may assume C * <1 has A * <1 B * <1 as a base set. Furthermore, by Constraint 7, the grid-origin in A * <1 must capture some tile from the tile-origin in B * <1 . This then propagates to a tiling of the entire grid in A * <1 by tiles from the grid in B * <1 by Constraint 8, while respecting the rules of the tiling problem by Constraint 12. We thus associate to C * <1 the tiling θ(x, y) = i if the connector interval associated to the G 0 -point with coordinates (x, y) captures a tile of type i (if it captures tiles of both types, we may pick either). 2 Now we must assume T has a solution and show P T has the < 1 -JEP. The difficulties in defining a joint embedding procedure arise from the way in which arbitrary A, B ∈ P T can deviate from the canonical models. We have already mentioned that an element of P T can have multiple grids and partial grids, which led us to consider weak coordinates. Another possible issue that arises from this is that a structure can contain an incorrect tiling. For a simple example, consider a tiling problem where the only constraints are that a 2-tile cannot be adjacent to either a 1-tile or a 2-tile, so the unique solution is to tile the whole grid with 1-tiles. However, A ∈ P T can contain a full grid of connector intervals, and a single tile-set at the origin, such that the connector interval at the origin captures the 2-tile. Then if B ∈ P T contains a full grid of tile sets, when we joint-embed A and B, we will have to arrange so that the connector interval at the origin of A captures the 1-tile from the grid of tile-sets in B, while still capturing the 2-tile from the partial grid of tile sets in A, and making the tile origins in A and B intersect. This will be possible, but relies on having only two types of tile, which is why we imposed this restriction.
From Lemma 5.5, we see that the special intervals weakly coordinatized by (x, y) are contained in a particular < 2 -interval, separated from all other special intervals with distinct weak coordinates, and that the intervals are antilexicographically increasing in < 2 . Thus an arbitrary element of P T recovers some of the structure of Figure 4, although with possibly many special intervals at a given weak coordinate. As is already done Figure 4, our first step when performing joint embedding will be to put the intervals in the two factors with the same weak coordinates at roughly the same < 2 -level. This is done in the following definition, where we would like to simply say that the bottom coordinates of the < 2 -intervals I A and I B are set equal with respect to < 2 , as are the top coordinates. However, as distinct points cannot be equal with respect to < 2 , the definition is more convoluted.
Definition 6.2 Let C be a structure equipped with a partial order <, and let A, B ⊂ C be totally <-ordered. Let I A , I B be closed <-intervals in A, B. Extending < such that b 1 < I A < b 2 for any b 1 < I B < b 2 , and such that a 1 < I B < a 2 for any a 1 < I A < a 2 , will be called <-aligning I A with I B . Note, this may not be possible, depending on the initial <-configuration.
Given A, B, we will use the definition in our joint embedding procedure as follows. After taking the disjoint union C = A B, < 2 will be a partial order on C. We will partition A into < 2 -intervals I A,i for i ∈ N, with the condition that if i < j then the I A,i < 2 I A,j , and similarly partition B into < 2 -intervals I B,i . For each i, we will then align I A,i with I B,i . This yields a sequence of disjoint increasing < 2 -intervals in C, and we will then complete < 2 to a linear order on C by completing it on each such interval separately. By the disjointness, the completion in any one interval can be done independently of the completion on other intervals.
Before beginning our next lemma, we repeat that the claim at the beginning of its proof is the reason we use a third linear order in this paper.
Lemma 6.3 Let T be a string tiling problem, and P T the corresponding 3-dimensional permutation class. If T has a solution, then P T has the < 1 -JEP.
Proof: Let A, B ∈ P T , and begin by defining C to be the disjoint union of A and B, so the order relations are only partially defined. Next, complete < 1 and < 3 in C so that A < 1 B and A < 3 B. Thus, all that remains is to determine how points in A are < 2 -related to points in B, while satisfying the constraints.
Claim 1 For any < 2 -completion of C, and any E ⊂ C a copy of some element of E, either E ⊂ A or E ⊂ B.
Proof of Claim: Suppose a ∈ E and a ∈ A. As A < 1 B, all points a ∈ E with a < 1 a are in A. As < 1 = < opp 3 on E, for any a ∈ E such that a > 1 a we have a < 3 a; as B > 3 A, such a are also in A. ♦ We now extend < 2 in C so that all copies of E i O and E i P in B are < 2 -below all points in A, and similarly so that all copies of E i O and E i P in A are < 2 -below all copies of E 0 G and E 1 T in B (here we use Constraint 4). In Figure 4, this is satisfied if we erase the dividing line. Given this extension, we prove the next claim.
Claim 2 For any < 2 -completion of C, let E ⊂ C be a copy of some element of E in one factor. Then E captures no P i -points in the other factor.
Proof of Claim: If E ⊂ B, then it captures no points in A, as A < 1 B. If E ⊂ A, it captures no P i -points in B, as all such points are < 2 -below all points in A. ♦ Constraints 1-3 and 5(a) follow immediately from the claims above and the fact that the constraints hold in each factor. Constraint 4 holds by the paragraph before Claim 2, and Constraint 6 holds as we have identified no points.
The remaining constraints concern the relations between special intervals. For each (x, y) ∈ N 2 , we may consider the closed < 2 -interval I A x,y , whose endpoints are the < 2 -least and greatest points weakly coordinatized by (x, y) in A, and similarly I B x,y . By Lemma 5.5, in each factor these intervals are nonoverlapping and antilexicographically increasing with respect to < 2 . We may thus < 2 -align each I A x,y with I B x,y , and set I X x,y < 2 I Y x ,y for X, Y ∈ { A, B } and (x, y) < antilex (x , y ) (as in Figure 4). From this, it follows that Constraint 5(b) is satisfied. Thus the Constraints 1-6 that we have discussed so far will remain satisfied for any completion of < 2 .
We now consider each coordinate-pair (x, y) one at a time, and determine the < 2 -order of the points weakly coordinatized by (x, y) independently of what we do at other weak coordinates.
Let θ : N 2 → { 1, 2 } be a valid tiling. For now, we assume there is a connector interval in A and tile set in B, each weakly coordinatized by (x, y).
Suppose θ(x, y) = 1. We will work entirely in I A x,y and I B x,y (and by Corollary 5.4(1), all special interval endpoints in these intervals are weakly coordinatized by (x, y)). Figure 5 shows an example of the joint embedding procedure at a coordinate (x, y) with θ(x, y) = 1, where we have zoomed in on the special intervals. In Figure 5, in A there is a connector interval capturing a 2-tile from a tile set and in B there is a connector interval capturing a 1-tile. In C, the connector interval from A captures the correct tile from B and all the special intervals intersect.
We now describe the general procedure when θ(x, y) = 1. Let I A be the intersection of all special intervals in I A x,y , and I B for I B x,y (these are non-empty by Lemma 5.3, and are shown in Figure 5). We first set all points from A < 2 -below all the 2-tiles from B. Note the bottom endpoint of I B must be < 2 -below all the 2-tiles in B, as must all the 1-tiles in B by Corollary 5.4(2). Thus we may set I A to contain all the 1-tiles from B as well as the bottom endpoint of I B . This makes all the connector intervals in I A x,y capture all 1-tiles in I B x,y , and makes I A intersect I B (this intersection is shown in Figure 5), so all special intervals in I A x,y intersect those in I B x,y . Finally, we arbitrarily complete < 2 to a linear order, when restricted to points in I A x,y ∪ I B x,y . The case θ(x, y) = 2 is similar. If there is no connector interval in A and tile set in B, each weakly coordinatized by (x, y), the process is simpler. We just intersect I A with I B to ensure all the special intervals in A weakly coordinatized by (x, y) intersect all those in B weakly coordinatized by (x, y).
Because we have made every special interval from I A x,y intersect every special interval I B x,y , we will satisfy Constraints 7-10, with Constraint 9 additionally using Corollary 5.4(3). We have also tiled every G 0 -point in A weakly coordinatized by (x, y) according to θ(x, y), and not tiled any G 0 -point in B, and so will satisfy Constraint 12. Because we have only intersected special intervals on a given axis with those on the same axis, Constraint 11 holds as well.
To finish, we must complete < 2 to a linear order while still satisfying Constraints 7-12. By inspection, they will still be satisfied if we do not intersect any further special intervals during the completion. Given a special interval I in one factor and I in the other that do not yet intersect, we will be forced to intersect I and I only if either there is another special interval J intersecting both I and I , or there are special intervals J and J both intersecting I with I < 2 -between them (or the same configuration with the roles of I and I reversed). Recall we only intersected special intervals with the same weak coordinates. Since we also intersected all special intervals at a given set of weak coordinates, the first configuration cannot appear. Since our partially-defined structure satisfies Constraint 10, J and J must intersect each other in the second configuration, and thus I cannot be < 2 -between them.
Thus there is some way to complete < 2 to a linear order while not intersecting any further special intervals, and any such completion will suffice to finish defining C. 2 6.2 From the < 1 -JEP to the JEP We first describe why we initially restricted ourselves to the < 1 -JEP. Note that our definition of capture and the final parts of Constraint 7 and 8 are asymmetric with respect to < 1 . When jointly embedding our canonical models A * <1 and B * <1 , if we were not forced to put A * <1 < 1 B * <1 , we could trivially jointly embed them by putting A * <1 > 1 B * <1 . But then no connector intervals in A * <1 would capture any tiles in B * <1 , and so this would not encode a solution to the tiling problem. One could try to remove these asymmetries, but then the JEP will fail.
In order to remove the requirement of < 1 -JEP from Lemma 6.1, we slightly adjust the class P T we are working in. For each 0-superscripted element of E, we introduce a corresponding 2-superscripted element to E from A, and for each 1-superscripted element of E we introduce a corresponding 3-superscripted element to E from A, thus doubling the size of E. We define the corresponding unary predicates as before.
The idea is that 2-superscripted elements should behave like 0-superscripted ones, and 3-superscripted elements like 1-superscripted ones, with the exception that 0-superscripted grids should be tiled by 1superscripted tiles while 2-superscripted grids should be tiled by 3-superscripted tiles. We will also use < 2 to separate the 0, 1-superscripted elements from 2, 3-superscripted elements.
Thus, given a string tiling problem T , we define a 3-dimensional permutation class Q T as follows. We use all the constraints from P T , and then duplicate those constraints replacing 0-superscripted and 1-superscripted predicates with 2-superscripted and 3-superscripted predicates, respectively.
We also add the following constraints.
(6 * ) Constraint 6 is replaced by a constraint forbidding the identification of any points from 2 distinctlysuperscripted elements of E.
Lemma 6.4 Let T be a string tiling problem, and Q T the corresponding 3-dimensional permutation class. If T has a solution, then Q T has the JEP.
Proof: Fix a tiling θ : N 2 → { 1, 2 }. Given A, B in our new class, split both into 2 < 2 -intervals so that the lesser interval contains all copies of { 0, 1 }-superscripted elements of E, and the greater interval contains all copies of { 2, 3 }-superscripted elements of E. We may then apply the joint embedding procedure of Lemma 6.3 separately to the pair of < 2 -lesser intervals and the pair of < 2 -greater intervals. 2 In the following lemma, we weaken the < 1 -JEP from earlier to simply the JEP. This is done by adjusting the canonical models so that we must perform the < 1 -JEP with either a copy of our earlier canonical models, or with a copy of the earlier canonical models using { 2, 3 }-superscripted elements instead of { 0, 1 }-superscripted elements. Fig. 6: The canonical models in Q T , projected onto < 1 , < 2 .
Lemma 6.5 Let T be a string tiling problem, and Q T the corresponding 3-dimensional permutation class. If Q T has the JEP, then T has a solution.
Proof: We describe our new canonical models, which are pictured in Figure 6. Let A 0 be as A * <1 in Lemma 6.1 and B 3 be as B * <1 in Lemma 6.1 but with 3-superscripted elements of E instead of 1-superscripted elements of E. Let A * = A 0 B 3 , with A 0 < 1,2,3 B 3 .
Let A 2 be as A * <1 in Lemma 6.1 but with 2-superscripted elements of E instead of 0-superscripted elements of E and B 1 be as B * <1 in Lemma 6.1. Let B * = A 2 B 1 , with A 2 < 1,3 B 1 and B 1 < 2 A 2 . In A * , as < 1 and < 3 agree between A 0 and B 3 , any copy of E ∈ E that occurs must be contained either in A 0 or in B 3 . Similarly in B * , any copy of E ∈ E that occurs must be contained either in A 2 or in B 1 .
As A * <1 , B * <1 in Lemma 6.1 were in P T , A * , B * will be in Q T . If Q T has the JEP, there is some C * embedding A * , B * . By Constraint 6 * , C * must contain A * B * . Suppose in C * that A 0 < 1 B 1 . Then as in Lemma 6.1, we must produce a tiling. If we don't have A 0 < 1 B 1 in C * , then it must be that A 2 < 1 B 3 , and again we must produce a tiling as in Lemma 6.1. 2 Theorem 6.6 There is no algorithm that, given a finite set of forbidden 3-dimensional permutations, decides whether the corresponding 3-dimensional permutation class has the JEP.
Proof: Given a string tiling problem T , consider the 3-dimensional permutation class Q T . By Lemmas 6.4 and 6.5, T has a solution if and only if Q T has the JEP. As the string tiling problem is undecidable, we are finished. 2 Corollary 6.7 The JEP is undecidable for n-dimensional permutation classes with finitely many forbidden n-dimensional permutations, for n ≥ 3 Proof: We have already shown this for n = 3, so fix n > 3. To any 3-dimensional pattern class C, we can associate an n-dimensional permutation class L(C) whose constraints are all expansions of the constraints from C to n orders. Also, given any n-dimensional permutation, we may consider its reduct to the first 3 orders. Both of these operations preserve that there are only finitely many forbidden n-dimensional permutations.
We claim that C has the JEP if and only if L(C) has the JEP. Suppose L(C) has the JEP. Given A, B ∈ C, we may expand them to structures in L(C), jointly embed the expansions, and then take the reduct, giving a joint embedding of A, B. Now suppose C has the JEP. Given A, B ∈ L(C) we may jointly embed their reducts, and any expansion of the result will give a joint embedding of A and B. 2

Concluding Remarks
We finish by discussing the obstructions to adapting this proof to permutation classes. As mentioned before, the main issue is the loss of an easy proof for the claim at the beginning of Lemma 6.3. If simply taking the projection of our 3-dimensional joint embedding procedure to the first 2 orders, transitivity will force us to produce many configurations we do not intend to. For example, consider the following situation. Let F be a forbidden permutation, and suppose F = F 1 F 2 with F 1 < 1,2 F 2 (more elaborate constructions can remove this requirement). Suppose we are performing the < 1 -JEP on A, B, and there are a ∈ A and b ∈ B such that we must set a < 2 b. We may instead consider the structure A formed from A by placing F 1 < 2 a and B formed from B by placing b < 2 F 2 . If A and B are still in our permutation class, then when jointly embedding them, transitivity will force F 1 < 1,2 F 2 , and so we will create a copy of F . A perhaps more basic manifestation of the difficulty in ruling out unintended configurations in permutation classes is the question of how to represent arbitrarily large grids, and thus the canonical models, in a class P T such that P T is not the class of all permutations.