Cutting Corners

We define and study a class of subshifts of finite type (SFTs) defined by a family of allowed patterns of the same shape where, for any contents of the shape minus a corner, the number of ways to fill in the corner is the same. The main results are that for such an SFT, a locally legal pattern of convex shape is globally legal, and there is a measure that samples uniformly on all convex sets. Under suitable computability assumptions, this measure can be sampled, and legal configurations counted and enumerated, effectively and efficiently. Our approach to convexity is axiomatic, and only requires an abstract convex geometry that is"midpointed with respect to the shape". We construct such convex geometries on several groups, in particular all strongly polycyclic groups and free groups. We also show some other methods for sampling finite patterns, one based on orderings and one based on contructing new"independent sets"from old. We also show a link to conjectures of Gottshalk and Kaplansky.


Introduction
In symbolic dynamics, for many of the natural finitely presented objects, in particular SFTs and sofics, most natural questions are undecidable. In fact, given a sofic shift X (in any standard way), one can prove analogously to Rice's theorem [20] that it is in general impossible to say anything about it algorithmically. Thus, while a general theory of multidimensional sofic shifts can certainly be developed, it will never reach a point where we can algorithmically answer nontrivial questions about given arbitrary sofics. The situation is not much "better" for SFTs; non-emptiness [3] and the extension problem (does a given pattern appear in a fixed SFT) [25] are undecidable, we refer to [13] for a discussion of the history and state-of-the-art.
This raises the general problem of finding subclasses of SFTs where some typical behaviors of SFTs appear, but some things can also be decided. In this paper, we study a class of SFTs defined in a purely combinatorial way, by defining the SFT by a family of allowed patterns of the same shape where, if all but a corner is filled (arbitrarily), the number of ways to legally fill the corner is the same. We call these the subshifts totally extremally permutive (TEP). The language of every TEP subshift is decidable (uniformly in the description of the forbidden patterns), and there is a very natural invariant measure on the subshift -the TEP measure -, which samples uniformly (thus with maximal entropy) on all convex sets. Uniformly random samples of some TEP subshifts in the classical multidimensional setting and on the free group can be seen in Figure 1.
The prime example of a TEP subshift is the Ledrappier subshift, so it makes sense to compare the properties of TEP subshifts with those of algebraic subshifts. In the multidimensional setting, it is known that the language of a group shift on Z d is always decidable uniformly in the defining forbidden patterns [15], and of course there is a very nice shift-invariant measure, and thus a "most natural way" to sample the subshift, namely the Haar measure. Like group shifts, TEP subshifts can be built by a systematic process from any finite group, but this usually does not result in a group shift (at least with the same multiplication rule). When a TEP subshift happens to be a group shift, the TEP measure is the Haar measure.
Our definition was introduced as a generalization of the TEP cellular automata of [23] to subshifts; indeed the spacetime subshift [22] of a TEP cellular automaton is a TEP subshift, and TEP subshifts give rise to certain permutive cellular automata in the abelian case (though the Z d -specific theory is not studied in the present paper).
The definition of TEP is also motivated by, and close in definition with, the corner deterministic shapes which arise in the study of Nivat's conjecture (see [6]) and which have been studied in [11,9]. However, this class is no better than general SFTs in terms of decidability properties, in that the language of an SFT admitting a corner deterministic shape is not uniformly decidable in the allowed patterns [17].
Our approach is axiomatic, in that we formulate all statements in terms of abstract convex geometries (more generally so-called "convexoids"). Though the formalism takes a few pages to set up, it has the benefit of separating the geometric discussion from the symbolic dynamics arguments. It also allows us to generalize the results to other groups. We construct convex geometries with the necessary properties for several groups, in particular all strongly polycyclic groups and free groups.
Depending on the group, the convex geometries have different additional properties (which are reflected in what we can say about the TEP subshifts). The convex geometries we give on free groups are, in our opinion, very natural (they are in particular "midpointed"), and we report also a construction of such natural convex geometries due to Yves de Cornulier on f.g. torsion-free nilpotent groups of small nilpotency class.
Some theory of invariant convex geometry on infinite ground sets is needed, and is developed from scratch, although much of it is surely standard. We do not know a reference studying convex geometries invariant under a group action; some geometric phenomena arise, mainly the equivalence of unique corner positioning and midpointedness.

Definitions
For G a set, write S ⋐ G for S ⊂ G ∧ |S| < ∞. Write FinSet(G) = {S | S ⋐ G}. We have 0 ∈ N. The quantifiers ∃ ≤k and ∃ k mean "exists at most k" and "exist exactly k", respectively. We use the notation 0 S for the unique element of {0} S . Acting groups are discrete. Conjugation in a group is h g = ghg −1 . "Measure" refers to a Borel probability measure. For basic theory and examples of groups, see standard references [18,7,24]. The strongly polycyclic groups are the smallest family of groups containing the trivial group and such that G is polycyclic whenever 1 → K → G → Z → 1 is an exact sequence and K is strongly polycyclic. When 1 → K → G → H → 1 is exact G is a group extension of K by an action of H. If F is a field and G a group, the group ring F [G] is the ring of formal sums c g g where c g ∈ F for all g ∈ G and c g = 0 for only finitely many g (the ring structure is the obvious one). We write Z[ 1 n ] for smallest subgroup of the additive group of rational numbers containing 1/n k for all k ∈ N, so Z[ 1 2 ] is the additive group of dyadic rationals. For a group property P (i.e. family of groups), a group is locally-P if all its finitely-generated subgroups have property P .
If G is a group and A a finite set, a pattern is an element of A S for S ⊂ G, and a finite pattern is one where S is finite. We call S its domain, or sometimes shape, and in general the term "shape" is used for finite subsets of a group G. Finite (discrete) sets A used to label elements of groups are called alphabets, and their elements are called symbols. Elements of groups being labeled are sometimes called cells. We sometimes write the pattern a S with S = {s} a singleton as s → a.
The full shift on a group G with alphabet A is the set A G with the product topology, and with a G-action given by gx h = x g −1 h . Its elements x ∈ A G are called configurations. A subshift is a closed G-invariant subset. An SFT is a subshift of the form X = {x ∈ A G | ∀g ∈ G : gx ∈ U } where U ⊂ A G is clopen. We can write a clopen C as a set of patterns T ⊂ A S for some S ⋐ G, and we call T a set of allowed patterns for the SFT X, and say X is defined by T .
Let G be a group, S ⋐ G and let T ⊂ A S . A pattern P ∈ A C for C ⊂ G is T -legal if ∀g ∈ G : gS ⊂ C =⇒ g −1 P | S ∈ T . Thus SFTs are just the sets of configurations that are T -legal as patterns, for some fixed T . If P ∈ A C , write gP ∈ A gC for the pattern defined by gP h = P g −1 h . If P ∈ A C , Q ∈ A D are patterns and C ∩D = ∅, define P ⊔Q ∈ A C∪D by (P ⊔Q)| C = P , (P ⊔Q)| D = Q. If X ⊂ A G is a subshift and P ∈ A C for C ⊂ G, write P X ⇐⇒ ∃x ∈ X : x| C = P and say P occurs in X. The language of a subshift is the set of patterns that occur in it. If an SFT is defined by allowed patterns T , we also use the terms locally legal for T -legal patterns and globally legal for patterns in the language.
Throughout, we mention some recursion-theoretic and complexity-theoretic corollaries. For decidability results, an intuitive understanding of computability should suffice. For complexity-theoretic claims, some familiarity with the basic theory may be needed, and we refer to [2].
For any computability-related discussion, we need computational presentations of groups. We use abstract presentations, to avoid a technical discussion. An encoded group is a group together with a bijection with some sublanguage of A * for some finite alphabet A, which is part of the structure and usually left implicit (when useful, we see the group directly as a subset of A * ). We say an encoded group is computable if the product and inversion of elements are computable operations and G ⊂ A * is decidable, and it is a polytime group if they are computable in polynomial time and the language G ⊂ A * is in the complexity class P . One can always recode the alphabet to be A = {0, 1} in polynomial time, if needed.
For finitely-generated groups, "computable encoded group" is essentially a synonym for "recursively presented group with decidable word problem" in the standard sense of combinatorial group theory, in fact for such a group there is only one way to see it as an encoded group, up to computable bijection, and indeed there is always a computable bijection with the presentation of elements by lexicographically minimal products of generators. Thus, for the benefit of readers who skipped this discussion, we say a countable group has decidable word problem if we are considering it as an encoded group (with respect to some encoding) with respect to which it is computable, and this indeed corresponds to the standard meaning of the term.
For polytime groups, representation issues are less trivial. For the group Z d , the most common encoding is presumably the presentation of vectors as a tuple of binary numbers, but it is crucial in our results to instead use the unary computational presentation, i.e. v ∈ Z d is represented as (for example) .., d} * , f (n) = 2n for nonnegative n and f (n) = −2n − 1 for negative n. This is equivalent to the coding one obtains from the standard group presentation of Z d as a finitely-presented group, up to polynomial time computable bijection.
If G is encoded, then FinSet(G) and elements A C for C ∈ FinSet(G) can be also encoded as words, and we pick any reasonable encoding (we believe there is only one natural polytime equivalence class for such codings, so we omit the details). Thus the language of a subshift on G can be seen as a set of words, and we can speak of its decidability and computational complexity.
Write M(X) for the set of measures on a compact metrizable space X. A measure µ ∈ M(X) for X ⊂ A G a subshift is computable if X has decidable language and given a finite pattern P ∈ A C with P X and a rational number ) is a lower semicomputable real number for each finite pattern P . We can perfectly sample µ if we can, given access to a source of random bits, algorithmically enumerate a configuration, so that the resulting configuration is distributed according to the measure µ. It is not hard to show that perfect samplability is equivalent to computability, see the appendix of [4] for an analogous result on finite words.
If X ⊂ A G is a subshift, the marginal distribution of a measure µ ∈ M(X) on C ⋐ G, denoted µ| C , is the measure µ| C ∈ M(A C ) defined by µ| C (P ) = µ([P ]), where for P ∈ A C we denote by [P ] the cylinder {x ∈ X | x| C = P }.
In figures, we orient Z 2 in figures so that the first axis increases to the right, and the second axis upward.
Basic knowledge of cellular automata comes up in some examples and discussion (but is not needed in any of the results). We refer to [14] for the basic theory.

Convexity
We define our abstract notion of convexity and give the technical results needed in our applications, we cite [16] for a reference on set systems.
It is a convex geometry if additionally the anti-exchange axiom holds.
If C is a convex pregeometry (and sometimes even for more general C ⊂ FinSet(G)), sets in C are called convex and abusing terminology we also say When the convex pregeometry is clear from context, we use the notation τ (C) = C for the closure. More generally, for any family C ⊂ FinSet(G) and S ⋐ G, we write S for the set of elements g such that C ∈ C ∧ C ⊃ S =⇒ g ∈ C (if C is not a convex pregeometry, S may not be in C).
Convex pregeometries are sometimes called Moore families. The following lemma is essentially classical, and we leave the proof to the reader.

Lemma 1. A family C ⊂ FinSet(G) is a convex pregeometry if and only if it is closed under intersections, every finite set in G is contained in some set in C,
and C contains the empty set.
where conv(A) ⊂ R d denotes the real convex hull, are well known to be a convex geometry. We call this the standard convex geometry of Z d , and by default convex sets on Z d will refer to these sets. These convex sets have many important additional properties: • the convex hull of a finite set B is of polynomial size and can be computed in polynomial time, as a function of the maximal length vector in B (for fixed d; recall also that we use unary notation for elements of Z d ), For the first item, we give the easy argument in Proposition 1, and the latter two hold by the definition of a convex set. In sections 3.1 and 3.2, we study the consequences and non-abelian analogs of the latter two properties. Especially the last item -midpointedness -play a key role in our results. On specific groups, one can occasionally find notions of convex sets that seem natural, and we will see relatively natural convex geometries on at least free groups and some torsion-free nilpotent groups. A general, somewhat trivial way to satisfy the axioms of a convex geometry is to order the set G with an order < of type ω and declare the lower sets as convex. This idea is explored in Section 5.6.
Another general way is building convex geometries from convex geometries on supersets or subsets. We list a few "obvious" constructions below. These are straightforward to prove, in each case by guessing the closure operation, verifying it gives the right sets, and then verifying anti-exchange.

Lemma 2.
Let H ⊂ G be two sets and let C ⊂ FinSet(G) be a convex geometry.
Lemma 4. Let (G i ) i∈N be a family of sets and G = i G i their increasing union. Let C i ⊂ FinSet(G i ) be a convex geometry for each i, such that whenever If we define an infinite set to be convex if the closures of its finite subsets are contained in it, then the assumptions of Lemma 4 can be equivalently phrased as "G i is convex in G j and C i is the restriction of C j to G i in the sense of Lemma 2" (we omit the proof of this equivalence).
In particular, on the direct union we have a natural convex geometry obtained from Lemma 4 applied to the standard convex geometries of the Z d .

Anti-exchange, corner addition and convexoids
Definition 2. If C ⊂ FinSet(G) is a family of sets, the corners of C ∈ C are the set The lax corners of C ⋐ G are the set Usually we write ∠ = ∠ C for the lax corners and ∠ · = ∠ · C for corners, when it is clear which family of sets C is being discussed. When C is a convex geometry, for a convex set C ∈ C its corners are precisely its lax corners, and in general all corners are lax corners but we may have ∠C ∠ · C even for C ∈ C and C a convexoid (defined later). Lax corners of C are the elements that can be separated from other elements of C by some set in C.
The main way the anti-exchange axiom features in our applications is in terms of the following property.
Definition 3. Let G be a set and C ⊂ FinSet(G). Say C has the corner addition property if In the corner terminology, the corner addition property states that if we have two convex sets, one inside the other, then some element of the larger can be added to the smaller so that the resulting set is convex (and the added element is of course a corner of the new set).
Lemma 5. Let C ⊂ FinSet(G) be a convex pregeometry. Then the following are equivalent: • C is a convex geometry, • C has the corner addition property.
Proof. We need to show that the anti-exchange axiom is equivalent to the corner addition property, under the convex pregeometry axioms. Suppose that corner addition fails, and C, D ∈ C, C D such that there does not exist a ∈ D \ C such that C ∪ {a} ∈ C.
For each a ∈ D \ C, Since C ∪ {a} was picked to have minimal cardinality, we must have C ∪ {b} = C ∪ {a}. But then a, b / ∈ C, C ∈ C, a ∈ C ∪ {b} and b ∈ C ∪ {a}, contradicting anti-exchange.
Suppose then that anti-exchange fails, i.e. for some C ∈ C and a, b / ∈ C, we have C ∈ C, a ∈ C ∪ {b} and b ∈ C ∪ {a}. It is easy to show that C ∪ {a} = C ∪ {b}, denote this set by D. By possibly increasing C, we may further assume that if C ⊂ E ⊂ D and E ∈ C, then E = C or E = D. This is because if E is a maximal convex subset of D containing C and such that a, b / ∈ E, then E ∪ {a} = E ∪ {b} = D, and we may replace C by E without changing D.
From the maximality assumption on C, we have that if c ∈ D \ C, then C ∪ {c}∩{a, b} = ∅, thus C ∪ {c} = D for all c ∈ D\C. Since |D| ≥ |C∪{a, b}| ≥ |C| + 2, this contradicts the corner addition property for the pair C D.
Corner addition has the benefit that stating it does not require the existence of a closure operation, rather it can be stated for any family of sets. We introduce a relaxed notion of convexity which turns out to be sufficient for our purposes.
Definition 4. Let G be a set and C ⊂ FinSet(G). We say C is a convexoid if ∅ ∈ C, every B ⋐ G is contained in some C ∈ C, and the corner addition property holds.
We also call elements of a convexoid convex. The term "convexoid" is loosely based on the term "greedoid": the main difference between the definitions is (arguably) that comparison of cardinalities is replaced by set inclusion, whose relevance to convexity is clear from the above proof. Observe that, by Lemma 1, a convexoid is a convex geometry if and only if it is closed under intersections.
In general, there certainly exist convexoids that are not convex geometries -{∅, {0}, {1}, {0, 2}, {1, 2}, {0, 1, 2}} for instance. We do not know interesting examples of such convexoids on group, but we state the main results for TEP for this more general class, since it makes the results a priori stronger, is precisely what is needed in the proof of the main theorem, and does not lengthen any of the proofs (in fact our experience is that not allowing the use of the algebraic properties the closure operator often directs one to a simpler proof). Nevertheless, all of our constructions produce true convex geometries.  Figure 2: An anti-shelling from ∅ to a ball.
We also consider unbounded anti-shellings C 0 , C 1 , .... We then also require i C i = G, and call the set C 0 the base of the anti-shelling.
The motivation of the term is that the reverse of a (bounded) antishelling is usually called a shelling in the setting of set systems. Since we need unbounded anti-shellings, this ordering seems more appropriate.
Lemma 6. Let G be a set and C ⊂ FinSet(G) a convexoid. If C, D ∈ C and C ⊂ D then there is an anti-shelling from C to D, and every set C ∈ C is the base of an unbounded anti-shelling.
Proof. Suppose C, D ∈ C. To find an an anti-shelling C 0 = C, C 1 , C 2 , ..., C n = D, C i ∈ C, simply apply the corner addition property to the pairs (C i , D) with i taking values 0, ..., n = |D \ C| − 1 in order. To find an unbounded anti-shelling, enumerate G = {a 1 , a 2 , ...}, and iterate the following procedure starting from C, adding one group element at a time: Suppose we have constructed C 0 , ..., C i so far. Then take the minimal j such that a j / ∈ C i , let D be any convex set containing C i ∪ {a j } and pick an anti-shelling C i , C i+1 , ..., C i+|D\Ci| = D. Concatenate this to the end of C 0 , ..., C i−1 . In the limit, this gives an antishelling sequence whose final set must contain every element a j , thus G = k C k . Example 1: Figure 2 shows the convex set C ⊂ Z 2 (with respect to the standard convex geometry of Z 2 ) obtained from the closed ball in R 2 of radius √ 19 by discretizing, and an anti-shelling of it (the number i represents the element s i in the definition of the anti-shelling). The anti-shelling was obtained by starting from an empty set C 0 = ∅, and iteratively adding a uniformly randomly picked element a ∈ C \ C i such that C i+1 = C i ∪ {a} is convex. One can check that this is an anti-shelling by connecting the dots and drawing the successive convex hulls. (The resulting figure is included in Figure 2 for completeness, although only the process of building it is useful.)

Invariant convex geometries and midpoints
If G is a group, a family C ⊂ FinSet(G) is invariant if C ∈ C =⇒ ∀g ∈ G : gC ∈ C. The following definitions are specific to the setting of subsets of groups.
and midpointed if it is G-midpointed. Say C has unique corner positioning for We say C has UCP if it has UCP for all S ⋐ G.
Clearly an invariant family C ⊂ FinSet(G) is midpointed if and only if 1 G ∈ {g, g −1 } for all g ∈ G. On occasion, we also need to talk about individual midpointed sets C ⋐ G, meaning that the family {C} is (S-)midpointed.
There is a simple connection between midpointedness and unique corner positioning: Proof. Suppose S-UCP fails. Then there exist C ∈ C, a ∈ C such that C \ {a} ∈ C, S ⋐ G, and distinct g 1 , g 2 ∈ G such that a ∈ g i S ⊂ C for i ∈ {1, 2}. Clearly g 1 = g 2 implies s 1 = s 2 , and since a = g 1 s 1 = g 2 s 2 and g 1 s 2 , g 2 s 1 ∈ C, we have as −1 1 s 2 = g 1 s 2 ∈ C and as −1 2 s 1 = g 2 s 1 ∈ C. It follows that C \ {a} is convex, contains ah and ah −1 for h = s −1 1 s 2 , so C is not S −1 S-midpointed. Suppose then that C is not S −1 S-midpointed, i.e. g / ∈ {gh, gh −1 } for some g ∈ G, h ∈ S −1 S, say h = s −1 1 s 2 . By the definition of {gh, gh −1 }, there exists a convex set C ′ containing {gh, gh −1 } but not g, and by the definition of a convexoid there exists D ∈ C containing {g, gh, gh −1 }. Pick an antishelling sequence from C ′ , D, and take C to be the first set containing g. Then {gh, gh −1 , g} ⊂ C and g is a corner of C. Setting T = {s 1 , s 2 } ⊂ S, we have g ∈ gs −1 1 T = {g, gh} ⊂ C and g ∈ gs −1 2 T = {g, gh −1 } ⊂ C. Thus C does not have T -UCP.
Recall that the lax corners are elements s ∈ S such that some convex set contains S ⊂ {s} but not s. The translated lax corners are obtained by taking the lax corners ∠S of all translates of S and translating them translated back inside S, equivalently taking the union of ∠ gC S over all g ∈ G. If C is invariant, g −1 ∠gS = ∠S for all g ∈ G, i.e. all translated lax corners are lax corners.

Polynomial time algorithm for convex sets on Z d
The fact that "the convex hull of a set of real vectors can be computed in polynomial time" is a well-known fact in computational geometry. Nevertheless, it is non-trivial to find, in the literature, such a result that directly applies in our situation: algorithms are often specific to even prime dimensions, and even when not, they often give the extremal vertices instead of bounding half-spaces, or assume that points are in general position, and such algorithms will not really simplify the problem at hand. In any case, some postprocessing is needed to construct the actual discrete set from the description of the geometric convex hull. Thus, it seems easier to give a direct proof. Proof. Let R be the maximal value that appears in the vectors in S, and observe that, since we are working in unary notation, the list of all vectors in [−R, R] d is of polynomial size in the input size. Thus, it suffices to check, for every individual v ∈ [−R, R] d , whether v ∈ τ (S). By setting T = S − v, we have reduced the problem to verifying in polynomial time whether 0 ∈ τ (T ) for a set T of integer vectors of dimension d and with entries in [−2R, 2R]. Now, we recall that the convex hull of S in R d is precisely the intersection of all affine half-spaces of dimension (d − 1) that contain S. By the definition of a half-plane, it is thus enough to find out whether there is a positive real column vector x ∈ R d such that the strict inequality Ax > 0 holds, where A is the |T |-by-d integer matrix whose rows are the vectors in T .
Such a system of inequalities can be solved for a rational matrix A by using at most O(|T |d) field operations on the matrix coefficients, so that each matrix entry takes part in at most O(d) calculations. Thus, even with exact calculations with rational numbers, the time will be polynomial in R.
We outline this algorithm: If the first column of A contains no negative coefficients, then it is enough to solve B y > 0 where B is the (≤ |T |)-by-(d − 1) matrix of (d − 1)-suffixes of rows of A having 0 in the first coordinate, as A x > 0 then holds for any x = (a, y T ) T with large enough a. A similar reduction happens if the first column of A contains no positive coefficients. Thus, in these cases we can reduce d to d− 1 without applying any field operations to the input matrix and conclude by induction.
If the first column of A contains both positive and negative coefficients, we observe that if E is invertible and E v > 0 ⇐⇒ v > 0, then Ax > 0 has a solution if and only if EAx > 0 has one. Thus, we can apply any elementary row operations with positive entries to A. This way, with at most d field operations (and each individual entry taking part in only a constant number of field operations), we can eliminate all negative coefficients from the first column. Now apply the previous paragraph to solve the resulting problem, and by induction every coefficient will be involved in at most O(d−1) additional field operations.
In practical computer implementations, we have instead used Carathéodory's theorem and taken the union of convex hulls of simplices, as this is fast enough for small examples in dimension two and is very quick to implement.
The assumption that vectors are specified in unary notation rather than in binary is natural from the general point of view, as we are dealing with subshifts on groups -for most groups, analogs of binary representations tend to be much less canonical, and much more difficult to work with. Specifying the inputs in unary is also necessary for polynomial-time computability of the convex hull if the output is listed explicitly: already in Z the convex hull of {0, n} has n + 1 elements, so the output complexity will not be polynomial in the input if the input is specified in binary.
One could of course use a more efficient coding of the output convex hull, as is typically done in computational geometry. There are some reasons why this is not natural in our context: such implicit convex sets cannot really be used as supports of patterns without revealing the hidden exponential (as the data of a pattern of such shape is exponential in the description of the shape), and one cannot write down (in binary notation) the exact number of valid patterns of such shapes in a TEP subshift in polynomial time, as the number is typically doubly exponential in an efficient description of the convex set.

TEP
In this section, we define the TEP subshifts. One should keep in mind the case of the standard convex sets Z d . Recall that by Lemma 7 they have UCP. We will construct (S-)UCP convex geometries on some other groups in Section 5.

Definition 8. Let G be a group and C ⊂ FinSet(G) a convexoid, C ⊂ S ⋐ G and A a finite alphabet. We say a family of patterns T ⊂
We say T is (k-)totally extremally permutive 1 or (k-)TEP if it has uniform g −1 ∠gS-extensions for all g ∈ G. We say T has TEP if it has 1-TEP. If C = {c} is a singleton, we speak of (k-)uniform c-extensions instead of Cextensions.
We recall the key properties that g −1 ∠gS ⊂ S for all g ∈ G (so k-uniform S-extensions implies k-TEP no matter what C is), and when C = gC for all g and C is a convex geometry, this is just the set of corners, g g −1 ∠gS is just the set of corners of S. The set S is sometimes called the shape of the TEP family or subshift.
The following describes how the number of legal patterns in a TEP subshift behaves then we step from a convex set to a larger one.
Proof. By the S-UCP property, and the assumption that C, C ∪ {a} are convex, there is at most one g such that a ∈ gS ⊂ C ∪ {a}. If there is at least one such way, i.e. we are in the case of the first item of the lemma, then because C is convex we have a = gt ∈ ∠gS, so t ∈ g −1 ∠gS. If P ∈ A C is T -legal, in particular g −1 (P )| S\{t} is T -legal and since t ∈ g −1 ∠gS, by the TEP property there are exactly ℓ = k legal ways to extend P to a pattern Q ∈ A C∪{a} so that the pattern at gS ⊂ C ∪ {a} is T -legal. Since all other translates of S that are contained in C ∪ {a} are even contained in C, any such Q is T -legal.
If we are in the case of the second item, i.e. there is no g ∈ G such that a ∈ gS ⊂ C ∪ {a}, then any extension of P to Q ∈ A C∪{a} is trivially T -legal, so ℓ = |A|.

Language and measure
Our first main result states that k-TEP implies that every locally legal pattern supported on a convex set is globally legal.
If G has decidable word problem and C is recursively enumerable, then X has computable language, uniformly in the description of T .
Note that this theorem applies even if C is not invariant. Note also that we do not require C to be computable.
Proof. Suppose P = P 0 ∈ A C is T -legal and C ∈ C. By Lemma 6 there is an anti-shelling C 0 = C, C 1 , C 2 , .... By Lemma 8, for each i ∈ N we can find at least one T -legal pattern P i+1 ∈ A Ci+1 (in fact, we can find at least k). Since i C i = G is an increasing union, in the limit (under pointwise convergence), we obtain a configuration x ∈ A G . It is in X because its finite subpatterns are T -legal. Thus, P X.
If G is computable with respect to a fixed encoding, then given a pattern P ∈ A B with B ⋐ G, we can easily check whether P is T -legal. Namely, we simply need to consider all possible translates of S which fit inside B, and these can be enumerated easily. If C is recursively enumerable, then given a pattern P ∈ A B for a finite set B ⋐ G, we enumerate any convex C ∈ C such that C ⊃ B. We then simply check whether we can T -legally extend P to a pattern Q ∈ A C with Q| B = P , which, as we observed, is a decidable task. This can be done if and only if P X, proving that the language is computable.
A a finite alphabet, T ⊂ A S have k-TEP, and X be the SFT with allowed patterns T . Then there exists a (unique) measure µ on X such that for all C ∈ C, the marginal distribution µ| C is uniform on X| C . If C is invariant, then µ is invariant. If G has a decidable word problem and C is recursively enumerable, then this measure is computable uniformly in the description of T and can be sampled perfectly.
We call the above measure the TEP measure. Of course, it may a priori depend on C. This theorem is in some sense only as interesting as the convex geometry it is applied to. In particular, it does not seem particularly interesting dynamically when C is not invariant (its counting variants proved below may be more interesting in that case).
Proof. For the construction of the measure, we use the quantitative information that the number of extensions only depends on the shapes, given by Lemma 8. Associate to each C ∈ C the uniform measure µ C on X| C (by the previous theorem, equivalently on the set of T -legal patterns of shape C). If D ⊂ C and D, C ∈ C, using Lemma 6 we can find an anti-shelling from D to C.
By iterated application of Lemma 8, all T -legal patterns P ∈ A D have the same number of extensions m to T -legal patterns in A C , so if we denote by µ C | D the distribution that µ C induces on patterns in A D , and suppose there are ℓ many T -legal patterns in A D , by uniformity of µ C we have By basic measure theory, there is a unique measure µ of A G such that µ| C = µ C (for example it is easy to verify the assumptions of the Hahn-Kolmogorov theorem), which concludes the construction.
It is clear that this construction gives a shift-invariant measure when C is invariant, since the property of being T -legal is invariant.
If G has decidable word problem, then to show that the measure is computable and perfectly samplable, we need only show the latter. For this, enumerate an anti-shelling (using recursive enumerability of C) with base ∅, and sample the symbols at the corners s i of sets C i uniformly from the k or |A| possible choices depending on which case of Lemma 8 we are in (which is decidable at each step by decidability of the word problem).
The following is clear from the proof, and will be refined in the following section.
For a TEP subshift X ⊂ A G with defining shape S, the number of globally admissible patterns of domain C ∈ C is independent of the TEP family T ⊂ A S , and is always a power of |A|.
, and X be the SFT with allowed patterns T . If k = 1, then X has at least |A| |S|−1 configurations. If k ≥ 2, then X is uncountable and homeomorphic to the Cantor set.
Proof. The convex geometry C contains at least one set C of cardinality exactly |S| − 1, namely the (|S| − 1)th set in any unbounded anti-shelling with base ∅. Any pattern in A C is T -legal, because no translate of S can fit inside C. Thus, any such pattern appears in a configuration of X by Theorem 1.
If k ≥ 2, Lemma 8 gives at least two choices for each new element seen along an unbounded anti-shelling with base ∅, so there is a Cantor set of extensions for any pattern.
The above proposition may not sound very impressive, but it is optimal in the case G = Z, and its motivation should become clear in Section 6.
As noted already in the introduction, the decidability aspects of TEP subshifts given by Theorem 1 differ considerably from those of SFTs defined by allowed patterns T ∈ A S with the property ∀s ∈ ∠S : ∀P ∈ A S\{s} : ∃ ≤1 a ∈ A : P ⊔ (s → a) ∈ T which have been studied on free abelian groups equipped with the standard convex geometry in [11,9]: with this definition, the domino problem (nonemptiness) stays undecidable, at least for S = {0, 1} 2 [17]. . Identify x ∈ F G with the formal sum Then configurations x ∈ F G satisfying x · p = 0 G form a subshift of finite type. This gives us a TEP rule with shape S, where If the group G admits S-midpointed convex geometries for all finite sets S (Corollary 3), then it admit S-UCP convex geometries for all finite sets S (Lemma 7), and thus our results imply that the above subshift has at least two configurations whenever p has support of size at least 2. We show in Theorem 11 and Theorem 13 that such convex geometries exist on a large family of groups including all free groups and strongly polycyclic groups.
Subshifts defined by {x | x · p = 0} for p ∈ F [G] as in the previous example are called linear TEP subshifts. They are a classical family of group/vector shifts in symbolic dynamics. In the last Section 6 we show a connection to a conjecture of Kaplansky, and indeed the above statement about linear TEP subshifts on strongly polycyclic groups is a known case of Kaplansky's unit conjecture. Example 3: Let G be a group admitting an S-UCP convex geometry C for a finite set S ⋐ G. Let A be a quasigroup ( [5]), that is, A is a latin square, the multiplication operation a * b extracts the element on row a and column b, and operations a/b and a \ b are determined by the identities Let E be a formal identity in the variables in S and constants in A such that every variable s that is a translated lax corner of S (meaning s ∈ g −1 ∠gS for some g ∈ G) appears exactly once. Define a subshift X ⊂ A G by T is a TEP family because if all values except the value of some translated lax corner are known, then similarly in the previous example there is a unique possible value for s, obtained by using the quasigroup operations of A to move the unique occurrence of s to the LHS of the identity and everything else to the RHS. In particular any such X is nonempty if |S| ≥ 2.
For an example of solving, S = {a, b, c, d}, suppose the translated lax corners are a, b, c, and e ∈ A is a constant, then the identity is of the required type. We can solve giving the extension rule.
Even if the quasigroup A in the construction of the previous example is a group, typically the TEP subshift obtained is not a subgroup of A G under cellwise multiplication (although this does happen when G is abelian).
We will show in Section 5.4 that only torsion-free groups can admit midpointed convex geometries. Indeed, Proposition 2 fails on all non-torsion-free groups in the following sense.
Example 4: Let G have an element of finite order, and choose some g = 1 G such that g n = 1 G for n ≥ 2. Let A = Z q for any q > n. Let p ∈ A[G] be the element 1 G − g of the group ring Z q [G]. Then the configurations x ∈ A G satisfying xp = 1 G (where 1 ∈ Z q is the additive generator) form an empty 1-TEP SFT.
If Theorem 2 is applied to a linear TEP subshift, we obtain just the Haar measure. For example in Example 2 we recover the Haar measure of the Ledrappier subshift.
Theorem 3. Let G be a countable group, A a finite group and X ⊂ A G a subshift that is a group under cellwise multiplication. If X is simultaneously TEP with shape S, with respect to any S-UCP convexoid on G, then the TEP measure is equal to the Haar measure.
Proof. Since X is a compact group, it is unimodular, meaning the left and right Haar measures coincide. The Haar measure is the unique Borel (probability) measure µ that satisfies • µ(xE) = µ(E) for all x ∈ X and Borel sets E, and It is thus enough to verify these for the TEP measure. Since the multiplication is cellwise, it is clear that the TEP measure satisfies µ(xE) = µ(E) for cylinder sets E with a convex domain and arbitrary x ∈ G, since a valid cylinder is translated to another valid cylinder under group translation. Thus it holds for all Borel sets, since the sets where this holds are easily seen to form a σalgebra and every finite set is contained in a convex set of the convexoid C so the generated σ-algebra is the one of Borel sets. As for the second, any nonempty open set U contains a nonempty cylinder, to which we give positive measure by the definition of the TEP measure.
Corollary 2. Let G be a countable group admitting a convex geometry, F a finite field and X ⊂ F G a linear TEP subshift. Then the TEP measure is the Haar measure (of X as a compact subgroup of the compact group (F G , +) with cellwise addition).

Complexity-theoretic statements and counting
Here we state some refinements of the above theorems, which imply that for Z d both verification of legal pattern, and counting patterns, can be done efficiently.
Theorem 4. Suppose G is a polytime encoded group and C ⊂ FinSet(G) is a polynomial time computable convexoid. Let T ⊂ A S be a k-TEP family of allowed patterns for an SFT X. Given S, k, A and a finite convex set C, we can compute the number of patterns in X of shape C in polynomial time in S, C, k, |A|.
Note that we do not need to see the actual patterns T . The number k may be given in binary even though for the groups Z d as acting groups we always use unary notation. Note also that the convexoid need only be verifiable in polynomial time, i.e. it is enough that C is in the complexity class P under its natural encoding as a language -we do not be able to find a convex set containing a given finite set in polynomial time.
Proof. This is proved exactly as Theorem 1. Since C is polynomial time verifiable and has the corner addition property, we can in polynomial time construct an anti-shelling (by greedily adding corners). We always have |A| or k distinct ways to fill the corner symbol depending on whether we can position S inside the current convex set so that it touches the newest corner, and we can check in polynomial time which case we are in. Simply calculate the resulting product (which will be of the form k m |A| n ).
Example 5: Consider the convex set C and its anti-shelling from Example 1. Given any k-TEP rule, we can sample the contents of the rectangle uniformly (among globally legal patterns) by iterating through the positions (which are always corners of the resulting convex set) in the stated order, and • whenever the defining shape S fits inside the convex shape built so far, and touches the newly-added corner, choose a symbol out of the ones determined by the rule uniformly at random, • if it does not fit in, pick the contents uniformly at random from the entire alphabet A.
Since the TEP measure samples uniformly on all convex sets, the produced sample is indeed uniform. This same ordering works for TEP subshifts defined with respect to any shape S. With the shape S = * * * one can verify that along the ordering of Example Theorem 5. Suppose G is a polytime encoded group and C ⊂ FinSet(G) is a polynomial time computable convex geometry. Given the shape S defining a k-TEP subshift X over an alphabet A, a convex set C ∈ C, and a pattern P ∈ A C , we can check in polynomial time whether P is in the language of X. If every set B ∈ FinSet(C) is contained in a convex set (whose desciption is) polynomial in (the description of ) B, then the set of all T -legal patterns is in the complexity class NP.
Proof. The first claim is trivial, since given a pattern of convex shape, we simply need to check whether it is T -legal, and the assumptions on the group imply this can be done in polynomial time. For the latter claim, given P ∈ A B for a finite set B ⋐ G, nondeterministically guess a convex set C ⋑ B of polynomial size, and then a pattern Q ∈ A C . Verify that Q is T -legal and Q| B = P .
Note that if C is a convex geometry, once we have guessed a convex set C ⊃ B which is of polynomial size in the set of B, we can actually compute the convex hull of B in deterministic polynomial time by using Lemma 5 to drop elements one by one from C while keeping it a convex superset of B. However, even if we assume that the true convex hull C can be computed in polynomial time, we still have to guess the pattern Q, and even with G = Z 2 it is not clear how to do this in polynomial time, indeed we do not know whether the language of a TEP subshift can be NP-complete G = Z 2 and the standard convex geometry.
While Theorem 4 shows that the number of patterns of a convex shape can be computed quickly, it seems much harder to count the number of legal patterns on non-convex sets, and indeed these counts seem to behave in a complicated way. We give some pattern counts in the following example (the calculations were done by computer).
Example 6: Let A = S 3 (the symmetric group on the set {1, 2, 3}) and consider the subshift X defined as follows In the orientation of Example 1, X is the Z 2 -subshift over alphabet S 3 where in every pattern a b c we have c(n) = a(b(n)) for all n ∈ {1, 2, 3}. This rule also determines a TEP family of patterns T ⊂ S {(0,0),(−1,0),(0,−1)} 3 and X is the corresponding TEP subshift. This is the subshift sampled in Figure 1c.
Even in the case of abelian group shifts over abelian groups, the number of patterns is not necessarily a power of the alphabet size |A|: For the sum rule over alphabet A = Z 6 with the same shape defining a group shift in Z Z 2 6 , the corresponding numbers for these five shapes are 7776 (of course), 108 = 2 2 · 3 3 , 432 = 2 4 · 3 3 and 3888 = 2 4 · 3 5 and (again) 3888, respectively. This also shows that the number of patterns of a given (non-convex) shape can depend on the rule.
For vector shifts such as the Ledrappier example, on the other hand, basic linear algebra shows that the number of patterns of any shape is a power of the cardinality of the underlying field.
We have no theoretical understanding of the counts on non-convex sets. Based on our brief experimentation on the TEP subshift X above, the counts typically have only 2 and 3 in their prime decomposition, but sporadically one sees other primes. We have seen 5 several times, 13 exactly once, and we have seen no other primes. We have not experimented systematically with other alphabet sizes, TEP shapes and rules, and with other groups, and have no idea whether this is a general trend.

An easier way to count: contours
If a group admits a (left-)invariant order, then we associate to every convex set a subset that can be filled arbitrarily, and assuming k-uniform g-extensions for suitable g, there are k ways to pick each cell after that. More precisely and generally, to each convex set C we will associate a subset E called its S-contour so that every possible filling of E is T -legal, and extends to a filling of C in exactly k |C|\|E| possible ways, whenever T ⊂ A S has k-uniform extensions in the maximal coordinate of S. In other words, the "free choices" are all made before all the "constrained choices". The drawback of the method compared to using an anti-shelling are that it only works for finite sets, and the filling order depends on S.
Suppose G is linearly ordered by a left-invariant order <, i.e. h < k ⇐⇒ gh < gk for all g, h, k ∈ G. Say that a S ⊂ G is in good position if 1 G ∈ S and 1 G is the <-maximal element of S (i.e. all elements of S are "negative"). Note that we can turn any TEP family of patterns T ⊂ A S into one with S in good position, without changing the SFT it defines, by translating its patterns by the inverse of the maximal element of the shape S.
Let S ⋐ G be in good position. Let C ⊂ G, and let Then E is called the S-contour of C. More generally, if S is not in good position, then we define the S-contour as the gS-contour for the unique g such that gS is in good position. Proof. Every pattern P : E → A is T -legal, because by the definition of E there are no translates of S contained in E. We consider a fixed such pattern and show that it has exactly k |C|\|E| extensions.
Let D = C \ E. Enumerate the vectors in D in the <-order, i.e. enumerate Let us show that if w ∈ {1, 2, ..., k} i and P w : E i → A is T -legal then there are exactly k distinct T -legal patterns P wa : E i+1 → A with P wa | Ei = P w and a ∈ {1, 2, ..., k}.
We have g i+1 S ⊂ E i+1 because g i+1 ∈ D and thus g i+1 S ⊂ C, and all vectors in g i+1 S \ {g i+1 } are <-smaller than g i+1 by left-invariance of <, so if they are not in E, they are among the g j with j ≤ i. Since T has k-uniform {1 G }-extensions, we have exactly k ways to fill the coordinate g i+1 so that in the translate g i+1 S we do not see a forbidden pattern of X. The patterns P wa are taken to be any enumeration of such patterns.
We claim that in fact the only translate gS such that g i+1 ∈ gS ⊂ E i+1 is the one with g = g i+1 . Namely, if g ∈ E, then gS is not contained in C, if g is among the g j with j ≤ i then gS does not contain g i+1 , and finally if g = g j for some j > i + 1, then gS ∋ g is not contained in E i+1 . This implies that all the patterns P wa are T -legal, since any forbidden pattern in P wa would have to have a domain of the form gS and contain the new coordinate g i+1 . Theorem 6. Let G be a group and let S ⋐ G be in good position. Let C ⊂ FinSet(G) be an S-UCP convexoid. Let X ⊂ A G be defined by a k-TEP family T ⊂ A S , and suppose T also has k-uniform {1 G }-extensions. Let C ∈ C and let E be the S-contour of C. Then for each pattern P : E → S, there are exactly k |C|\|E| patterns Q : C → A with Q| E = P such that Q X.
Proof. Apply the previous lemma, and observe that since C is convex and T is k-TEP, the T -legal pattern Q extends to a configuration of X.
This can be used to obtain formulas for the number of globally admissible patterns of a particular shape. We give a somewhat trivial example, and count the number (m × n)-rectangles that occur in a TEP subshift on Z 2 . Let S ⊂ Z 2 be finite, and let m i = max u, v∈S | u i − v i | − 1 for i = 1, 2. We say the width of A is m 1 and its height is m 2 .
Lemma 10. Let X ⊂ A Z 2 be a TEP subshift with defining shape S. Let m 1 and m 2 be the width and height of S, respectively, and suppose n 1 ≥ m 1 , n 2 ≥ m 2 . Then Proof. Clearly the size of the contour is n 1 m 2 + m 1 n 2 − m 1 m 2 .
Let us also reproduce the pattern count for the convex shape in Example 6.
Example 7: The group Z 2 is left-invariantly ordered by the lexicographic order. Consider the shape S = * * * defining a TEP subshift over an alphabet A with |A| = 6. In Example 6, the contour of the first shape on the list is marked with * s, and numbers mark the order in which the rest of the cells are filled in The contents of the contour positions can be picked arbitrarily, and the rest is determined uniquely, so the number of patterns is 6 5 = 7776, as indeed the computer claimed in Example 6. One can play with all the parameters to get more exotic examples: Example 8: Pick the vector w = (π, 1) (i.e. the irrational mathematical constant We see that there are 22 free choices and 39 constrained choices, confirming the number we obtained in Example 5 by sampling along an anti-shelling. Example 9: Just as happens with Z 2 , the space of left-invariant orderings of the two-generator free group F 2 is a Cantor set [19], so there are many choices for the order. Also, just like Z 2 , the free group admits a natural lexicographic order which is invariant by translations from both sides, but with a small interpretation detail, which we summarize (see also [8]): Apply the Magnus transformation M : F 2 → Z a, b where Z a, b is the (noncommutative) algebra of formal Z-linear combinations of words in {a, b} * , and the mapping is the group homomorphism (to the multiplicative semigroup of Z a, b ) induced by a → 1 + a on the positive generators. Observe that indeed 1 + a is invertible, and M (a −1 ) = 1 − a + a 2 − a 3 + · · · . Now define u ≤ v ⇐⇒ M (u) ≤ M (v), where power series are compared by ordering the variables first by length, then by the lexicographic order, and finally comparing the sequence of coefficients lexicographically. Let us call this the Magnus ordering.
An invariant order is of course determined by the positive elements. Let us argue in pictures and embed F 2 into Z 2 by its Cayley graph with respect to the free generators, so that it is a 4-regular tree. Right multiplication by the generator a is represented by a right edge, and right multiplication by b represents is represented by an upward edge. The following picture shows the ball of radius 4, with a black circle at nodes u ∈ F 2 satisfying u ≥ 1 F2 in the Magnus ordering. Now, consider the shape S = {1 F2 , a, b, a −1 , b −1 },. We see from the figure that a is the maximal element in the Magnus ordering, since a −1 S is the only translate of S that touches the identity and does not contain positive elements. Suppose thus that T ⊂ A a −1 S has 1-uniform {1 F2 }-extensions.
Next, we pick a set that we wish to tile. Though Lemma 9 does not require convexity, it is natural to pick a convex set for some notion of convexity, so that if T is also TEP, the T -legal patterns obtained are actually in the language of the subshift. In Section 5.2 we will define the tree convex sets, and the ball of radius 4 is itself tree convex. Thus, let us tile that set. The following figure shows the a −1 S-contour with large black circles, and numbers show the order in which the Magnus ordering suggests we fill the rest. One can verify that this indeed works out, i.e. if the contour itself can be picked arbitrarily without introducing a tiling error, and if we "slide" the shape a −1 S along the ordering, the value of each cell is uniquely determined. In particular there are |A| 108 valid configurations of this shape. Example 10: One may wonder whether permutivity in all translated lax corners is really needed for convex sets to be distributed uniformly in a natural measure, or whether determinism in a single coordinate (such that Lemma 9 applies) is enough. We show some indication that this is not the case, also outlining a connection between the TEP measure and the standard Z 2 -invariant measure on the spacetime subshift of a surjective cellular automaton. Consider a surjective cellular automaton on a full shift on Z, and its spacetime subshift X ⊂ A Z 2 , with time increasing downward. The local rule of the cellular automaton gives a family of allowed patterns of shape S = ({m, m + 1, · · · , n} × {0}) ∪ {(0, −1)} which has 1-uniform (0, −1)-extensions.
One can define a natural measure on its spacetime subshift, namely the measure which is uniform on the rows (the rows that appear in configurations are just the limit set of the CA, which is A Z by surjectivity). Namely, it is classical that the resulting measure on the spacetime subshift is invariant under the Z 2 -action. For bipermutive CA this is a particular case of a TEP subshift, and indeed the measure uniform on the lines is precisely the TEP measure, by Theorem 2 and the fact the horizontal lines are convex sets. Given any set, we can find a legal filling of it as in the proof of Lemma 9, by filling its contour with respect to any ordering having (0, −1) as the maximal element of S and then applying the local rule to the cells in that order. Now, for a non-bipermutive surjective CA this measure is not always uniform on all convex patterns. Let f : . This CA is surjective because it is right-permutive. If the CA is run upward, the distribution on the convex shape ((1, 0), (0, 1)) is that the contents (a, b) has probability 2/9 if b = a + 1 (because there are two ways to choose the contents of (0, 0)) and 1/9 otherwise (then necessarily b = a and we must choose the symbol 0 in position (0, 0)).

Subshift and solitaire of independence
In this section, we restrict to TEP subshifts, i.e. k-TEP for k = 1.
We introduce the independence subshift, and a closure property of it we call the solitaire (of independence). This allows one to construct more sets of the type studied in the previous section, where one can pick the contents arbitrarily.
The main "applications" of the solitaire that we are aware of (beyond just finding independent sets, of course) would require getting our hands dirty with some discrete geometry of Z d , and this is beyond the scope of this paper. Nevertheless, we find this solitaire rather fascinating, and feel it is worth presenting in the present text.
Definition 9. Let G be a group, and let X ⊂ A G be a subshift. For y ∈ {0, 1} G write supp(y) = {g ∈ G | y g = 1} for its support, and define the (topological) independence subshift I(X) ⊂ {0, 1} G by y ∈ I(X) ⇐⇒ ∀P ∈ A supp(y) : ∃x ∈ X : x| supp(y) = P. It is easy to show that indeed I(X) and I µ (X) are always subshifts, and also that they are down, meaning (y ∈ I(X) ∧ ∀g ∈ G : y ′ g ≤ y g ) =⇒ y ′ ∈ I(X). It is convenient to identify binary configurations with their supports when working with the solitaire, and we move freely back and forth. For y ∈ I(X), we call supp(y) (or y itself) an independent set. Definition 10. Let G be a group, and fix T ⊂ S ⋐ G. We give {0, 1} G the structure of an undirected graph, the (S, T )-solitaire graph by using the following edges: (y, y ′ ) ∈ E S,T ⊂ ({0, 1} G ) 2 if there exist g ∈ G and a, b ∈ gT such that a = b and y| G\{a,b} = y ′ | G\{a,b} , y| gS\{a,b} = y ′ | gS\{a,b} = 1 gS\{a,b} , y a = y b ∧ y ′ a = y ′ b . We call two configurations y, y ′ ∈ {0, 1} Z ((S, T )-)solitaire connected if they are in the same component of the S-solitaire graph, and we call edges ((S, T )-)solitaire moves. By default, if T is not mentioned and there is a fixed S-UCP convexoid on G, we assume T = g g −1 ∠gS is the set of translated lax corners. There is a strong relation between fillings of sets in the same solitaire component in a TEP subshift. Lemma 11. Let G be a group, S ⋐ G. Suppose X ⊂ A G is defined by a family T ⊂ A S which has 1-uniform T -extensions. Suppose y, y ′ ∈ {0, 1} G are (S, T )solitaire connected, and let N, N ′ be the supports of y, y ′ respectively. Then there is a unique homeomorphism φ : X| N → X| N ′ such that x| N = P ⇐⇒ x| N ′ = φ(P ) for all x ∈ X.
(Observe that the symmetric difference of N and N ′ is necessarily finite by definition of a solitaire move and connectedness.) Proof. Uniqueness is obvious once existence is proved. Existence follows from proving existence of φ for a single step (by composing the φ-maps for individual steps, since " ⇐⇒ " is transitive). For existence of φ for a single solitaire step, observe that 1-uniform T -extensions imply that, when considering configurations x ∈ X, the contents of x| gS\{a,b} for a, b ∈ gT put up a bijection between possible contents of x ga and x gb , in the sense that knowing one implies the contents of the other, given that x| gS\{a,b} is known. Thus, if gS \{b} ⊂ supp(y) for some y ∈ I(X), and the configuration y ′ is obtained from y by replacing a by b in the support, then the homeomorphism φ simply performs this deduction.

Lemma 12.
Let G be a f.g. group, S ⋐ G and fix an S-UCP convexoid on G. Suppose X ⊂ A G is TEP with shape S (resp. and µ ∈ M(X) is any invariant measure). Then I(X) (resp. I µ (X)) is a union of connected components of the (S, T )-solitaire graph, where T is the set of translated lax corners.
Proof. First he topological claim. It suffices to show that if (y, y ′ ) ∈ E S,T where T is the set of translated lax corners, and y ∈ I(X), then also y ′ ∈ I(X). Observe that if y and y ′ are connected by solitaire moves, then their supports N, N ′ differ in finitely many positions only. If the differences are contained in the ball B n of G and k is sufficiently large depending on the modulus of continuity of φ, we see that φ also gives a bijection between X| M and X| M ′ for M = N ∩ B n+k and M ′ = N ∩ B n+k , which are of the same cardinality. Thus For the measure-theoretic claim, observe that bijections on finite sets preserve the uniform measure.
Examples of independent sets can be produced very easily: whenever we obtain independent sets from contours, or by following any anti-shelling, we can apply the solitaire to produce more independent sets. The following example looks at the triangle shape on Z 2 . Example 11: Consider an arbitrary TEP subshift X with the shape S = * * * . It is easy to see that the configuration y with support Z × {0} is in I(X). This follows directly from Theorem 1 because Z × {0} is convex. Alternatively, it follows from basic theory of cellular automata by considering the spacetime subshift, similarly as in Example 10.
By applying the solitaire to this configuration y, one obtains a large family of independent sets. As an example, one can show that X| B = A B , where B is the following subset of Z 2 . m\n   1  2  3  4  5  6  7  1  1  3  16  122  1188  13844 185448  2  3  15  207  6252  339027 28920151  3  16  207  4971  292370 37248312  4  122  6252  292370 30354021  5  1188  339027 37248312  6  13844 28920151  7  185448  8 2781348   Table 1. Only the case n = 1 is about independent sets of course. The column n = 1 of the sequence looks rather exotic, and was not in the OEIS database in 2016 when we performed these calculations. Sequence A295928, added in 2017 [1], has a similar-sounding definition and agrees with these entries.
Example 12: There can be long-range dependencies in the homeomorphism φ even if the supports of y, y ′ have a small difference, in the following sense. Consider G = Z 2 , S = {(0, 0), (1, 0), (0, 1), (1, 1)} and the configurations y = * · · · · · · · · * * * * * * * * * * · * and y ′ = where * denotes 1 and · denotes a 0 in the convex hull of the set of 1s. These patterns are both easily seen to be in the connected component of the convexsupport configuration thus all three configurations are in I(X) whenever X is a TEP subshift with shape S. Now consider the bijection φ puts up between fillings of supports of y and y ′ . If all coordinates but the two where the supports differ have been filled, we have a bijection between the possible fillings. It is easy to see that (in any TEP X with shape S) this bijection depends on every other coordinate, i.e. the dependency between the two cells where y and y ′ differ depends on all coordinates.
We ask some questions about independent sets and the solitaire. The first question is a matter of linear algebra for the actual Ledrappier subshift, but seems difficult for general TEP subshifts with the triangle shape such as X from Example 6. The second is a more open-ended question, and does not seem easy even for the Ledrappier subshift. The experience of the author with Question 3 is that randomly generated elements of the connected component of a line (such as the one seen in Example 11) can usually be rather easily renormalized to the original line by playing a leisurely round of the solitaire. However, we do this in an ad hoc fashion, and do not have a general algorithm.
In the case of linear TEP subshifts, the independence subshift corresponds to a standard object from matroid theory (known as a column matroid ). We recall the connection and the simple proof. Here, a matroid on a countable G is a family I ⊂ FinSet(G) such that ∅ ∈ I, B ⊂ A ∈ I =⇒ B ∈ I, and the augmentation property Proposition 3. If X is linear TEP and µ the Haar measure, then the finite supports of configurations in I(X) and I µ (X) form a matroid.
Proof. We show the finite augmentation property. Let A, B be two independent sets with |A| > |B|. Each vector v ∈ X| A\B ⊂ F A\B appears as the restriction of some vector w v ∈ X| A∪B such that w v | A∩B = 0 A∩B , by the independence of A. Choose such a vector w for each v, and define the functions Since |B| < |A|, also |B \ A| < |A \ B|, and thus π(χ(v)) = π(χ(u)) for some v = u. It follows that the support of w = χ(v) − χ(u) is contained in A. Choose a coordinate i such that w i = 0. Then B ∪ {i} is independent.
For a general TEP subshift X, we suspect I(X) is not always a matroid.

Examples of midpointed convex geometries
Question 4. Which groups admit an invariant midpointed convex geometry?
In this section, we construct examples of S-midpointed convex geometries for arbitrary finite sets S. By Lemma 7, we obtain UCP convex geometries from this, thus the results of Section 4 can be directly applied.
The following results are shown: For the Heisenberg group and the free group, we give invariant (fully!) midpointed convex geometries. The midpointed convex geometry of the Heisenberg group in Section 5.3 is a special case of a construction of Yves de Cornulier [21]. We also show that Z 2 admits a midpointed invariant convex geometry that properly contains the standard one.
We show that not all torsion-free abelian groups, nor f.g. metabelian groups, admit such convex geometries. Nevertheless, for all strongly polycyclic groups and indeed for a large class of groups obtained from group extensions (such as the Baumslag-Solitar group Z[1/2]⋊Z) we construct S-midpointed invariant convex geometries all finite sets S. For an (a priori) even larger class, we construct Smidpointed convex geometries (that are not necessarily invariant), and show that this amounts to simply ordering the group in a suitable way.

Finitely-generated free abelian groups
On Z d , we have the standard convex geometry, and on Z this is obviously the only convex geometry that is invariant. The relevant facts about this geometry were already mentioned in Section 3.
We note that on Z 2 , this is not the end of the story: There exists a invariant midpointed convex geometry on Z 2 that properly contains the standard convex geometry.
Proof. Let B be any set with |B| = 3 which is midpointed, but is not convex for the standard geometry C and its convex hull with respect to C has exactly one new element u. For example, the set B = {(0, 0), (1, 1), (2, 5)} ⊂ Z 2 has this property, as its convex hull contains only one new element u = (1, 2). Add B and all its translates to the standard convex geometry, call the new family of sets D. It is easy to see that D is closed under intersections, because all sets of cardinality 2 contained in B are in C, thus in D. Every finite set is also still contained in a convex set of C, thus of D. By Lemma 5 it is enough to show prove the corner addition property for D. Suppose thus C D and both are in D. If neither has a translate equal to B, the claim is clear. If C = v + B for some v ∈ Z 2 , without loss of generality (by translating) we may assume C = B. We observe that necessarily u ∈ D because every convex set of C containing B contains its convex hull, and any proper superset of B in D is in C. Thus, D ∋ C ∪ { u} ⊂ D as required. If D = v + B, the claim is easy to show using the fact all midpointed sets of cardinality 2 contained in B are in C.
On the other hand, in Section 5.4 we will see that there is no invariant midpointed convex geometry on Z 2 that properly contains the standard convex geometry and the set B ′ = {(0, 0), (3, −1), (2, 3)} ⊂ Z 2 , even though this set in itself is midpointed.
By a compactness argument, if there exists a invariant midpointed convex geometry on a group G, there exists a maximal one (under inclusion). It seems plausible that the "pseudoconvex sets" that can coexist with the standard ones must all be "close" to standard convex sets on a large scale, although we have no precise result of this form.

Free groups
First, we construct a convex geometry on a general tree. The only standard convex geometry we know on a tree is the family of geodesically convex sets. Unfortunately this family is not midpointed when considered on Cayley graphs of free groups.
Our convex geometry will instead be obtained by requiring that if the geodesic between two vertices of a convex set C goes through the center of a ball, and the ball does not contain those vertices, then the ball is contained in C.
A tree is a simple undirected graph (V, E), E ⊂ {{u, v} | u, v ∈ V, u = v} which is connected and does not contain a cycle. In a tree, there is a unique path of minimal length, i.e. a geodesic u = u 0 , u 1 , ..., u k = v with (u i , u i+1 ) ∈ E for all applicable i, between any two vertices u, v ∈ V . The vertices of the geodesic are contained in every path between u and v. Write geod(u, v) for this path (or, abusing notation, the set of vertices on this path), and d(u, v) for the length of this path (number of edges).
Definition 11. Let T = (V, E) be a tree. Define the tree convex sets C T ⊂ P(V ) as the family of sets C ⋐ V such that Observe that tree convex sets in the above sense are geodesically convex, since by taking v ∈ geod(u, w), v / ∈ {u, w}, t = v, we have 0 = d(v, t) < 1 ≤ min(d(v, u), d(v, w)). The converse does not hold.
Theorem 7. Let T = (V, E) be a tree. Then the tree convex sets of T form a convex geometry.
Before proving this, we introduce a bit of notation and prove a simple lemma. Fix a tree T = (V, E) and for u, w ∈ T write Proof. We have five cases, depending on where the geodesic from p to t deviates from the triangle formed by u, w, t, and where the path from s to the geodesic between p and t branches off, up to swapping the roles of u and w. These cases are listed as (a)-(e) of Figure 3. We also explain them in words: define v as the last common node of geod(t, u) and geod(t, w), define r as the last common node of geod(t, p) and geod(t, v) ∪ geod(v, u) ∪ geod(v, u) (where the latter is interpreted as the union of the vertex sets). Let q be the last common node of geod(s, t) and geod(s, p). Now, (a) and (b) are the cases where r lies on geod(t, v), and (a) and (b) are respectively the cases where q lies on geod(t, r) or geod(r, p) respectively. The cases (c), (d) and (e) take care of the situations where r does not lie on geod(t, v). By symmetry, we may assume it lies on geod(v, w). Then we have three cases where q can lie, geod(t, v), geod(v, q) or geod(q, p), and these are respectively the cases (c), (d), (e).
It is now easy to see from the inequalities between lengths that Indeed, in case (a), d(q, s) < d(q, t), t ∈ [uw] and geodesics from s to u and w go through q, so s ∈ [uw]. In case (b), and r separates u and t from s and p, so we may replace t by u in s ∈ [tp]. In case (c), since s ∈ [tp] we have Cases (d) and (e) are proved like case (b).
We are now ready to prove Theorem 7.
Proof of Theorem 7. For S ⋐ V , define Equivalently, τ (S) = u,w∈S [uw]. It is clear that τ (C) = C for any tree convex set C ⋐ V . We show that τ is a closure operator. The only non-trivial thing to verify is idempotency. Suppose t ∈ [uw] and s ∈ [tt ′ ] for some u, w ∈ V and t ′ ∈ τ (S). It is enough to show that s ∈ τ (S). By the previous lemma, , then s ∈ τ (S) and we are done. By symmetry we may thus assume s ∈ [ut ′ ]. We have t ′ = [u ′ w ′ ] for some u ′ , w ′ ∈ τ (S), so again by the previous Now, let us show the anti-exchange axiom. Suppose C ∈ C T and u, a / ∈ C. Suppose a ∈ τ (C ∪{u}). Then there exists w ∈ C and v ∈ V such that d(v, a) < min(d(v, u), d(v, w)). We may assume geod(v, a), geod(v, u), geod(v, w) are edgedisjoint paths by picking the branching point v at minimal distance from a.
Suppose now for a contradiction that we had some c ∈ C and b ∈ V such that d(b, u) < min(d(b, a), d(b, c)) and geod(b, a), geod(b, u), geod(b, c) are edgedisjoint. Consider the geodesic geod(a, b). It agrees with some initial segment of geod(a, v), and then possibly some initial segment of geod(v, u) -it is impossible for it to continue along geod(v, w) as then geod(b, u) would intersect geod(b, a).
It is impossible for geod(a, b) to branch off geod(a, v) before reaching v, as in this case we would have If geod(a, b) does reach v, then b ∈ geod(v, u), and (d(b, c), d(b, w)), and thus u ∈ C, a contradiction.
Recall that elements of the free group with generating set A are in bijection with reduced words over an alphabet A ± = A∪{a −1 | a ∈ A} where A is the free generating set, where a word is reduced if aa −1 and a −1 a, a ∈ A, do not occur as subwords [18]. The group operation is concatenation followed by reducing the word by removing (or canceling) such subwords aa −1 , a −1 a (in arbitrary order).
Theorem 8. For all n ∈ N, the free group F n admits an invariant midpointed convex geometry.
Proof. The Cayley graph of G = F n over a free generating set A ± is a 2|A|regular tree. The tree convex sets C for this tree are defined in terms of the geodesic metric, thus are invariant under any tree automorphism, in particular the group translations.
We show that C is midpointed. Since it is invariant, it is enough to show 1 G ∈ {g, g −1 } for any g ∈ G. Write g in reduced form as a word over A ± and then as g = uvu −1 for u of maximal length (where u −1 is the word obtained by reversing the word and changing the exponent of each letter). We have |v| ≥ 1 and g −1 = uv −1 u −1 . Now, d(1 G , u) = |u| and d(u, g) = |vu −1 | = |v −1 u −1 | = d(u, g −1 ) > |u|, so indeed 1 G ∈ τ ({g, g −1 }).
We give an analog of Example 1 for the free group.
Example 13: The ball C of radius 4 w.r.t. the free generators of the free group is easily seen to be tree convex (every ball is). As in Example 1, we can construct an anti-shelling by increasing our set at random by adding random elements of C, without breaking convexity. One such sequence is shown in Figure 4.
We can use this sequence to list all valid patterns of shape C, for any TEP subshift (with any S). For example, this applies to shapes S = {1 G , g}, implying that the ordering must have the property that the induced ordering of every left coset of every cyclic subgroups g sees an anti-shelling of Z, i.e. a unimodal sequence where the values first decrease and then increase. For example on the central horizontal line a ∩ C we see (102,57,33,22,13,21,32,66,156).
Using the shape S = {1 F2 , a, b, a −1 , b −1 }, and considering any TEP subshift with respect to that shape, one can check that values of 108 cells can be picked freely, and the rest are determined by a translate of S (of course, each by exactly one translate of S). This reconfirms that there are |A| 108 legal configurations, as we also saw in Example 9. Because C is tree convex, they all indeed extend to a valid configuration on the entire free group.
The shape S = {1 F2 , a, b, a −1 , b −1 } is rather special, and one could actually even use the convex geometry of geodesically convex shapes when working with it (though we omit the proof). With most shapes, for example the shape T = {1 F2 , a, b, ab}, the geodesically convex sets would not work, i.e. it is possible to find an anti-shelling of C with geodesically convex sets such that at some point, a single coordinate is determined by two distinct translates of T . We leave finding an example of such an anti-shelling to the interested reader.

The Heisenberg group
For most of our applications it suffices to prove that a group admits S-midpointed (invariant) convex geometries, and we construct such convex geometries for all strongly polycyclic groups in Section 5.5, which covers the Heisenberg group. Of course, having the same convex geometry work for all S at once is desireable for aesthetic reasons, especially as Theorem 2 is to some extent only as interesting as the convex geometry it is applied to. The construction in Section 5.5 (in fact necessarily in that generality) does not achieve this, i.e. the construction depends on S.

Question 6. Do all strongly polycyclic groups admit an invariant midpointed convex geometry?
We asked in MathOverflow [21] whether strongly polycyclic groups, and especially the discrete Heisenberg group, admit invariant midpointed convex geometres. Yves de Cornulier proved the following theorem.
The convex sets of this construction are very natural ones, they are obtained by embedding the group into a continuous Lie group, and taking as convex sets the intersections of the group with the images of standard convex sets of R d in the exponential map.
The proof is not entirely trivial (at least from first principles), and we do not include it here, as it would require a relatively long tangent into the theory of Lie groups. However, we include the specialization of Cornulier's proof in the case of the Heisenberg group, which already turns out quite interesting, and can be directly verified by elementary algebra. Proof. We recall the representation of the Heisenberg group in exponential coordinates. First, it is well-known that the discrete Heisenberg group is isomorphic to the group of matrices of the form The Lie algebra of the Heisenberg group can be identified with real matrices where the diagonal and subdiagonal are zero, and the exponential map amounts to which is clearly bijective. Conjugating the group operation through this map, we obtain that the continuous Heisenberg group can be seen as R 3 with the following group operation (This is also a special case of the Baker-Campbell-Hausdorff formula.) Conjugated through the exponential map, the discrete Heisenberg group is the subgroup where a, b and c + ab 2 are integers, i.e. the set H = {(a, b, c) ∈ Z 2 × 1 2 Z : c ∈ Z ⇐⇒ 2|ab}. The group (H, * ) may be called the representation of the discrete Heisenberg group in exponential coordinates. It is a cocompact lattice in the continuous Heisenberg group (R 3 , * ).
Now, let C ⊂ P(R 3 ) be the family of compact convex sets in the standard sense of R 3 . Observe that, apart from the restriction that the sets C ∈ C be finite, C satisfies our axioms of a convex geometry. Thus it is easy to see that D = {C ∩ H | C ∈ C} ⊂ P(H) is a convex geometry.
To see that D is invariant with respect to * , observe that v → u * v is affine in v for fixed u. Thus, if D ∈ D then D = C ∩ H for some C ∈ C, and u * C ⊂ R 3 is convex as an affine image of a convex set. If u ∈ H, we have u * D = ( u * C) ∩ H since H is invariant under H-translations (since it is a subgroup), thus we have u * D ∈ D.
To see that D is midpointed, we observe that (for example by direct computation) every element of R 3 has a unique square root with respect to * , and this turns out to be (a, b, c) = (a/2, b/2, c/2). Thus the claim follows since convex sets of R 3 are midpointed.
Example 14: Consider the Heisenberg group (H, * ) in exponential coordinates as in the above proof. Clearly so the subgroup K is convex. Suppose now that S ⋐ H and ∀g ∈ H : gS ⊂ K. Then Theorem 2 implies that every TEP subshift X ⊂ A H with shape S admits an invariant measure that samples the contents of K from the uniform Bernoulli distribution of A K .
In the special case of a shape satisfying S ⊂ ({0} × Z 2 ) ∪ {(1, 0, 0)}, one can easily deduce the statement of Theorem 1 that the restriction to K is full, i.e. X| K = A K , from a cellular automata style argument. We sketch this argument: Given any values for the subgroup K, the values in the coset ({0} × Z 2 ) * (1, 0, 0) are obtained by first applying a (linear) shear map and then a classical twodimensional cellular automaton rule. That rule is totally extremally permutive in the sense of [23], and thus surjective, thus it is also surjective when composed by the shear map. A compactness argument shows that the restriction to (0, 1, 0), (0, 0, 1) is indeed full.

Groups without midpointed convex geometries
Lemma 14. Let G be a group and let C ⊂ FinSet(G) be a midpointed convexoid. Then for all C ∈ C and for all g, h ∈ G, if g ∈ C and gh n ∈ C for n > 0, then gh i ∈ C for all i ∈ {1, ..., n − 1}.
Proof. If n = 1 there is nothing to prove. The full claim follows from the claim for n at most equal to the order of h, since for h of finite order and h n = 1 G , the claim implies that any set containing g, since it contains also g = gh n , already contains gh i for all i ∈ {1, ..., n − 1}, thus in fact all of g h .
Suppose then that n is at most the order of h, so the elements gh i are distinct for i ∈ {1, ..., n − 1}. Suppose the lemma is false and D ⊃ {g, gh, gh 2 , ..., gh n } and pick an anti-shelling from C to D. Let E be the last set in this sequence which does not yet contain all of {g, gh, gh 2 , ..., gh n }. Then E is convex and gh i / ∈ E for a unique i, meaning gh i / ∈ {gh i−1 , gh i+1 }, contradicting midpointedness.
Proposition 6. If G is not torsion-free then it does not admit any midpointed convexoid.
Proof. Suppose g ∈ G satisfies g n = 1 G for n ≥ 2. By the previous lemma, any convex set containing g would have to already contain g , obviously contradicting the corner addition property.
Say g ∈ G has infinitely many roots if for infinitely many n ∈ N there exist h ∈ G such that h n = g.

Proposition 7.
If G is a group where some element g ∈ G \ {1 G } has infinitely many roots. Then G does not admit a midpointed convexoid.
Proof. This is clear form the previous example if G is not torsion-free, so suppose G is torsion-free. Suppose there is a midpointed convexoid on such G and let C ⊃ {1 G , g} be any convex set.
By torsion-freeness, the solutions h to h n = g are distinct for distinct n ∈ N, so since there are infinitely many roots we can find an equation h n = g with h / ∈ C. We have h 0 = 1 G ∈ C, h / ∈ C, h n = g ∈ C, contradicting Lemma 14.  Proof. By Lemma 2, if C is an invariant S-midpointed convex geometry on G, then {C ∩ H | C ∈ C} is one on H. Invariance and S-midpointedness are easy to check. If C is an invariant S-midpointed convex geometry on H, then we obtain one on G by applying the closure operation independently in left H-cosets, in the sense of Lemma 3. Invariance and S-midpointedness are easy to check.
Lemma 16. Let G = G n for an increasing union of groups G i ≤ G i+1 . Suppose each G i admits an invariant S-midpointed convex geometry for each S ⋐ G i . Then G admits an invariant S-midpointed convex geometry for each S ⋐ G.
Proof. Let S ⋐ G. Then S ⋐ G i for some i, and G i admits an invariant S-midpointed convex geometry. Apply the previous lemma with H = G i . The following covers for example the rationals and dyadic rationals, which do not admit any midpointed convex geometry by the previous section.
Proposition 8. Let G be a torsion-free abelian group. Then G admits an invariant S-midpointed convex geometry for each S ⋐ G.
Proof. A torsion-free abelian group is by definition locally torsion-free finitelygenerated abelian, i.e. locally-(Z d for some d). The group Z d admits an invariant midpointed convex geometry, a fortiori it admits an invariant S-midpointed convex geometry for each S ⋐ G i , and the previous theorem applies.
S-midpointed convex geometries for all finite sets S ⋐ K, and H is torsion-free abelian, then G admits invariant S-midpointed convex geometries for all finite sets S ⋐ G.
Proof. We first observe that it is enough to show this for H = Z: By Lemma 16 it is enough to show this for all finitely-generated subgroups, thus we may assume H is finitely-generated, i.e. H ∼ = Z d . We thus obtain the result by repeating the H = Z case d times. Since Z is free, the extension splits and we may suppose G = K ⋊ Z with K ⊳ G a normal subgroup.
Let S ⋐ G. We construct an invariant S-midpointed convex geometry on G. We may suppose π(S) ⊂ N by possibly replacing some elements of S with their inverses. On K, fix an (S ∩ K)-midpointed invariant convex geometry. As convex sets pick sets C ⋐ G satisfying the following: • for all g ∈ G, g −1 (gK ∩ C) ⊂ K is convex in K.
Invariance of this family is easy to show. We claim that it is a convex geometry. It is clear that the empty set is convex, and it is easy to show that the intersection of two convex sets is convex. For this, observe that if the first property holds for g ∈ G i it holds for gk for all k ∈ K, since the convex geometry of K is invariant. We show the anti-exchange axiom. By Lemma 5, it is enough to show the corner addition property. Let thus C D, C, D ∈ C.
Suppose first (π −1 (π(C)) ∩ D) \ C = ∅, then pick any element a of this set which maximizes π(a), and is such that (C ∩ aK) ∪ {a} is convex in aK with respect to the convex geometry of K (this is possible since the convex geometry of K has the corner addition property). Then C ∪ {a} is convex in G, i.e. the two properties stated above hold. Namely, the first property was explicitly enforced. Suppose the second property fails for some triple c, d, e. Then we must have c = a, since the choices of e only deal with the π-projection, which was not changed by the addition of a. However, since π(a) was taken to be maximal and D is convex, we must in fact have d ∈ C, a contradiction. Thus, the second property holds.
Suppose then that (π −1 (π(C)) ∩ D) = C. Observe that it follows from the second property that all convex sets of G have intervals as their π-projections. Thus π(C), π(D) ⊂ Z are intervals, and we are in the case where C and D agree when restricted to the preimage of the interval π(C) in G. If min(π(D)) < min(π(C)), then pick any element a ∈ D \ C which maximizes π(a) under the constraint π(a) < min π(C), i.e. any element that extends the π(C ∪ {a}) by adding a new minimum. We must have π(a) = min(π(C)) − 1 since π(D) is an interval. Then C ∪ {a} is convex -singletons are closed in the convex geometry of K, so the only problem could be that the second property fails for some triple c, d, e with c = a, and e ∈ C. Since D is convex and e ∈ C, we have d ∈ D, and thus in fact d ∈ C since π(d) is in the interval where C and D agree. Thus the second property must in fact hold.
If max(π(D)) > max(π(C)), then pick any element a ∈ D \ C which minimizes π(a) under the constraint π(a) > max π(C). Again C ∪ {a} is convexsingletons are closed in the convex geometry of K, so the only problem could be that the second property fails for some triple c, d, e with e = a. Since D is convex, we have d ∈ D, thus d ∈ C because π(d) is again in the interval where C and D agree. Thus the second property must hold in this case as well.
Finally, we show S-midpointedness. Suppose C is convex, and gh, gh −1 ∈ C with h ∈ S. If π(h) = 0, g ∈ C follows from the S-midpointedness of the convex geometry of K and the first property of convex sets. If π(h) > 0, then consider the triple c = gh −1 , d = g, e = gh. We have π(c) < π(d) < π(e), c, e ∈ C, and c −1 d = h ∈ S. Thus, d ∈ C by the second property of convexity, and thus our convex geometry is S-midpointed. Proof. By definition, a strongly polycyclic group is obtained by repeated Zextensions 1 → K → G → Z → 1, and the previous theorem applies. Strongly polycyclic groups are well-known to have decidable word problems, and it is easy to see from the construction that the convex geometries obtained are decidable.
The following is direct from the previous theorem, Theorem 1 and Lemma 7.
Corollary 4. Let G be a strongly polycyclic group S ⋐ G, T ⊂ A S have kuniform S-extensions for some k, and X be the corresponding k-TEP subshift. Then X has decidable language.
Example 17: The above theorem applies to Z d , giving another construction of S-midpointed convex geometries for all S for these groups (but these convex geometries are not midpointed). The Baumslag-Solitar groups Z[ 1 n ] ⋊ Z (which by the previous section do not admit any midpointed convex geometries) admit invariant S-midpointed convex geometries for all finite sets S. So does the wreath product Z ≀ Z. By the results of Section 5.2 we have that F 2 × Z admits S-midpointed invariant convex geometries for all finite sets S. In each case, it is clear from the construction that the convex geometries are decidable, giving decidability of languages of k-TEP subshifts.
The following theorem summarizes our results about invariant S-midpointed convex geometries. Then every group G ∈ G admits an invariant S-midpointed convex geometry for each S ⋐ G. Question 7. Which groups admit an invariant S-midpointed convex geometry for each S ⋐ G?

Non-invariant convex geometries
In this section, we show that constructing not necessarily invariant S-midpointed convex geometries is equivalent to ordering the group in a way that avoids lacking midpoints. This is the bare minimum needed to apply Theorem 1 and Theorem 2. As an application, we show that groups admitting such convex geometries are closed under group extensions, and give some examples not covered by our invariant constructions.
Definition 12. Let < be a total order on a subset A of a group G, and let S ⊂ G. We say < is an S-midpointed order if ∀g ∈ A, h ∈ S : Lemma 17. Let G be a countably infinite group and S ⊂ G. Then G admits an S-midpointed convex geometry if and only if it admits an S-midpointed ordering of order type ω.
Proof. From an S-midpointed convex geometry C, we obtain a midpointed ordering by taking any unbounded anti-shelling and collecting the corners. Namely this gives an ordering G = {g 1 , g 2 , ...} such that {g 1 , g 2 , ..., g n } is convex for all n, and the fact C is S-midpointed directly translates into this ordering being S-midpointed.
Conversely, if G admits an S-midpointed ordering of order type ω, then the lower sets of this order are easily seen to yield an S-midpointed convex geometry.
Definition 13. Let G be a countably infinite set and for each i ∈ N let F i be a subset of G. We say that two orderings of G are (F i ) i -consistent if for all i, the orderings they determine on F i are equal.
Lemma 18. Let G be countably infinite, let (G, <) be a total well-order, and let (F t ) t be a family of finite subsets such that each g ∈ G appears in finitely many of the F i . Then there exists an (F t ) t -consistent ordering ≺ of G of order type ω.
Proof. Let G = {g 1 , g 2 , g 3 , ...} be some well-order of order type ω. Construct another order G = {h 1 , h 2 , h 3 , ...} by always setting h i = g j where j is minimal such that for all F t ∋ g j , all the elements g k ∈ F t which appear before g j in the order < already appear in {h 1 , h 2 , ..., h i−1 }.
First, we observe that this process never stops, i.e. that an infinite sequence (h i ) i is indeed constructed: the first element g j of the initial ω-segment of < which has not yet been added is always available for adding, since all its <predecessors have been added.
Next, we claim that (h i ) i indeed enumerates G. Suppose not, and let g j be minimal in the order < such that g j is never added as h i . After finitely many enumeration steps, we never add g j ′ with j ′ < j as h i (because there are finitely many such j ′ ), thus the only possible reason g j is not enumerated on a particular step i is that for some F t ∋ g j , some g k ∈ F t that appears before g j in the order < does not appear as {h 1 , h 2 , ..., h i−1 }. But all such g k (of which there are only finitely many) are eventually added into the order, since g j was taken to be <-minimal, a contradiction. Thus, the sequence (h i ) i is an ordering of G with order type ω.
Next, we show that (h i ) i is (F t ) t -consistent. Suppose not, and for some t, we have h i , h i ′ ∈ F t with i < i ′ but h i > h i ′ . This means that at step i, we enumerated h i even though h i ′ < h i had not yet been enumerated, contrary to the process. Proof. The non-trivial direction is to show that the order type of a a midpointed well-order can be changed to ω. We observe that, setting F g,h = {gh i | i ∈ {−1, 0, 1}} ∩ A for g ∈ A, h ∈ S, we obtain a countable family of finite sets such that each a ∈ A appears in only finitely many of them. Any ordering that is (F g,h ) g,h -consistent with an S-midpointed order is an S-midpointed order. Thus the claim follows from the previous lemma.
Lemma 20. Let G be a countable group, 1 → K → G π → H → 1 be an exact sequence and S ⋐ G finite. If H admits a π(S)-midpointed convex geometry, and for all g ∈ G, K admits an (S ∩ K)-midpointed convex geometry, then G admits an S-midpointed convex geometry.
Proof. We argue with orderings, using Lemma 17. Pick a section h 1 , h 2 , ... for π, ordered according to a π(S)-midpointed ordering of H, and for k, k ′ ∈ K, order G by h i k < h j k ′ when i < j or i = j and k < k ′ in the (S ∩K)-midpointed ordering of K. The order type is ω 2 .
This ordering is S-midpointed: If g > max(gh −1 , gh) in this ordering, then we must have π(h) = 1 H , since we ordered the cosets according to a π(S)midpointed ordering of H. But if π(h) = 1 H , then h ∈ S ∩ K, and g > max(gh −1 , gh) contradicts the fact we used a (S ∩ K)-midpointed ordering of K on the individual cosets.
Since ω 2 is a well-order, the result follows from Lemma 19.
In particular, by ∀-quantifying the sets π(S) and (S ∩ K), we get a version of Theorem 10 in the non-invariant setting. Note that here there are no restrictions on the extensions. Theorem 12. Let 1 → K → G π → H → 1 be exact. If K and H admit S-midpointed convex geometries for all finite sets, then so does G.
By the results of Section 5.2 and the previous theorem we have for example that the wreath product Z ≀ F 2 (the semidirect product where the free group acts on Z F2 by translation) admits S-midpointed convex geometries for all finite sets S. Though we include no precise decidability statements, it is clear that this convex geometry can be constructed so that the convex sets are a decidable family, thus TEP subshifts on this group have decidable languages. This is not, at least for any obvious reason, covered by the results of the previous section.
One can also prove a non-invariant analog of Lemma 16 (with a similar proof).
Lemma 21. Let G = G n for an increasing union of groups G i ≤ G i+1 . Suppose each G i admits an S-midpointed convex geometry for each S ⋐ G i . Then G admits an S-midpointed convex geometry for each S ⋐ G.
The following theorem summarizes our results about non-invariant S-midpointed geometries.

Theorem 13. Let H be the smallest family of groups such that
• free groups and torsion-free abelian groups are in H,

• H is closed under direct limits,
• H is closed under subgroups, • H is closed under group extensions.
Then every group G ∈ H admits an S-midpointed convex geometry for each S ⋐ G.
Question 8. Which groups admit an S-midpointed convex geometry for each S ⋐ G? 6 Kaplansky's and Gottshalk's conjectures By Proposition 2, the existence of S-UCP convex geometries for all finite sets S (equivalently, S-midpointed convex geometries for all finite sets S) implies that all TEP subshifts with shape |S| ≥ 2 have more than one configuration, and all k-TEP subshifts with k ≥ 2 are uncountable.
Question 9. Are TEP subshifts with shape |S| ≥ 2 nonempty on all torsionfree groups? Do the always have at least |A| configurations (where A is the alphabet)?
We do not know the answer, but we show that proving that they always have at least two configurations should be difficult if it is true: in the linear case, whether a TEP subshift has at least two configurations is directly related to Kaplansky's conjectures and Gottshalk's surjunctivity conjecture.
An element p ∈ R of a ring R admits a weak inverse if pqp = p for some q ∈ R. The element p ∈ F [G] defines a linear TEP subshift X p = {x ∈ F G | xp = 0}, where x ∈ F G is identified with the formal sum g∈G x g · g. It also defines a linear map f p : F G → F G by f p (x) = x · p, X p = ker f p . This is clearly continuous and shift-commuting for the left shift gx h = x g −1 h . We say p is injective (resp. surjective, bijective) if this map is injective (resp. surjective, bijective).
We list some statements about p ∈ F [G] with |supp(p)| ≥ 2, for F a field, G a group.
• T ⇐⇒ "X p contains at least |F | configurations" • O ⇐⇒ "f p is not one-to-one" • U ⇐⇒ "p does not have a right inverse" • S ⇐⇒ "f p injective implies f p surjective" • W ⇐⇒ "p does not have a weak inverse" The property T is of course strongly related to Question 9 above. Kaplansky's unit conjecture states that U holds for any torsion-free group G. Gottshalk's surjunctivity conjecture [10] implies that S holds universally (and indeed even for non-linear CA in place of f p ). It is not clear to us what the strength of W is, though clearly it implies U . Note that all of these statements are true for G = Z, F any field and p ∈ F [G] arbitrary (with support size at least two). We record some connections between these. Proof. Since f p is linear and X p = ker f p , f p is injective if and only if X p = 0 if and only if dim X p ≥ 1. Proof. The equivalence O ⇐⇒ T is the proposition above. For the implication W =⇒ O, we show the contrapositive ¬O =⇒ ¬W . If f p is injective then f p : F G → f p (F G ) is bijective so by compactness it admits a continuous inverse g : f p (F G ) → F G which is automatically shift-invariant and linear, thus we can write g(x) = x · q for some q ∈ F [G] (valid on the image of f p ). We have x · pqp = f (g(f (x))) = f (x) = x · p for all x ∈ F G , in particular by applying this to the configuration with 1 ∈ F at identity and 0 ∈ F elsewhere (so the formal series 1 · 1 G ) we obtain pqp = p, and W does not hold.
Next we show O =⇒ U , again let us show the contrapositive ¬U =⇒ ¬O instead. Suppose pq = 1 G . Then f q (f p (x)) = xpq = x, so f p is injective, that is, ¬O.
Suppose then S ∧ U . We show that O holds (since O ⇐⇒ T ). If ¬O, then f p is one-to-one, and S then implies is it bijective. By the above proof of ¬O =⇒ ¬W , we have pqp = p for some q ∈ F [G]. Then f q must in fact be the inverse of f p , so we have pq = 1.
We restate the above observations (except the one about W ) in words: Proposition 10. Consider any group ring element p ∈ F [G] with support size at least two, F a finite field and G a group. If X p has at least two legal configurations, then Kaplansky's unit conjecture holds for p. If Gottshalk's surjunctivity conjecture holds for f p and Kaplansky's unit conjecture holds for p, then X p has at least |F | legal configurations.