Three-Dimensional Affine Spatial Logics

We focus on a branch of region-based spatial logics dealing with affine geometry. The research on this topic is scarce: only a handful of papers investigate such systems, mostly in the case of the real plane. Our long-term goal is to analyse certain family of affine logics with inclusion and convexity as primitives interpreted over real spaces of increasing dimensionality. In this article we show that logics of different dimensionalities must have different theories, thus justifying further work on different dimensions. We then focus on the three-dimensional case, exploring the expressiveness of this logic and consequently showing that it is possible to construct formulas describing a three-dimensional coordinate frame. The final result, making use of the high expressive power of this logic, is that every region satisfies an affine complete formula, meaning that all regions satisfying it are affine equivalent.


History and Philosophy
Spatial logic, as the term has been used, can be viewed as built using any first-order language with geometrical interpretation, where variables range over geometrical entities and relation and function symbols are interpreted as geometrical relations and functions. However, in most instances, the name accompanies region-based, rather that point-based systems, meaning that the geometrical entities variables range over are not points but some collections of point. Although the name itself might be an invention of the early twenty-first century (see [1]), spatial logics have rich and diverse background: after all, the notion of space is a staple in philosophy. 1 One of the most famous treatments of space was proposed by Kant, who in Critique of Pure Reason ( [10]) argues that geometry is both synthetic and a priori (using his, now well-known, labels). Since the argument seem to be hinging on the existence of only one type of geometry, the development of new, non-Euclidean geometries in the nineteenth century was considered as a threat to Kantian views. Bertrand Russell, in one of his earliest publications, tries to defend Kant's approach (see [15]. Moreover, the approach of many nineteenth-century geometers was very philosophically informed. For example, Moritz Pasch -most famous perhaps for figuring out the gaps in Euclid's reasoning -viewed geometry as having a decidedly emprical basis (see e.g. [12]). As a consquence, his analysis starts not with the Euclidean but rather with, what now is known as, affine geometry: one, where the notion of metric is not important. Thus, affine geometry can be viewed as emphasising qualitative rather than quantitative aspects of geometrical thinking. This theme is also important for contemporary researchers working within the so-called qualitative spatial reasoning field. Logical formalisms that came from that field are sometimes called spatial logics, and those spatial logics that apply affine notions are the focus of our article. Although there has been some interest in such type of logic (see e.g. [3,6] as well as [14,21]), it should be said that it pales in comparison with the research on topological spatial systems (see e.g. [1] for a wide selection of topic related to topological formalisms). We believe that while there are good reasons for topological analysis, philosophical investigations provide additional justification for extending the work on affine systems. For example, Bertrand Russell, no doubt influenced by Pasch and others, 2 took up the idea of the importance of non-numerical, qualitative, geometry and argued extensively for the primacy of projective and affine notions over the Euclidean ones (see [15,16] and [22] for a discussion). Moreover, while Alfred N. Whitehead's complex philosophical ideas influenced the development of region-based theories of space (see [25]), which are closely related to topology and mereology (a theory of part-whole relations, see [17]), he also devoted his attention to affine and projective geometry in [23] and [24] respecively. Finally, affine geometry can be said to be an intermediate geometry between the projective and Euclidean ones. Hence, it retains the status of non-numerical geometry and at the same time is less general than projective geometry and topology, thus remaining closer to our every-day experiences.
The region-based affine spatial logics -the focus of our article -are not the first attempts at logical analysis of this type of geometry. Alfred Tarski mentions affine geometry in his comparison between the developments in logic and geometry (see [20], which is a written account of a talk he gave, which in turn relfects his ideas from before the war). Moreover, together with his student Les law Szczerba, Tarski worked on point-based affine spatial logics (see [18]), which built on Tarski's earlier work on formalising Euclidean geometry (see [19] and [8] for a detailed look at Tarski's involvement in geometry). 3

Constructing a Spatial Logic
If we were to custom-build a spatial logic, the first problem we are going to face is the choice of underlying geometric space. Many approaches have been studied, in most of them however either R n for some n or some more general topological space is considered. Having set on the underlying geometric space, say X, we are faced with another decision. Should the variables range over elements of X or some subset S ⊆ 2 X ? In the first case we would be talking about point-based spatial logics, in the second about region-based spatial logics, which is our focus here. As mentioned above, we place our work in the qualitative spatial reasoning (QSR) subarea of symbolic AI. The adjective qualitative in this context means that all the primitive relations and functions are of non-numerical nature. For example, consider a language with a single relation symbol C understood as the contact relation. Intuitively two sets are in contact if their boundaries share at least one point. This spatial logic was investigated under many guises, most notably within the qualitative spatial reasoning paradigm. We are now faced with the following question: precisely what sort of regions should we consider? We could obviously decide to consider all S ⊆ 2 X for a given space X. Are there any reasons to consider a special class of regions rather than give them all an equal footing? One such reason is the admittedly vague notion of well-behavedness. First of all, to smooth out the reasoning with regions, we would like to weed out as many "special cases" as possible. Assuming we are working with some topological space, this can be done by considering only regular subsets of that space as plausible region-candidates. This gets rid of many a "strange" set e.g. of fractal nature. In the next step we need to decide whether we consider our regions to contain their boundaries or not. In the first case we end up with regular closed sets and in the second case with regular open sets. From a formal point of view, this is not an essential choice. In the remainder we will consider mainly regular open variants (and everything we say can be applied mutatis mutandis to the regular closed case). The class of all regular open subsets of some topological space is already a good choice for the well-behaved regions. 4 Apart from what has been mentioned already, by a well-known result the elements of the class of regular open subsets of some topological space form a Boolean Algebra, that is, operations of sum, product and complement of regular open sets conform to the laws of Boolean Algebra. We can do better still. We can look inside this class for some more refined region candidates. As is customary, we single out two classes: (regular open) polygons and (regular open) rational polygons (limiting ourselves to rational numbers). The fact that it is countable, makes the second subclass especially interesting from the point of view of computer science applications. The choice of geometric space and either point-or region-based approach dictates the choice of relations and functions that we are presented with. Within the qualitative spatial reasoning paradigm, non-numerical predicates on regions are considered, most notably contact and connectedness. Traditionally, spatial logics over languages containing relation and function symbols interpreted as relations and functions invariant under certain geometric transformations (topological, Eucidean etc.) are called accordingly as e.g. Euclidean, topological (spatial) logic. We follow this convention here. For example, consider an affine spatial logic constructed in the following manner. Start with a language with two primitive symbols conv and ≤. Let them denote the following predicates defined on regular open rational polygonal subsets of R 2 . The symbol conv(a) is to be understood as "region a is convex" and the symbol a ≤ b as "region a is a subset of region b". It is an affine spatial logic, since convexity is an affine-invariant property. This spatial logic is in fact one that we are concerned the most within this article. The last choice made in constructing a spatial logic concerns the syntactical complexity of the language we want to use. In our case, we work with standard first-order logic.

The Focus of this Article
The order of the article is as follows. After some more technical remarks regarding region-based theories of space and affine geometry, finally definining the structures that are important for us. Then, we describe in short the most important results obtained in [21]. This is done partially to introduce certain (visual) intuitions that are easier to grasp in the two dimensional case but that carry over, to some extent, to the three-dimensional case. Next, we describe some more general results regarding the family of structures that we have defined: namely that they all have different theories. Finally, we fix our attention on the three-dimensional extension of the two-dimensional logic analysed in [21]. We prove a number of expressiveness results that are helpful in establishing a result similar to one of the main theorems of [14], regarding the existence of formulas that are satisfied only by affine-equivalent regions.

General Setup
Let L conv,≤ be a first-order language with two predicates: binary ≤ and unary conv. We work with an L conv,≤ -structure with variables ranging over the set of regular open rational polygons of the real plane; ≤ interpreted as the inclusion relation and conv as a property of being convex. We start with defining a notion of a regular open set. The following result is standard.

Proposition 2.2. The set of regular open sets in X forms a Boolean algebra RO(X) with top and bottom defined by 1 = X and 0 = ∅, and Boolean operations defined by
We restrict our attention to certain well-behaved regular open sets (see our remarks in the introduction). Let us start with a staple topological space used in QSR, namely R 2 . Note that every line in R 2 divides R 2 into two domains, called half-planes. Open half-planes are regular open sets, hence we can speak about the sums, products and complements of such half-planes in RO(R 2 ). By a regular open rational polygon we mean a Boolean combination in RO(R 2 ) of finitely many half-planes bounded by lines with rational coefficients in R 2 . We denote the set of all regular open rational polygons in R 2 by ROQ(R 2 ). Note that ROQ(R 2 ) is a Boolean subalgebra of RO(R 2 ). The notion of regular open rational polygon can be easily extended to that of a polytope, when considering dimensions greater than 2. In general, we write ROQ(R n ), n ∈ N, to denote the set of all regular open rational polytopes of dimension n (all the mentioned results carry over from the two-dimensional case).
Finally, let us introduce the family of n-dimensional structures we will be interested in.
We sometimes refer to M n as a rational model (of dimension n) and often drop the associated superscripts and subscripts if it does not lead to confusion. In our exposition we follow the standard notational conventions. In particular, if φ is a formula, φ(x 1 , . . . , x n ) means that φ has at most n variables: x 1 , . . . , x n . Also, if an n-tuple of regions a 1 , . . . , a n satisfy φ in M, we write M |= φ[a 1 , . . . , a n ]. However, we eschew formal clutter and whenever possible avoid dissecting the text with lemmas in favour of verbal description of results (especially the simpler ones) preserving the flow of thought. It should be noted, however, that all results can be easily converted into a more formalised description.
We also need a few simple facts regarding affine geometry. The following generalises the notion of an affine transformation in R 2 to any dimension n. Recall that an n × n matrix A is invertible if there exists a n × n matrix B with AB = I, where I is the identity matrix; A is orthogonal if AA T = I, where A T is the transpose of A.
where A is an invertible n × n matrix and b ∈ R n .
Note that affine transformations map straight lines to straight lines, preserve parallelism and ratios of lengths along parallel straight lines. 5 Moreover, it is a standard result that the set of affine transformations forms a group under the operation of composition of functions. We say that two regions are affine-equivalent if there is an affine transformation from one region to another (this notion naturally extends to sequences of regions).

Two Dimensions
The papers [6,14] together with [21] deal with various systems related to M 2 . The two-dimensional rational model turns out to be very expressive. Firstly note that the Boolean operations are clearly L conv,≤ -definable (as are 0 and 1; for details see below, Theorem 4.2). The paper [14] showed that a number of interesting properties are definable in M 2 . It is easy to see that we can define a formula satisfied in the two-dimensional rational model if and only if the respective region is a half-plane (half-plane is the only region such that both it and its complement are convex). For the remainder of this paragraph, we use letters l, m, n etc. (possibly with subscripts) to denote such half-planes but sometimes we abuse the convention and use the same symbols to denote the lines bounding the half-planes in question. With that in mind, [14] showed that there is a formula involving two variables satisfiable in the two-dimensional rational model if and only if the two regions are half-planes with coincident bounding lines. Similarly, there is a formula, such that the two regions involved are half-planes with parallel bounding lines. Note that in affine geometry a coordinate frame is defined as follows.
Definition 3.1. Let l, m, n be any non-parallel, non-coincident lines with l ∩ m = O, l ∩ n = I and m ∩ n = J. We say that l, m, n form a coordinate frame. Figure 1 provides some examples of coordinate frames. Since the construction involves all the notions expressible in the two-dimensional model, we can "talk" about coordinate frames within that spatial logic. Now, the papers [14] and [21] show, in a sequence of results, that there exist formulas that allow fixing any rational half-plane with respect to a given coordinate frame. This is done by further exploring the expressivity of the model. Note that [6] shows that if two regions are affine-equivalent, then for certain affine spatial logics these satisfy the same formulas. An analogous theorem, relating the language L conv,≤ is proved in [14]. Using the fixing formulas, the converse theorem is shown to hold in the case of M 2 .  14]). Every n-tuple in M 2 satisfies an L conv,≤ -formula φ with the following property: any two n-tuples satisfying φ are affine-equivalent.
As indicated above, the proof relies on constructing certain formulas that allow us to "talk" about rational polygons and fixing their bounding lines in a certain manner, heavily relying on the expressivity results outlined above. (The paper [21] provides details for this construction.) Moreover, the paper [21] uses these "fixing" formulas to provide an axiom system for the twodimensional model, which is proved to be sound and complete. The axioms express a number of properties e.g. that there are at least three regions such that lines bounding them form a coordinate frame or that if a region is a Boolean combination of half-planes, then it is convex if and only if it is a product of some of these half-planes. However, for the most part, the axioms secure certain properties of these fixing formulas. The axiom system is also equipped with two infinitary rules of inference stating that every half-plane can be fixed in reference to a given coordinate frame and that every region is a Boolean combination of some half-planes. Let us finally note that our main result in the present article closely mimicks that described in Theorem 3.2.

Beyond Two Dimensions
What can be known about the rational models of dimensions greater than two? Even at this stage, one can indeed make some statements about the relations among such models. Recall the well-known Helly's theorem. First off, note that for all n, we have the following easy result. Proof. For simplicity, we shall represent such formulas in their (infix) form as x · y, x + y and −x and top and bottom as 1 and 0, instead of more correct but cumbersome standard notation as formulas in our language (which is what they really are), abusing the symbol of equality to also render situations like x·y = 0. Now for the definitions of formulas. The following formula is satisfiable in M n if and only if the region represented by the variable m is the product of the regions represented by x and y respectively: . An analogous formula can be constructed for the sum (all easily expressible in our language). The top can be defined as ∀y(y ≤ x) and the bottom as ∀y(y = x ∨ ¬(y ≤ x)). Moreover, the following formula is satisfiable in M n if and only if the region represented by y is the complement of the region represented by x: y · x = 0 ∧ ∀w(w · x = 0 → w ≤ y). φ(x 1 , . . . , x N
Recall that the theory of a structure is the set of all sentences valid in that structure. To see that this is the case, observe that for some φ N ∈ Φ n we have Therefore, we can say that these models are indeed different. However, if one were to extend the axiomatisation results from [21] to dimensions greater than two -and this is indeed our long-term goal -the models should be also shown to be similar in some other respect. Namely, the first task would be to see whether the notion of a coordinate frame can be expressed in such models in general.

Basic Expressivity
First of all, notice that the formula conv(x)∧conv(−x) is satisfiable in M 3 only by regions that are half-spaces. Since the plane bounding such half-spaces is unique, this also allow us to talk indirectly about such planes. It is convenient to be able to talk about a number of different half-spaces (planes); hence we introduce the following abbreviation. 6 We use and as abbreviations for finite products and sums, respectively. We also use ±a to denote region a or its complement.
Next, we see that we can talk about parallel planes by means of the following formula.
This formula "says" in M 3 that the two regions are distinct half-spaces (with distinct bounding planes) and that it is either that the first region has a nonempty intersection with the other or that its complement has this property. (Note that the main disjunction in the brackets operates really as an exclusive "or" when the two half-spaces are different.) Similarly, the following formula expresses the fact that two planes meet in the single line. Since such lines are unique, we can also -albeit indirectly -talk about lines in M 3 .
Finally, consider the case when the following is satisfied: (we thus assume this piece of formalism to be a part of all formulas described in the remainder of this paragraph). This formula simply says that all the planes bounding the three half-space have a non-empty intersection with each other. Consider the following three configurations: Since in all the above cases, the number of domains into which the entire space is being partitioned changes (6 domains for a fan, 7 for a prism and 8 for a corner) and it can be expressed in terms of products of respective half-spaces or their complements, one can build formulas describing all three cases in M 3 . Noting that there are 8 non-empty intersections possible in total, in the case of a corner, one enforces a non-empty intersection of all the half-spaces by adding the formula Directly, and assuming that line(y 1 , y 2 ) ∧ line(y 1 , y 3 ) ∧ line(y 2 , y 3 ) is satisfied, this formula "says" that any three (out of six in total -remember we alway have a half-space and its complement) half-spaces bounded by some planes have a non-empty intersection.
Next, in the case of a prism, one simply adds the formula ∧ (x · y · z = 0)) forcing the existence of a non-empty intersection. However, when paired with ¬∃x ¬∃y ¬∃z (((x = y 1 ∨ x = −y 1 ) Thus, the end effect is only one empty intersection. Finally, in the case of a fan, one has to force precisely two non-empty intersections. This is done by stringing together the following: ∧ (x · y · z = 0)) and ∃x ∃y ∃z with the condition that together with ¬∃x ¬∃y ¬∃z The above are admittedly long-winded but relatively simple and repetitive formulas. We hide the details under the self-explanatory abbreviations fan(x, y, z), prism(x, y, z) and corner(x, y, z).
Having established this, let us note that the case (iii) provides a basis for a coordinate frame. For the remainder of this section, we focus on fleshing out one of the ways of defining a coordinate frame in M 3 . Consider the formula frame(y 1 , y 2 , y 3 , y ) := by a tuple of elements a 1 , a 2 , a 3 , a only when these are halfspaces such that the planes bounding the first three of them form a corner and the plane bounding the fourth half-space form a prism with each pair of these planes. The three lines that lie at the pairwise intersections of the planes a 1 , a 2 , a 3 will determine the axes of the coordinate frame. Next, a meets the remaining planes at three distinct lines that intersect pairwise on each of the axes: the points of intersection of each pair of such lines and an axis will be marked with a point, called the unit of measurement (akin to the points I and J in Fig. 1

Addition and Multiplication
Consider two planes intersecting a third one in two lines. These lines are coincident, if the planes themselves are. Let us assume that line(y 1 , y) ∧ line(y 2 , y) is satisfied. By adding we define a relevant formula, denoted coincident 2 (y 1 , y 2 , y). 7 Similarly, such lines are parallel, if the planes are. Therefore if we add we obtain a formula (denoted parallel 2 (y 1 , y 2 , y)) satisfied in M 3 if and only if the relation of parallelism holds between the respective lines. Also, when lines in a plane are not coincident or parallel, they have to meet in a single point. Thus, we can add the following constraints ¬coincident 2 (y 1 , y 2 , y) ∧ ¬parallel 2 (y 1 , y 2 , y), defining a formula point 2 (y 1 , y 2 , y) with the obvious interpretation. We need these expressivity results to define important operations on line segments found on the planes forming the coordinate frame. We start with defining addition in a plane (following [4]): Say, for simplicity, that we adopted the same notational conventions for objects in the structure M 3 (remembering that these can refer to the relevant lines only indirectly and that directly these denote objects in the threedimensional space!). Furthermore, let for some n, n (with the plane bounding n meeting the plane bounding n in the line l 2 , thus defining the unit of measurement): this takes care of (a). 8 We can enforce (b) by and (e) with Thus, we can construct a formula add 2 (y 1 , y 3 , y A , y B , y C , y, y , z) such that M 3 |= add 2 [l 1 , l 3 , l A , l B , l C , n, n , m] if and only if OA + OB = OC (assuming the naming conventions above).
Similarly, again after [4], let us define multiplication in a plane. Given the similarity of the constraints for multiplication to those for addition, it should be clear now that there is a formula multiply 2 (y 1 , y 3 , y A , y B , y C , y, y ) such that M 3 |= multiply 2 [l 1 , l 3 , l A , l B , l C , n, n ] if and only if OA · OB = OC (assuming the naming conventions above). To obtain this simple consequence one needs to change what counts as the plane of reference (where these operations are defined by means of the above-described formulas). Figure 4. OA · OB = OC

Affine Completeness
In this part, we show how to obtain results analogous to those presented in [14] with regard to M 2 . Assume for now that we work in a specified plane of reference with the coordinate frame defined as above. How one would go about actually defining the numbers on the x-axis (the y-axis being analogous)? Well, we can start by defining these in terms of distance. So 0 would be OO and 1 would be OI with the rest of the natural numbers obtained by "repeating" the construction of OI. This is in fact how things are done in [14] and [21], so the interested reader is encouraged to consult these sources. In this article, however, we propose a slightly different solution, using the fact that addition is expressible to define a successor formula instead. Say, we defined 0 as the point of intersection of the two axes, and 1 as the point of intersection of l 3 (assuming previous conventions) with the x-axis represented by l 1 . The successor formula can be defined so that, starting with OO as the base case (this is done by simply constructing a formula satisfiable only by those regions whose associated lines determine the same point as the lines determining the axes), one keeps on adding OI. More formally (yet still, with a lot of ancillary details left out for readability), assume that a line m crosses the line l 1 at a point M, such that OM = nOI, n ∈ N. We then define the successor formula that involves two important elements: the regions representing m and another line m , such that m is the result of adding OM and OI (clearly doable, by the above). 9 This takes care of the natural numbers on the line. The following result shows that we can extend this to any rational number. Proof. For the proof of the above, the case when n ∈ N has been outlined. Consider n = p q , with p, q ∈ N (these do not have to be relatively prime). We get qOM = pOI, that is, in our parlance, OQ · OM = OP · OI. OP and OQ are clearly expressible using the successor formula. The formula capturing the above equality must simply enforce that the same point (M) is the result of both multiplications (and multiplications are expressible). What remains is the case when n is negative. It is enough to make a copy of the triangle forming the coordinate frame's units of measurement (clearly doable) and perform the operations "in reverse".
Given any line in a plane, and any coordinate frame, this line can cross both axes at some points; cross one of the axis and be parallel to the other; cross through the origin and be either parallel or cross the line forming the units of measurements at some point; or equal one of the formulas involved in the construction of the coordinate frame. Any intersection points can be captured numerically using the formulas described in the outline of the proof of Theorem 5.4 (if needs be, changing what counts as the axis, see [21]) and the remaining parallel cases can also be dealt with as parallelism is expressible in our language. Such formulas are sometimes called fixing formulas. Note that this notion can be extended from half-planes to arbitrary regions from the domain. In addition we obtain an analogue of the result from [14]. Let us say that a formula is affine-complete (in M 3 ), if for any two regions r, r ∈ ROQ(R 3 ) satisfying it, there is an affine transformation mapping r to r (and, of course, vice versa). Our final result is that -just as in the case of M 2 -every region satisfies an affine-complete formula.
Proof. Recall that every element of ROQ(R 3 ) can be represented as a Boolean combination of half-spaces. Consider a formula stating that certain regions form a coordinate frame (as done above), fixing all the half-spaces that are involved in the construction of r with respect to the resulting coordinate frame (again, as outlined above), and describing the exact Boolean combination resulting in r (clearly expressible). Such a formula has m+n free variables, where m is the number of variables involved in the construction of the coordinate frame and the remaining n variables representing the lines fixed with respect to the coordinate frame (for simplicity, allowing for repetitions of variables in both groups). Consider now an two m + n-tuples satisfying this formula. We show that the elements from both tuples are affine equivalent. Recall that all tetrahedra (essentially: corners in our terminology) are affine-equivalent. Therefore, there is a (unique) affine transformation, say τ , taking the melements of the first tuple to the m-elements of the other. Moreover, since the remaining n half-spaces from the second tuple are fixed with respect to the coordinate frame, by Theorem 5.5, the τ -transformed n half-spaces from the first tuple must be the same as the n half-spaces from the second tuple. That is, these are also affine equivalent. Therefore, τ takes all the elements from the first m + n-tuple to the second one. The final formula existentially binds all the variables apart from the one representing r.
This result can be easily extended from a single region to formulas of arbitrary arity, as in [14], thus providing an exact match to Theorem 3.2 mentioned above.

Open Problems
Thus, the stage is set for the task of axiomatising the theory of M 3 . This might be no easy feat, considering how much simpler it is to talk about coordinate frames in M 2 compared to M 3 . If in the due process, some regularities regarding the constructions are observed, this could be the basis for extending the results to other dimensions. Even at this stage we can note, however, that what has been presented in this paper regarding M 3 can be most likely extended to any dimension beyond 2.
Open Access. This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.
Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.