Homology of configuration spaces of hard squares in a rectangle

We study ordered configuration spaces $C(n;p,q)$ of $n$ hard squares in a $p \times q$ rectangle, a generalization of the well-known"15 Puzzle". Our main interest is in the topology of these spaces. Our first result is to describe a cubical cell complex and prove that is homotopy equivalent to the configuration space. We then focus on determining for which $n$, $j$, $p$, and $q$ the homology group $H_j [ C(n;p,q) ]$ is nontrivial. We prove three homology-vanishing theorems, based on discrete Morse theory on the cell complex. Then we describe several explicit families of nontrivial cycles, and a method for interpolating between parameters to fill in most of the picture for"large-scale"nontrivial homology.


Introduction
We study the ordered configuration space of n squares in a p × q rectangle, which we denote by C(n; p, q).The case n = 15 and p = q = 4 corresponds to the famous "15 Puzzle".This puzzle was apparently invented by Noyes Palmer Chapman, a postmaster in Canastota, New York, in 1874 [11].Already by 1879, the puzzle had been analyzed mathematically by Johnson and Story [9].They showed that it is not possible, for example, for any sequence of moves to transpose the pieces labelled 14 and 15.Their observation is really a topological one, namely that the configuration space has two connected components.
A natural discrete model for the 15 Puzzle is the graph G 15 , which we describe as follows.The vertices are the aligned positions of the puzzle, corresponding to the 16! permutations of the 15 pieces and the one hole, and we have an edge between every pair of positions that differ by sliding a piece into the hole.
If we allow arbitrary positions for non-overlapping squares, as long as they do not overlap, then the configuration space for the 15 Puzzle is more than 1-dimensional, though; for instance, there is a three-parameter family of ways to slide horizontally the three pieces in the bottom row.Nevertheless, as a special case of our results here, the configuration space of the 15 Puzzle deformation retracts to a one-dimensional subspace homeomorphic to G 15 .Having a cell complex structure allows for computing many topological invariants directly.For example, the Betti number β 1 can be computed by counting the number of 0-cells f 0 = 16! and 1-cells f 1 = 24 × 15! of G 15 , using the fact that β 0 = 2, and applying the 1-dimensional Euler formula f 0 − f 1 = β 0 − β 1 .
In the more general setting, we describe a cubical complex X(n; p, q) and show it is always a deformation retract of the configuration space C(n; p, q).Applying discrete Morse theory on this complex allows us to establish some necessary conditions on where nontrivial homology can appear.
In the following, we always assume that p, q ≥ 1, 0 ≤ n ≤ pq, and j ≥ 0. We also sometimes use a "large-scale" parametrization, by defining x = n/pq and y = j/pq.The quantity x has a physical interpretation as "density", describing the area ratio in the rectangular region that is occupied by squares.
The cubical cell complex model allows us to do exact computations for small examples.We include a table of Betti numbers in Section 7. Based in part on our computations, we conjecture the following.
In Section 6, we describe several families of explicit nontrivial cycles, and a method for interpolating between parameters.We almost show that whenever y ≤ min{1 − x, x − (8/9)x 2 , 1/4}, there exist n, j, p, q such that H j [C(n; p, q)] = 0. Instead we prove an analogous statement with a piecewise linear approximation of the parabola y = x − (8/9)x 2 .Let S be the set of points on the parabola defined by S = x, x − (8/9)x 2 x = 3 4k , k ≥ 1 .
It may actually be that Theorem 1.3 suggests the right necessary conditions for nontrivial homology, rather than Conjecture 1.2.We do not currently know of any instance of n, j, p, q where H j [C(n; p, q)] = 0 and (x, y) lies outside of the convex hull of S ∪ I. .A summary of our main results.The axes are x = n/pq and y = j/pq.We show that if (x, y) is outside the shaded region bounded by y = 1 − x, y = x, and y = 1/3, then H j [C(n; p, q)] = 0. We show conversely that for every rational point (x, y) in the blue part of the shaded region, there exist n, j, p, and q such that x = n/pq, y = j/pq, and H j [C(n; p, q)] = 0.Each of the blue dots represents a point (x, y) where we computed that H j [C(n; p, q)] = 0, with n ≤ 6.
A summary of our main results is illustrated in Figure 1.Although we have made some headway, completely resolving the following question is left as future work.
Question 1.4.What are necessary and sufficient conditions on (n; j; p, q) for H j [C(n; p, q)] = 0?
We note that Conjecture 1.2 is only about necessary conditions for nontrivial homology, but at the moment we do not have a good conjecture for necessary and sufficient conditions.The conditions in Conjecture 1.2 by themselves are not sufficient.For example, (1/4, 3/16) is a point in the blue region, corresponding to n = p = q = 4, j = 3.However, it is not true that we have homology whenever n/pq = 1/4 , j/pq = 3/16, even when n is sufficiently large.Suppose that p = 2, q = 8k for some k ≥ 1, and n = 4k, then we cannot get nontrivial homology with j = 3k.The largest j where we will see nontrivial homology is j = 2k; by the homotopy equivalence mentioned below, this follows from Theorem 1.2 (3) in [2].
In recent years, there has been increased interest in similar kinds of configuration spaces; see [1, 3,5] for some earlier work on configuration spaces of disks.
Plachta recently studied configuration spaces of squares in a rectangle [10], using affine Morse-Bott theory, smooth flows, and graphs associated with such configurations.As one application, he shows that under certain conditions the configuration space which we denote C(n; p, q) is connected.We note that our dimensions of the rectangle p and q are always positive integers, but he studies the more general framework where they may be positive real numbers.
What we study here is closely related to the recent paper [2] on configuration spaces of hard disks in an infinite strip, which we now briefly discuss.Let config(n, w) denote the configuration space of n disks of unit diameter in an infinite strip of width w.While we do not prove it here, it is not hard to check that C(n; p, q) is homotopy equivalent to config(n, w) if q ≥ n and p = w.So the configuration spaces of hard squares in a rectangle we study here are a generalization of the configuration spaces of hard disks in an infinite strip.
Motivated by the notion of phase transitions for hard-spheres systems, definitions are suggested in [2] for homological solid, liquid, and gas regimes.The definitions apply here as well.
Let Conf(n; R 2 ) denote the (ordered) configuration space of points in the plane.We say that (n; j; p, q) is • in the homological solid regime if • in the homological gas regime if the inclusion map i : C(n; p, q) → Conf(n; R 2 ) induces an isomorphism on homology and • in the homological liquid regime otherwise.In the present paper, we are mainly concerned with the boundary between trivial and nontrivial homology, i.e., separating the solid regime from liquid and gas.It will also be interesting to better understand the boundary between the homological liquid and gas regimes, as summarized in the following question.
Question 1.5.What are necessary and sufficient conditions on (n; j; p, q) for the inclusion map i : C(n; p, q) → Conf(n; R 2 ) to induce an isomorphism on homology

Definitions and notation
The configuration space C(n; p, q) of n unit squares in a p by q rectangle can be written as a subspace of R 2n by keeping track of the coordinates of the centers of the squares.We select our p by q rectangle to be the set 1 2 , p + 1 2 × 1 2 , q + 1 2 in R 2 .Accordingly, we define C(n; p, q) to be the set of all points (x 1 , y 1 , . . ., x n , y n ) ∈ R 2n such that • 1 ≤ x k ≤ p and 1 ≤ y k ≤ q for all 1 ≤ k ≤ n, and Note that the boundaries of the unit squares can intersect each other or the edges of the rectangle.
We will be working with two ways to draw a grid on the rectangle; these two grids can be thought of as dual to each other, or as offset by 1  2 , 1 2 .One grid is the integer coordinate grid.The set of possible positions of the center of one square Figure 2. The coordinate grid vertices, at points with integer coordinates, are the centers of the board squares.Here a coordinate grid edge is shown with its corresponding rectangular piece. is [1, p] × [1, q], which we can think of as having vertices at the points where both coordinates are integers, edges between vertices at distance 1, and (p − 1)(q − 1) square 2-cells.We refer to these integer points as coordinate grid vertices, to the edges as coordinate grid edges, and to the squares as coordinate grid squares.Together we refer to the coordinate grid vertices, edges, and squares as coordinate grid cells.
The other grid is the p by q grid on the rectangle itself.Thinking of the rectangle as a p by q chessboard, we refer to the unit square centered at each coordinate grid vertex as a board square.For each coordinate grid cell, there is a corresponding rectangle of board squares given by taking the union of all unit squares for which the center lies on that coordinate grid cell, as shown in Figure 2. The rectangle corresponding to a coordinate grid vertex is a single board square; the rectangle corresponding to a coordinate grid edge is a pair of adjacent board squares; and the rectangle corresponding to a coordinate grid square is a 2 by 2 rectangle of board squares.
Let G(n; p, q) be the space ([1, p] × [1, q]) n with its standard cubical complex structure.Here the letter G stands for grid.We can think of this space as the set of configurations of labeled squares in the rectangle where the squares are allowed to overlap.As a cubical complex, each cell of G(n; p, q) corresponds to an n-tuple in which each entry is a coordinate grid cell.We can draw the cell of G(n; p, q) by drawing the n corresponding rectangles of board squares.We refer to such a picture as a rectangle arrangement, and we refer to the n rectangles as pieces in the arrangement.Any list of n rectangles of board squares of sizes 1 by 1, 1 by 2, 2 by 1, and 2 by 2 is the rectangle arrangement of some cell of G(n; p, q).
We define X(n; p, q) to be the subcomplex of G(n; p, q) consisting of all cells of G(n; p, q) that are fully contained in C(n; p, q).Here the letter X stands for complex, because X(n; p, q) is the main cell complex that we work with throughout the paper.It is quick to check that X(n; p, q) is equal to the set of cells in which the corresponding rectangle arrangement has none of its pieces overlapping.Given a configuration in C(n; p, q), we can check whether it is in X(n; p, q) by looking at each unit square in the configuration and drawing the rectangle of board squares that it intersects, as shown in Figure 4.If these rectangles are disjoint, then the configuration is in X(n; p, q), and it is in the cell corresponding to the rectangular arrangement that we have just drawn.Figure 3.An illustration of the cell complex X(2; 2, 2).The vertices of the complex are labeled by their corresponding configurations with integer coordinates.Note that in this simple case, the cell complex X(2; 2, 2) equals the configuration space C(2; 2, 2), while in general the cell complex X(n; p, q) is only a subspace of the configuration space C(n; p, q). Figure 4. Any configuration where no two squares touch the same board square is in the cell of X(n; p, q) corresponding to the rectangle arrangement that shows which board squares each square touches.

Homotopy equivalence of the configuration space and complex
The ambient cubical complex G(n; p, q) has three kinds of cells: some cells are fully contained in C(n; p, q), and together form X(n; p, q); some cells are partially in C(n; p, q); and some cells are disjoint from C(n; p, q).We will define a deformation retraction from C(n; p, q) to X(n; p, q) by considering the cells of G(n; p, q) that are partially in C(n; p, q) one at a time.To do this, we define local coordinates on each of these cells and give a criterion in those local coordinates for which points are in C(n; p, q) and which points are not.
Figure 5.If the unit squares at the centers of the rectangular pieces overlap, then the corresponding cell in G(n; p, q) does not contain any configurations in C(n; p, q).The darker gray indicates where the two pieces overlap, and the black dots give the centers of the pieces.
Figure 6.If a given cell of G(n; p, q) is partially contained in C(n; p, q), then some pair of overlapping pieces in the rectangle arrangement must overlap in one of the four ways shown.The darker gray indicates where the two pieces overlap, and the black dots give the centers of the pieces.
We can also define snap : R d → R d for any dimension d, by applying snap to each coordinate separately.If z = (x 1 , y 1 , . . ., x n , y n ) ∈ R 2n is a point in the complex G(n; p, q), then snap(z) is the barycenter of the unique cubical cell of G(n; p, q) whose interior contains z.Geometrically, if (x i , y i ) is the center of a unit square, then snap(x i , y i ) is the center of the corresponding rectangle of the board squares that it touches.Note that snap is idempotent, snap(snap(z)) = snap(z), and z is a barycenter of some grid cell in G(n; p, q) if and only if z = snap(z).
3.1.Containment of cells in the configuration space.We can check whether a given cell of G(n; p, q) has empty intersection with C(n; p, q) by looking at pairs of pieces, case by case, in its corresponding rectangle arrangement.Figure 5 shows which pairs of pieces prevent a cell from having any configurations in C(n; p, q); in each case, the barycenter of the corresponding cell is not a configuration in C(n; p, q).For each pair of pieces, there is no way to fit a unit square in the interior of each piece, while keeping the two unit squares disjoint.(Two unit squares can fit if they touch the boundaries of the rectangles, but the resulting configuration is in the boundary of the specified open cell, not inside it.) Figure 6 shows the four remaining ways for two pieces in a rectangle arrangement to overlap; for these, the corresponding cell is partially in in C(n; p, q), and the barycenter is a configuration in C(n; p, q).The following lemma summarizes how to check whether a given cell of G(n; p, q) is partially in C(n; p, q).Lemma 3.1.Let z = snap(z) = (x 1 , y 1 , . . ., x n , y n ) ∈ G(n; p, q) be the barycenter of an open cell σ of G(n; p, q).Then (1) σ has a nonempty intersection with C(n; p, q) if and only if its barycenter z lies in the configuration space C(n; p, q), or equivalently, the ℓ ∞ distance between (x ℓ , y ℓ ) and (2) σ is fully contained in C(n; p, q), and hence a cell of X(n; p, q), if and only if for all 1 ≤ k < ℓ ≤ n, the corresponding pieces do not overlap, or equivalently, Proof.To check the first claim, we observe that if any point z ∈ σ is in C(n; p, q), then snap(z) ∈ C(n; p, q) as well.This is because for any For the second statement, note that piece k covers the board squares with centers in We say that a subcomplex of a regular CW complex is a full subcomplex if it is maximal with respect to its vertex set.Corollary 3.2.X(n; p, q) is a full subcomplex of the ambient cubical complex G(n; p, q).An equivalent description for when an open cell σ is partially in C(n; p, q) can be obtained from examining the cases in Figure 6: Let b = (i 1 , j 1 , . . ., i n , j n ) ∈ G(n; p, q) be the barycenter of σ; note that the coordinates i k , j k are half-integers.Then σ is partially in C(n; p, q) if and only if (1) for all k and ℓ, we have max(|i there is a pair k, ℓ such that either (a 3.2.Membership in the configuration space using local coordinates.The next lemma specifies how to use local coordinates to check, for an open cell partially in C(n; p, q), whether a given point in the cell is in C(n; p, q).Given an open cell σ of G(n; p, q), we can specify the points z ∈ σ in terms of the local coordinates 2 ) 2n corresponds to a point in the cell, because for each coordinate of the barycenter snap(z) that is an integer, the corresponding coordinate in z − snap(z) is zero.
Let b be the barycenter of cell σ, and let I(σ) be the set of indices of noninteger coordinates of b.The number of elements of I(σ) is the dimension of σ.Let (− 1 2 , 1 2 ) I(σ) denote the coordinate subspace of (− 1 2 , 1 2 ) 2n given by letting the I(σ) coordinates vary and requiring the remaining coordinates (corresponding to the integer coordinates in b) to be zero.We have A point of G(n; p, q) is in C(n; p, q) if and only if no two of the n specified squares intersect.Thus, we check the local coordinates for two of the n squares at a time to see whether those two squares overlap.Lemma 3.3.Let σ be an open cell of G(2; p, q) that is partially in C(2; p, q), and let z = (x 1 , y 1 , x 2 , y 2 ) be a point in the interior of σ.Then (x 1 , y 1 , x 2 , y 2 ) ∈ C(2; p, q) if and only if one of the following conditions holds: has the same sign as snap(y 2 ) − snap(y 1 ).
In the fourth case in Figure 6, where the two pieces are 2 by 2 rectangles intersecting at one board square, either condition in the lemma may hold, so the intersection of C(n; p, q) with the cell of G(2; p, q) is the union of solutions to two linear inequalities.In the other three cases, the centers of the two pieces have only one coordinate that differs by 1, so the intersection of C(n; p, q) with the cell is the set of solutions to one linear inequality.
Note that the function snap is weakly order-preserving, meaning that x 2 − x 1 ≥ 0 implies snap(x 2 ) − snap(x 1 ) ≥ 0. Thus, by symmetry of x 1 and x 2 as well as (x 1 , x 2 ) and (y 1 , y 2 ), it suffices to show that )) ≥ 0. The latter condition straightforwardly implies the former.
3.3.Construction of the deformation retraction.The next lemma gives the main step in constructing the deformation retraction from C(n; p, q) to X(n; p, q).Lemma 3.4.Let σ be an open cell of G(n; p, q) that is partially in C(n; p, q).Then we have that ∂σ ∩ C(n; p, q) is a deformation retract of σ ∩ C(n; p, q).Proof.Let z = (x 1 , y 1 , . . ., x n , y n ) be a point in the open cell σ.If we want to check whether z is in C(n; p, q), then Lemma 3.3 gives a set of inequalities on the local coordinates z − snap(z) = (u 1 , v 1 , . . ., u n , v n ) within the open cell σ that we can evaluate.For each pair of pieces k, ℓ in the rectangle arrangement for σ, the lemma specifies zero, one, or two inequalities of the following form: The case of zero inequalities comes from the case where the two rectangular pieces do not intersect.The case of one inequality comes from the case where they intersect in one of the first three ways shown in Figure 6.And, the case of two inequalities comes from the fourth case in Figure 6, where the pieces are both 2 by 2 squares and they have one board square in common; in this case, the local coordinate z −snap(z) needs to satisfy either or both of the two inequalities.Together, we refer to the inequalities from the lemma as the inequalities associated to σ.Note that the above inequalities are stated for local coordinates, but at the same time, the coordinates of the barycenter b = (i 1 , j 1 , . . ., i n , j n ) satisfy the same set of inequalities, even strictly.This property will be crucial for our argument.
We define the deformation retraction as follows.Let λ be large enough that 2n ; we can take λ = 2(p + q).Let m be the coordinate projection of ; that is, for each integer coordinate of b, we set the corresponding coordinate of m to be zero.Since m is a positively scaled version of b, it inherits the magical quality of satisfying all of the inequalities associated to σ, and since b satisfies all those inequalities strictly, −m has the magical quality of violating all of the inequalities associated to σ. (Note that every coordinate appearing in the inequalities associated to σ is in I(σ).)Thus the point b + m in σ is in the configuration space C(n; p, q), while the point b − m is not.The deformation retraction now pushes every point z ∈ σ outward along a ray from b − m until it hits ∂σ.In other words, the vector from b − m to z is given by z − b + m, so as time t increases from 0, we set until we reach the maximum t for which z + t(z − b + m) is in σ, and then the point no longer moves.Formally, we can define T z to be the positive value such that z + T z (z − b + m) ∈ ∂σ.(Because σ is a cube and hence star-shaped around any interior point, for any point in σ and any nonzero vector within σ starting at that point, there is a unique non-negative multiple of that vector that reaches ∂σ.)If d is the distance within σ from b − m to C(n; p, q), then the vector z − b + m from b − m to z has length at least d, and any vector from z to ∂σ has length at most diam(σ), so T z ≤ 1 d diam(σ) ≤ 2n d .Using this notation, the deformation retraction is defined as We still need to check that if z ∈ C(n; p, q), then z t ∈ C(n; p, q) for all t, in order to ensure that the homotopy remains in σ ∩ C(n; p, q).This is equivalent to checking that satisfies a sufficient collection of the inequalities associated to σ.We claim that z t − b satisfies every one of the inequalities that z − b satisfies; since this collection of inequalities is sufficient for z to be in C(n; p, q), it is also sufficient for z t to be in C(n; p, q).Indeed, the inequalities are linear with no constant term, so given two points satisfying the inequalities, any linear combination of them with positive coefficients also satisfies the inequalities.Because z − b satisfies a sufficient set of inequalities and m satisfies all of the inequalities associated to σ, this implies that (1 + t)(z − b) + tm also satisfies the same set of inequalities as z − b.Thus, z t is in C(n; p, q) for every t ≤ T z , and the map F that we have defined is indeed a deformation retraction from σ ∩ C(n; p, q) to ∂σ ∩ C(n; p, q).Putting all the cells together, we obtain a deformation retraction from C(n; p, q) to X(n; p, q).Theorem 3.5.The subcomplex X(n; p, q) is a deformation retract of the configuration space C(n; p, q).Proof.Order the cells σ of G(n; p, q) that are partially in C(n; p, q), such that their dimensions are nonincreasing.Then, cell by cell in order, we use Lemma 3.4 to obtain a deformation retraction from σ ∩C(n; p, q) to ∂σ∩C(n; p, q).Concatenating these deformation retractions gives a deformation retraction from C(n; p, q) to the set X(n; p, q) of cells completely contained in C(n; p, q).

Discrete Morse theory
In this section, we describe a discrete gradient vector field on X(n; p, q), in the sense of Forman's discrete Morse theory [6], and characterize its critical cells.The analysis of which cells are critical is based on what we call the apex of a cell.The apex of a cell, as shown in Figure 7, is the 0-dimensional face that is obtained by replacing each piece by its upper-right corner square -in particular, the apex of any 0-dimensional cell is that 0-cell itself.We use discrete Morse theory to collapse our cell complex so that among the cells remaining, at most one cell has any given apex.
Figure 7.The apex of a rectangle arrangement replaces each piece by its upper-right corner.The correspondence does not depend on the labels of the pieces, so the labels are not shown.
Theorem 4.1.There is a discrete gradient vector field on the cubical complex X(n; p, q) with the following properties.
(1) Every matched pair consists of two cells with the same apex.
(2) Among the cells with a given apex, at most one cell is critical (unmatched).
(3) The matching is S n -equivariant: if cells e 1 and e 2 are a matched pair, and we apply the same permutation to the labels in the rectangle arrangements of e 1 and e 2 , then the two resulting cells are also a matched pair.
The proof relies on constructing what we call the apex graph, which facilitates the enumeration of all the cells with a given apex.In Lemmas 4.2 and 4.3 we prove the basic properties of the apex graph, and in Lemma 4.4 we define the matching for Theorem 4.1 in the language of the apex graph.After that, it is straightforward to finish the proof of Theorem 4.1.
Given any rectangle arrangement, we describe the locations of the pieces according to the coordinates of their upper-right corner squares, so that we say that a piece is at (i, j) if its upper-right corner is in column i (from left to right) and row j (from bottom to top) of our p by q rectangle.(Alternatively, the center of the upper-right board square has coordinates (i, j) in the plane.)Giving the coordinates of each piece is the same as specifying the apex of our cell.To distinguish cells with the same apex, we need to specify, for each piece, whether it has height 1 or 2 and whether it has width 1 or 2.Not all these possibilities give rise to valid rectangle arrangements, because some pieces may overlap or hang off the board.For each possible apex, we construct the apex graph to record these possible conflicts, as shown in Figure 8.
Figure 8.To find the apex graph, we place one vertex for each direction that a piece in the apex can extend, and draw edges between directions where the pieces cannot extend simultaneously.
The apex graph has at most two vertices per piece.If our apex has a piece at (i, j), then we let (i − 1 2 , j) -the center of the left edge of the (i, j) board square -be a vertex of the apex graph if and only if the piece at (i, j) can have width 2 in some cell with that apex -that is, if i > 1 and there is no piece at (i − 1, j).Similarly, we let (i, j − 1 2 ) -the center of the lower edge of the (i, j) board square -be a vertex if and only if there is a piece at (i, j), we have j > 1, and there is no piece at (i, j − 1).
The edges of the apex graph record which of the width 2 or height 2 options would conflict with each other.A piece at (i, j) can have width 2 or height 2 but not both when there are no pieces at (i − 1, j) and (i, j − 1), but there is a piece at (i − 1, j − 1).In this case we draw an edge between the vertices (i − 1 2 , j) and (i, j − 1 2 ).The other possible conflict is between pieces at (i, j) and (i − 1, j + 1).If there is no piece at (i − 1, j), then the (i, j) piece may have width 2, and the (i − 1, j + 1) piece may have height 2, but not both simultaneously.In this case we draw an edge between (i − 1 2 , j) and (i − 1, j + 1 2 ).These two types of edges give all the edges in the apex graph.Lemma 4.2.Each apex graph is a disjoint union of path graphs.
Proof.The two types of edges have the same slope and length when drawn on the coordinate lattice.Any graph that can be drawn in this way is a disjoint union of paths.Note that some of the paths may be single vertices.
Lemma 4.3.The set of cells with a given apex is in bijection with the set of independent sets in its apex graph.One cell is a face of another if and only if the independent set corresponding to the first cell under this bijection is a subset of the independent set corresponding to the second cell.
Figure 9. Cells with a given apex correspond to independent sets in the apex graph: we select the vertices corresponding to the directions where the apex pieces extend.Here, the vertices in the independent set are drawn filled, and the other vertices are drawn empty.
Proof.Given a cell with a given apex, we find the corresponding subset of vertices in the apex graph by considering each piece in the associated rectangle arrangement, say at (i, j), selecting vertex (i − 1 2 , j) if the piece has width 2, and selecting vertex (i, j − 1 2 ) if it has height 2, as in Figure 9.The construction guarantees that these are in fact vertices of the apex graph and that no two of them share an edge.
For the converse, suppose that we have an independent set in the apex graph.We select our pieces to have width 2 and/or height 2 according to which vertices are in the independent set, and we want to check whether the pieces overlap or hang off the board.Consider the (i, j) piece.It cannot hang off the board or overlap with a piece at (i − 1, j) or (i, j − 1), because the vertices corresponding to those possibilities are not in the apex graph.It cannot overlap with a piece at (i−1, j −1) because that would mean choosing both vertices (i− 1 2 , j) and (i, j − 1 2 ) which would be adjacent.And, it cannot overlap with a piece at (i−1, j +1), because that would mean choosing both vertex (i − 1 2 , j) and (i − 1, j + 1 2 ) which would be adjacent.Symmetrically, by swapping the roles of the two pieces, we see that the piece at (i, j) also cannot overlap with the pieces at (i + 1, j), (i, j + 1), (i + 1, j + 1), or (i + 1, j − 1).This exhausts all the possibilities for how two pieces of width and height at most 2 might overlap, and shows that we have a bijection.
For the second property, suppose that cells e and f have the same apex.Then f is a face of e if and only if every piece of width 2 in f also has width 2 in e, and every piece of height 2 in f also has height 2 in e.This is equivalent to the condition that the independent set corresponding to f is a subset of the independent set corresponding to e.
Thinking of the cells as independent sets in the apex graph suggests how to think about pairing them up.The dimension of a cell is equal to the number of vertices in the independent set corresponding to that cell.So, if cells e and f have the same apex, then f is a face of e with dim f = dim e − 1 if and only if the independent set of f is a subset of the independent set of e and the two sets differ by one vertex.When two independent sets differ by one vertex, we say that they are adjacent.Lemma 4.4.Given a disjoint union of paths, there is a matching on the set of independent sets such that every matched pair of independent sets are adjacent and at most one independent set is unmatched.
Proof.We start by proving the statement for one connected path of k vertices.We express the independent sets as binary strings of length k with no consecutive 1's, so that 0 indicates that the vertex in that position is not part of the independent set, and 1 indicates that the vertex is part of the independent set.The matching is defined recursively.For k = 1 the strings are 0 and 1, which we match as a pair.For k = 2 the strings are 00, 01, and 10; we match 00 with 10 and leave 01 unmatched.For k > 2, each string begins with 00, 10, or 010.We match the strings beginning with 00 to the strings beginning with 10 such that each matched pair differs only in the first bit.Then, for the strings beginning with 010 we ignore the first three bits and use the matching for the k − 3 case.
The result is that for k ≡ 1 mod 3, all strings are matched; for k ≡ 0 mod 3, the only unmatched string consists of repeating copies of 010; and for k ≡ 2 mod 3 the only unmatched string consists of repeating copies of 010 followed by 01 at the end.This proves the lemma for the case of one path.0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 0 1 Figure 10.Given an independent set on a disjoint union of paths, to find its match we select the first component that is not critical, ignore any 010 prefixes, and flip the first bit of the remainder.
For several disjoint paths, we select some ordering on them.Given an independent set, if its restriction to each path agrees with the unmatched independent set from the one-path case, we leave it unmatched.Otherwise, we find the first path P where this is not true.To find the matching independent set, we keep all the other paths as they are and alter the set on P to be the matching set from the one-path case, as in Figure 10.There is an unmatched independent set if and only if none of the paths has 1 mod 3 vertices, and in this case the unmatched set corresponds to repeating 010 on each path.
To finish the proof of Theorem 4.1, we need to check that the matching we have just defined determines a discrete gradient vector field with the properties we are looking for.
Proof of Theorem 4.1.The discrete vector field is defined as follows.Given a cell, we find its apex and the apex graph.Encoding the original rectangle arrangement as an independent set in the apex graph (Lemma 4.3), we find the matching independent set (Lemma 4.4) if there is one, and decode to get another cell with the same apex.Properties (1) and ( 3) are automatic from the construction, and Property ( 2) is a consequence of Lemma 4.4.
We still need to check that the discrete vector field is gradient.We want to show that there does not exist a cycle of cells e 1 , f 1 , e 2 , f 2 , . . ., e r , f r , e r+1 = e 1 such that every e i and f i are a matched pair (where, in particular, e i is a face of f i ), and every f i is a face of e i+1 with dim f i = dim e i+1 − 1.We observe that because f i is a face of e i+1 , if the apex of e i+1 is not equal to the apex of f i , then it differs by moving some piece one square left or down.Every pair e i and f i have the same apex, so as the sequence continues, the apex keeps moving leftward and downward, making it impossible to have a cycle unless all cells in it have the same apex.
Thus we may assume that the cells e 1 , f 1 , . . ., e r , f r all have the same apex.We can encode these cells as independent sets in the apex graph.To go from e 1 to f 1 , we delete one vertex v from the independent set of e 1 , and to go from f 1 to e 2 , we add one vertex w to the independent set of f 1 .Remembering the ordering of the paths and vertices in the apex graph, we observe that up until v, the independent set for f 1 agrees with the unmatched independent set, so any added vertices there would destroy the property of being an independent set.Thus w cannot be at or before v.If the vertex immediately after v is on the same path, then w can be that vertex.But w cannot be anywhere else after v, because if so, then the matching independent set to e 2 , which we have supposed is f 2 , would have v added rather than a vertex subtracted -it would have the wrong dimension -giving a contradiction unless w is immediately after v.In a sequence of cells with the same apex, alternating between two consecutive dimensions, with consecutive pairs alternating between matched and incident, the corresponding independent sets look more and more like the unmatched set, and thus cannot cycle.
Thus we cannot have a cycle e 1 , f 1 , . . ., e r , f r , e r+1 = e 1 , because each successive item agrees more and more with the unmatched set, as in Figure 11: the independent set of e 1 agrees before v, the independent set of f 1 agrees through v, the independent set of e 2 agrees through w, and so on.So, our discrete vector field is gradient and has all three desired properties from the theorem statement.
We prove one last theorem in this section, which helps with assessing the dimension of critical cells in the following section.For the following, we divide each unit square in the p by q grid into two half-squares by drawing a diagonal line from the upper-right to the lower-left corner.
Theorem 4.5.There is a function r that assigns a set of half-squares to each vertex of the apex graph, with the following properties: (1) For any vertex v, the set r(v) has four half-squares if v is the only vertex of a path, three half-squares if v is the first or last vertex of a path, and two half-squares otherwise.
(2) The sets r(v) are disjoint for all v.
Proof of Theorem 4.5.Recalling that we can draw each vertex of the apex graph as the midpoint of an edge between a square occupied by an apex piece and an unoccupied square, we set r(v) to contain both of the half-squares that v touches, as in Figure 12.We think of the vertices as ordered first by the sum of coordinates and then by the column coordinate, so that the ordering starts in the lower-left corner and goes right and down along diagonals.If v is the first or last vertex of a path, we need to find another half-square to add to r(v).There are several cases, shown in Figure 13: (1) If v is the first vertex of a path and is on a vertical edge: Add in the remainder of the square to the left of v. (2) If v is the last vertex of a path and is on a horizontal edge: Add in the remainder of the square below v. (3) If v is the first vertex of a path and is on a horizontal edge, and there is no vertex on the preceding (above-left) edge: Add in the remainder of the square above v. (4) If v is the last vertex of a path and is on a vertical edge, and there is no vertex on the following (below-right) edge: Add in the remainder of the square to the right of v. (5) If v is the first vertex of a path and is on a horizontal edge, and there is a (non-adjacent) vertex on the preceding edge: Add the half-square to the left of the square below v. (6) If v is the last vertex of a path and is on a vertical edge, and there is a (non-adjacent) vertex on the following edge: Add the half-square below the square to the left of v.In the case where v is the only vertex of the path, if v is on a vertical edge, then either rules (1) and (4) or rules (1) and ( 6) apply, as shown in Figure 14, and if v is on a horizontal edge, then either rules (2) and (3) or rules (2) and ( 5) apply, so that r(v) has four half-squares in total.This completes the definition of r(v).
We need to check that no half-square has been assigned twice.To do this, we consider the assignment from the point of view of each square.Consider a square that is occupied by a piece in the apex arrangement.It may have vertices on its left or lower edges.If it has both vertices, then half of the square is assigned to Figure 13.For the first vertex of a path, rules (1), (3), and ( 5) specify how to add a third half-square; the × symbol indicates an absence of vertex.The third picture also shows an instance of rule (6).For the last vertex of a path, rules (2), ( 4), and ( 6) are analogous.
Figure 14.If the only vertex of a path is on a vertical edge, rules (1) and (4) or rules (1) and ( 6) assign four half-squares to that vertex.If the vertex is on a horizontal edge, rules (2) and (3) or rules (2) and ( 5) are analogous.each vertex.If it has one vertex, then all of the square is assigned to that vertex, by rule (3) or rule (4).If it has no vertex, then none of the rules assign that square to any vertex.
Similarly, consider a square that is unoccupied in the apex arrangement.It may have vertices on its right or upper edges.If it has both vertices, then half of the square is assigned to each vertex.If it has one vertex, then all of the square is assigned to that vertex, by rule (1) or rule (2).(Note that rule (1) and rule (2) cannot apply to an unoccupied square with both vertices, because in this case the two vertices would be adjacent.)If our unoccupied square has no vertices, then we divide the square in half.The lower-right half gets assigned by rule (5) to the same vertex (if any) as the half-square to its right, and the upper-left half gets assigned by rule (6) to the same vertex (if any) as the half-square above it.
In each case, only one rule can apply to each half-square, so each half-square can be assigned to only one vertex.

Homology-vanishing theorems
The existence of the cell complex X(n; p, q) and the discrete gradient on it allow us to establish a number of homology-vanishing results.
Proof of Theorem 5.1.This is almost immediate from the homotopy equivalence C(n; p, q) ∼ X(n; p, q).Consider the dimensions of the cells in X(n; p, q).A cell is indexed by a collection of n non-overlapping rectangular pieces in a p × q grid.A 1 × 1 piece contributes 0 to the dimension of the cell, a 1 × 2 or 2 × 1 piece contributes 1, and a 2 × 2 piece contributes 2. The total area of the pieces is at most pq.So the largest dimension of a cell is at most pq − n.By the definition of cellular homology, there is no homology above the dimension of the cell complex itself, so H j [C(n; p, q)] = 0 for j > pq − n.
Proof of Theorem 5.2.This follows from the properties of the discrete gradient described in Section 4. Every cell is indexed by a collection of non-overlapping rectangular pieces, each piece either 1 × 1, 1 × 2, 2 × 1, or 2 × 2. The analysis of the gradient shows that there are no critical cells indexed by a collection of pieces including a 2 × 2 piece.(When such a cell is encoded as an independent set in the apex graph as in Lemma 4.3, the 2 × 2 piece corresponds to two vertices of the independent set that are consecutive but not adjacent.However, the proof of Lemma 4.4 implies that in a critical cell, the first vertex of each path is never part of the corresponding independent set.)Hence the dimension of a critical cell is at most n.
Proof of Theorem 5.3.This follows from Theorem 4.5.A critical cell corresponds to an independent set that on each path looks like 010 . . .010 or 010 . . .01 depending on whether the number of vertices in the path is 0 or 2 mod 3. The dimension of the critical cell is the number of vertices in the independent set.If the path has k vertices, then the independent set has k/3 vertices in the first case, and has (k+1)/3 vertices in the second case.
For a path of k vertices, the theorem allocates half-squares with a total area of k + 1 to the vertices of the path.The independent set for that path contributes at most (k + 1)/3 to the dimension of the critical cell.Thus, in total, the dimension of the critical cell is at most one third of the total area allocated to all the paths in the apex graph, and thus is at most pq/3.

Nontrivial homology
In this section, our main aim is to prove Theorem 1.3.We give several explicit constructions of nontrivial cycles, and then a method for interpolating between parameters.
To show that this cycle is nontrivial, consider the map f : C(2; 2, 2) → S 1 , where one takes the angle the line from the center of square 1 to the center of square 2 makes with the x-axis.In other words, define The composition f • i is a degree-one map S 1 → S 1 , and in particular the induced map (f • i) * is an isomorphism on H 1 .So then i must be injective on H 1 .Similarly, Figure 16 shows a cycle in H 1 [C(3; 2, 2)].The figure illustrates a piecewise-linear map i : S 1 → C(3; 2, 2), and the cycle we are interested in is the image.This also represents a nontrivial cycle in H 1 [C(3; 2, 2)].Indeed, we have a natural projection map to C(2; 2, 2) where one forgets the coordinates of the third square, and then the argument above shows that the image of the cycle is still nontrivial in this projection.
The following lemma will be superseded later in this section by a stronger result, but we present the lemma and proof as a warmup, and we will also reuse the main construction in its proof later.Lemma 6.2.The point is attainable, for every k ≥ 1.
Proof.Consider first Figure 17.We illustrate a 2 × 2 square and 1 × 1 square orbiting each other in a 3 × 3 grid, as in Figure 15.We can then put two 1 × 1 squares inside the 2 × 2 square, and these can orbit each other independently.So,  The same argument as before gives that this represents a nontrivial class in H 2 [C (3; 3, 3)].Indeed, compose with a map f : C(3; 3, 3) → T 2 = S 1 × S 1 which assigns to the first coordinate the angle between the line segment from the center of square 1 to the center of square 2 and the x-axis.Similarly, the map assigns to the second coordinate the angle between the line segment from the center of square 1 to the center of square 3 and the x-axis.This is a degree one map T 2 → T 2 .The induced map (f • i) * is an isomorphism on homology, and so i * is injective.is attainable for every k ≥ 1.
Proof.The case k = 1 is already covered by Lemma 6.1.For any k ≥ 2, we can embed a (k − 1)-dimensional torus in a C(k; k, k).Now consider the configuration space C(3k; 2k, 2k).We can divide the 2k × 2k grid into four k × k grids.Inside each, we use k squares to embed an (k − 1) torus as in the proof of Lemma 6.2.This describes a (3k − 3)-torus, and the three k × k squares can orbit each other in the 2k × 2k grid, giving one more dimension.So putting it all together, we have a (3k − 2)-torus.This realizes the point The case k = 2 is illustrated in Figure 20, and the case k = 3 in Figure 21.
Proof.Indeed, suppose x is a rational point in [0, 1], and write x = a/b, where a is a non-negative integer, b is a positive integer, and a ≤ b.Set n = ab and p = q = b.
By assumption, we have a ≤ b, so n ≤ pq and the configuration space C(n; p, q) is nonempty, so H 0 [C(n; p, q)] = 0.
Altogether, we have used squares, and defined an embedded torus of dimension This describes a cycle in H J [C(N ; P, P )], as desired.The cycle is nontrivial, as before -we can compose with a map to T j such that the composed map T j → T j has degree one.

Betti number computations for small n, p, q
We compute the Betti numbers β j [C(n; p, q)] for n ≤ 6 and p ≤ q ≤ n.These are provided in Table 1.Another view of the Betti numbers for n = 6 and j = 2 with p and q varying is illustrated in Figure 22.Finally, in Table 2 we record information about the size of the complex X(n; p, q) in the form of its f -vector (f 0 , f 1 , f 2 , . . .), where f i is the number of i-dimensional cells in X(n; p, q).All of our computations are using coefficients in the prime field Z/2Z.
For our computations we employ three different software packages, and we dedicate a small section to each one.The first is a Python/Sage Jupyter notebook which uses the discrete Morse vector field of Section 4. The second is a branch of the PyCHomP package, available at [8] specifically for computing the Betti numbers for these configuration spaces.The third is the Dipha package with a custom script to build the configuration cell complex.Finally, note that in the case when n = q the configuration space C(n; p, q) is homotopy equivalent to the configuration space of disks in a strip addressed in [2]; in this case, one can use the Salvetti complex to compute the Betti numbers as done in [2].
7.1.Discrete Morse Theory Sage Notebook.Using the discrete gradient vector field from Section 4, we compute the collapsed Morse chain complex for X(n; p, q) as follows.The idea is first to find the critical cells and then to compute their boundaries in the Morse complex.However, it turns out that most of this process depends very little on p and q.Thus, in order to compute for various p and q without duplicating effort, we first compute the Morse complex for X(n; n, n).The Morse complex of each X(n; p, q) for 1 ≤ p, q ≤ n turns out to be a subcomplex of the Morse complex for X(n; n, n), obtained by selecting only the critical cells for which the apex is in the p by q rectangle.This is because of the properties of our discrete gradient vector field.Namely, we know that if a cell's apex fits into a p by q rectangle, so does every boundary cell of that cell (the apex takes upper right corners, and the p by q rectangle grows from the lower left); together with the fact that every two paired cells have the same apex, this implies that the X(n; p, q) Morse complex is a subcomplex of the X(n; p ′ , q ′ ) Morse complex whenever p ≤ p ′ and q ≤ q ′ .The construction of the discrete gradient vector field guarantees that no apex that skips a row or column can be the apex of a critical cell-this is because every apex graph with an isolated vertex has an even number of independent sets-so the X(n; n, n) Morse complex is sufficiently large to contain the Morse complexes for all X(n; p, q).Thus, the code computes as follows.First, we list all ways of placing n squares in an n by n grid.Then, we check which of these arrangements are the apex of a Table 1.The Betti numbers of C(n; p, q) for 2 ≤ n ≤ 6.The homological liquid regime is indicated in bold.critical cell.For each critical cell, we compute its boundary in the Morse complex by applying discrete gradient flow to its original boundary in X(n; n, n).Doing this for every critical cell gives all boundary coefficients for the Morse complex of X(n; n, n), computed as integers with signs.Then we restrict to smaller p by q rectangles, producing subcomplexes of the Morse complex.For each p and q, we compute the Betti numbers from the ranks of the boundary matrices and the dimensions of the chain groups; because the matrices have integer entries, to specify the coefficient field for homology, we only need to specify the field for the rank Let n = 6 and j = 2, and let p and q be the horizontal and vertical axes.Then the solid regime is in the lower left, the gas regime is in the upper right, and the liquid regime (in bold) is in between.If p ≥ n, then the inclusion map C(n; p, q) ֒→ C(n; p + 1, q) induces an isomorphism on homology.Similarly, if q ≥ n then the inclusion map C(n; p, q) ֒→ C(n; p, q + 1) induces an isomorphism on homology.Table 2.The f -vectors for X(n; p, q) for small n, p, q.
computation, which can be done over Q or modulo any choice of prime.The Sage notebook is available online.We found that the code runs quickly for n ≤ 5 and agrees with our other computation methods; for n ≤ 6 it becomes slow and would require more speed optimization.7.2.PyCHomP.We briefly review the computations involved in PyCHomP, which may be used to compute the homology of X(n; p, q) with Z/2Z coefficients.
In order to construct the map ν, we use Lemma 3.1 to determine whether a cell belongs to the cubical complex X(n; p, q).The complex G(n; p, q) together with the map ν defines a P -graded cell complex (see [7]).PyCHomP uses iterated algebraicdiscrete Morse theory to reduce G(n; p, q) to a (chain-homotopy equivalent) Pgraded cell complex (A(n; p, q), µ) characterized by the condition that ∂ A | µ −1 (p) = 0 for p ∈ P .This condition implies that the j-dimensional Betti number of X(n; p, q) is precisely the number of j-dimensional cells in µ −1 (0); see [7,Example 4.30] for more detail.
Theorems 5.1-5.3suggest that speed ups can be obtained for any code which computes homology starting from the complex X(n; p, q) by not considering cells above a certain dimension.The branch of PyCHomP available at [8] incorporates these speed-ups; PyCHomP is able to compute the Betti numbers for all the examples in Table 1.A Jupyter notebook which sets up the computation of Betti numbers for X(n; p, q) is available online. 2.3.DIPHA.Finally, we describe the homology computation of X(n; p, q) using Dipha, a software package for computing persistent homology in a distributed setting [4].Dipha supports the computation of persistent homology for lower star filtrations of cubical grids such as G(n; p, q).The data determining a lower star filtration is a real-valued function f on the vertices of G(n; p, q), i.e., the integer points in ([1, p] × [1, q]) n .The filtration then consists of the full subcomplexes of the ambient cube complex G(n; p, q) induced by sublevel sets f −1 (−∞, t] of the function f . Our computations make use of the fact that X(n; p, q) is a full subcomplex of the ambient cube complex G(n; p, q) (see Corollary 3.2).In other words, the complex X(n; p, q) is determined by the set of all configurations in C(n; p, q) with integer coordinates.Thus, it suffices to enumerate all permutations of all n-element subsets of the p × q possible integer coordinates for the cubes.The input to Dipha consists of the characteristic function of this set as a subset of all vertices of G(n; p, q).A Mathematica file for generating the input to Dipha is available online. 31] Hannah Alpert.Restricting cohomology classes to disk and segment configuration spaces.

H
.A. was supported by NSF-DMS #1802914 during work on this project.U.B. gratefully acknowledges support from the German Research Foundation (DFG) through the Collaborative Research Center SFB/TRR 109 Discretization in Geometry and Dynamics.M.K. gratefully acknowledges the support of NSF-DMS #2005630, NSF-DMS #1839358, and NSF-CCF #1839358.K.S. was partially supported by the NSF Graduate Research Fellowship Program under grant DGE-1842213 and by EPSRC grant EP/R018472/1.

4 y
Figure1.A summary of our main results.The axes are x = n/pq and y = j/pq.We show that if (x, y) is outside the shaded region bounded by y = 1 − x, y = x, and y = 1/3, then H j [C(n; p, q)] = 0. We show conversely that for every rational point (x, y) in the blue part of the shaded region, there exist n, j, p, and q such that x = n/pq, y = j/pq, and H j [C(n; p, q)] = 0.Each of the blue dots represents a point (x, y) where we computed that H j [C(n; p, q)] = 0, with n ≤ 6.

Figure 11 .
Figure 11.In a sequence of cells with the same apex, alternating between two consecutive dimensions, with consecutive pairs alternating between matched and incident, the corresponding independent sets look more and more like the unmatched set, and thus cannot cycle.

Figure 12 .
Figure12.Each vertex is assigned the two half-squares it touches.If vertex v has neighbors in both directions, then r(v) contains only these two half-squares.

Figure 18 .
Figure18.A map T 2 → C(3; 3, 3).The light gray and dark gray squares orbit each other inside the blue 2 × 2 square as in Figure15, while the black and blue square orbit each other independently as in Figure17.

Figure 22 .
Figure22.Another view of the Betti numbers.Let n = 6 and j = 2, and let p and q be the horizontal and vertical axes.Then the solid regime is in the lower left, the gas regime is in the upper right, and the liquid regime (in bold) is in between.If p ≥ n, then the inclusion map C(n; p, q) ֒→ C(n; p + 1, q) induces an isomorphism on homology.Similarly, if q ≥ n then the inclusion map C(n; p, q) ֒→ C(n; p, q + 1) induces an isomorphism on homology.