The Complexity of Poset Games

. The complexity of deciding the winner of poset games was only known to be somewhere between NC 1 and PSPACE . We resolve this discrepancy by showing that the problem is PSPACE -complete. To this end, we give a reduction from Node Kayles. The reduction yields a 3-level poset game. Hence the compexity of 2-level games remains an interesting open question. We make some progress and give a simple formula allowing one to compute the status of a type of two-level poset game that we call parity-uniform in polynomial time. This class includes significantly more easily solvable two-level games than was known previously. We also establish general equivalences between various two-level games. These equivalences imply that for any n , only finitely many two-level posets with n minimal elements need be considered, and a similar result holds for two-level posets with n maximal elements.

poset. Equivalently, the last player able to select an element wins. We will assume that the poset is finite, which ensures that the game will eventually end in such a manner.
Poset games have been studied in various forms since a complete analysis of the poset game Nim was given in 1901 by Bouton [3]. Other poset games with explicit polynomial time strategies include von Neumann's Hackendot [22] and impartial Hackenbush on trees [2]. The above games have no induced subposet of cardinality four whose Hasse diagram forms an 'N'. In fact, Deuber & Thomassé [5] have shown that all N-free poset games can be solved in polynomial time.
However there are several other well-studied poset games played over specific structures with unknown complexity [8]. Perhaps the most popular is the game of Chomp, which was introduced by Gale in 1974 and is played on the cross product of two Nim stacks [11]. Work by Byrnes [4] shows that certain Chomp positions exhibit periodic behavior, but a quick general solution still does not exist. In Subset Takeaway [12], introduced by Gale in 1982, the players take turns removing a set and all its supersets from a collection of sets. In Shuh's Game of Divisors [19], the players alternate removing a divisor of n and its multiples. In fact, both Chomp and Subset Takeaway are special cases of the Game of Divisors, with n the product of at most two primes and n square-free, respectively.
In this paper, we discuss the complexity of deciding the winner of an arbitrary finite poset game, which has remained a longstanding question in the attempt to classify the tractability of combinatorial games [8,9]. Let PosetGame be the language consisting of poset games with a winning strategy for the first player. Kalinich [15] showed that PosetGame is at least as hard as NC 1 under AC 0 -reductions by creating a correspondence with Boolean circuits. Weighted poset games, which are a generalization of poset games, were shown to be PSPACE-complete in [14]. That result, which uses a completely different technique than the one described in this paper, along with another proof in [20], clearly show that PosetGame is in PSPACE. We show in Section 3 that PosetGame is indeed PSPACE-complete. Our reduction is from the language NodeKayles of instances of the twoplayer game Node Kayles with a first-player win, shown to be PSPACE-complete by Schaefer [18].
As we will see, the above reduction yields a 3-level poset game, i.e., a game where the poset is the union of at most three antichains. Hence, the problem remains PSPACE-complete even restricted to games played on posets with three levels. It is therefore a natural question to ask if two-level poset games are easy, as no hardness result is known for them. We also address this question here.
We prove in Section 4 that if a set of elements of a poset have exactly the same set of neighbors in the poset, then only the parity of the set matters for the status of the game. This implies that we only need consider a finite number of poset games with any given set of bottom elements, and similarly for a given set of top elements. Also in Section 4, as a warm-up, we compute the Grundy numbers (see Definition 2) of some simple two-level poset games.
Fraenkel and Scheinerman [10] have solved some cases of a certain class of poset games known as hypergraph games (poset of edges and vertices in the hypergraph with containment order). The hypergraph games on P -uniform hypergraphs correspond to a special class of two-level poset games. One of the cases of hypergraphs they have solved is P -uniform P -partite hypergraphs. Their paper was the first one giving results applying specifically to two-level poset games. In Section 5, we generalize their result to a significantly larger class of two-level poset games.
The hypergraph game on graphs is known as Graph Chomp. Graph Chomp on bipartite graphs is a special case of the P -uniform P -partite hypergraph game, and thus, is also subsumed by our result. Solutions for some specific families for non-bipartite graphs are also known (see [16] and references therein), but for general graphs, its complexity is unknown.
The formulas for the Grundy numbers that we present in this paper are all easily computed in polynomial time, in fact in TC 0 . Hence, these games are solvable in polynomial time. Whether two-level poset games are easy in general is still an open question.

Basic definitions
We consider the two-player games Node Kayles and the poset game.
In Node Kayles, we are given an undirected graph G = (V, E). The players take turns removing a vertex v from the remaining graph. With v, also all neighbors of v are removed. The player who makes the last move, leaving an empty graph, wins. We let NodeKayles be the language of Node Kayles games in which the first player has a winning strategy.
In a poset game, we are given a set P and a partial order ≤ on P . The players take turns removing an element x ∈ P from the remaining poset. With x, all y ≥ x are also removed. The player who makes the last move, leaving an empty poset, wins. We let PosetGame be the language of poset games in which the first player has a winning strategy.
We use directed acyclic graphs (Hasse diagrams) to represent partially ordered sets. The vertices of the graph are the elements of the poset, and y ≥ x if and only if vertex y is reachable from vertex x in the graph. In a slight abuse of notation, we will call the set P in a poset game also a partial order or a poset game.
The two games are examples of two-player impartial games. These are games where allowed moves only depend on the current state of the game and not on which player is playing. Note also that there is always a winner in both games. That is, no draw is possible.
A game, or a position within a game, is called winning or an ∃-game, if there exists a winning strategy for the first player. Sometimes it is also called an N-game because it is a win for the next player. Otherwise the game, or the position, is called losing or a ∀-game as any strategy of the first player will lose. Sometimes it is also called a P-game because it is a win for the previous player. Below is the formal, recursive definition. For an impartial game G and an allowed move x in G, let G x denote the game obtained after making the move x. Thus, for a poset game P and any x ∈ P , P x will denote the induced subposet Definition 1 Let G be an impartial game.
G is an ∃-game iff there exists an allowed move x in G such that G x is a ∀-game.
G is a ∀-game iff it is not an ∃-game.
So for example for a poset game, ∅ is a ∀-game, and the one-element poset is an ∃-game.

Constructing games and Grundy numbers
The basic theory of impartial combinatorial games is well-established, going back (at least) to Sprague and Grundy [21,13], and can be found in a number of books [1,2]; see also [6] for a survey using poset games specifically. Here we briefly review the relevant definitions and results from that theory. For impartial games G 1 and G 2 , one defines the impartial game G 1 + G 2 , which we call the parallel union of G 1 and G 2 , by putting them together side-by-side. A valid move in this game is either a move in G 1 or a move in G 2 . A move in G 1 is not supposed to affect G 2 and vice versa. Note that for any impartial game G, the parallel union G + G is a ∀-game.
Definition 2 The Grundy number (or g-number) g(G) of an impartial game G is given by the following recursive formula: We call the set {g(G x ) | x is an allowed move in G} the g-set of the game G. Notice that according to the definition, for a poset game on the empty poset ∅, g(∅) = 0. More generally, if C n is a chain, i.e., a linearly ordered set of n points, then the Grundy number of the corresponding poset game will be g(C n ) = n and g-set(C n ) = {0, . . . , n − 1}. Clearly, the number n of nodes of a poset game is an upper bound on its g-number. Figure 1 shows the computation of the g-number of a particular poset from its game tree. The following easy criterion was proved by Grundy [13].
The Sprague-Grundy theorem relates g(G 1 + G 2 ) with g(G 1 ) and g(G 2 ) for any impartial games G 1 and G 2 . For natural numbers α and β, let α ⊕ β denote the natural number whose binary representation is the bitwise XOR of the binary representations of α and β.
Computing the g-number of a poset game is polynomial-time equivalent to finding its status: Finding the status from the g-number is trivial by Observation 3, above. For the other direction, by the Sprague-Grundy theorem, given a finite poset P with n points, g(P ) is the unique g ∈ {0, . . . , n} such that (P + C g ) is a ∀-game. Hence, our focus will be to compute the g-number of a given poset.
A poset P has k levels iff it can be partitioned into k antichains but not into k −1 antichains. As mentioned earlier, for three-level posets, finding the status is PSPACE-hard. So, a natural question is whether two-level posets are easy. Starting in Section 4 we will give explicit formulas for the g-number for some specific classes of two-level posets.

PosetGame is PSPACE-complete
Soltys and Wilson [20] showed that PosetGame is in PSPACE. We show that it is in fact complete.
We prove the theorem in the rest of this section. To show PSPACE-hardness, we will give a reduction from NodeKayles to PosetGame. The reduction is a composition of two functions, ψ and φ that we will present first. Finally we show that when the two functions are applied in succession, they reduce an instance of NodeKayles into an instance of PosetGame such that the winning player is preserved.
Let G = (V, E) be an undirected graph, where V is the set of vertices and E is the set of edges. We will use K n to denote the complete graph on n vertices. We summarize the crucial properties of the construction.
Lemma 1 Let G be a graph.
(i ) The edge cardinality of ψ(G) is always odd.
(ii ) For every vertex of ψ(G), there is an edge in ψ(G) that is not incident to it.
Proof: The first two items are obvious. We show the third item. Note that g(K n ) = 1 for all n ≥ 1. Therefore by Theorem 4, .

□
Next, we define the crucial mapping φ from graphs to posets. The final reduction from NodeKayles to PosetGame will then be the composition φ • ψ.
Let G = (V, E) be a graph. The elements of the poset φ(G) can be partitioned into three levels, φ(G) = A ∪ B ∪ C with disjoint levels A, B, and C from lowest to highest. That is, for any a ∈ A, b ∈ B, and c ∈ C, b ̸ ≤ a, c ̸ ≤ b, and c ̸ ≤ a. Furthermore, any two elements on the same level are incomparable.
The elements are defined as follows: The elements of C are the edges of G. That is, C = E.
The elements of B are the vertices of G. That is, B = V .
The elements of A are copies of the edges of G. For notation, we denote the copy of edge e by γ(e). Then That is, e is greater than its endpoints in B.
That is, γ(e) is less than all the elements in B except the endpoints of e.   For the following lemma, assume that two players, Alice and Bob, are playing the poset game on φ(ψ(g)). They take turns choosing elements from this poset. This lemma will be used to show that the player who first chooses an element from A or C or chooses a neighbor of a vertex already chosen, loses. For (3): Assume that either player, say Alice, chooses γ(e), which results in an even number of incomparable points in A, v 1 and v 2 in B, and e in C. Bob can then respond by choosing e. If Alice responds with v 1 , then Bob can respond with v 2 (and vice versa), resulting in an even number of points in A, which is a win for Bob.
If, however, Alice responds with a point a ∈ A, there are three cases: a ≤ v 1 and a ≤ v 2 , a ≤ v 1 and a ̸ ≤ v 2 , or a ≤ v 2 and a ̸ ≤ v 1 . Note that, by construction, there is no point a such that a ̸ ≤ v 1 and a ̸ ≤ v 2 . That is, the only point that is not less than both v 1 and v 2 is γ(e), which has already been taken by assumption. So first assume that a ≤ v 1 and a ≤ v 2 . This would leave an odd number of elements in A, resulting in a win for Bob. Consider then that a ≤ v 1 and a ̸ ≤ v 2 or a ≤ v 2 and a ̸ ≤ v 1 . Without loss of generality we can assume a ≤ v 1 and a ̸ ≤ v 2 . By Lemma 1(ii), there exists an edge e 2 that is not incident to v 2 . By construction, γ(e 2 ) ≤ v 2 . Thus, Bob can choose γ(e 2 ), leaving only an even number of elements in A, resulting in a win for Bob.
If Alice had initially chosen e instead of γ(e), then Bob could have responded with γ(e), which leads to the same game as played as above, which was a win for Bob. Thus e is a losing move as well. □ Now we combine the lemmas to finally prove Theorem 6. We will argue inductively that Nodes Kayles for G is a winning game iff the poset game on φ(ψ(G)) is a winning game. Note that φ(ψ(G)) is computable in polynomial time.
The idea behind the construction is that both players are forced to play elements in B until two elements v 1 and v 2 representing adjacent vertices e = (v 1 , v 2 ) in ψ(G) have been chosen. At this point the next player can win by choosing the element γ(e) in A.
Assume that the poset game played on φ(ψ(G)) has been played in the prescribed manner so far. That is, no elements from A or C have yet been chosen. Lemma 2 (1) ensures that choosing a vertex neighboring a vertex that has already been chosen is a losing move. Lemma 2 (2) and (3) ensure that choosing any point in A or C before two neighboring vertices have been chosen is a losing move. Thus, a player has a winning strategy on φ(ψ(G)) iff that player has a winning strategy on ψ(G), since there is an obvious correspondence between the moves in φ(ψ(G)) and the moves in ψ(G). Lemma 1 (iii) ensures that a player has a winning strategy on ψ(G) iff he has a winning strategy on G. This finishes the proof of Theorem 6.

Two-level posets
In the previous section, we proved that three-level poset games are hard. We now consider the complexity of two-level poset games in the remaining two sections. We show that some special classes of two-level poset games can be decided in polynomial time.
A two-level poset game can be represented by a two-layer graph, say top and bottom layers (both antichains), which partition the nodes into top nodes and bottom nodes, respectively. Any edge in the Hasse diagram joins a bottom node to a top node. Two nodes are comparable if and only if there is an edge between them, and moreover, if they are comparable then the top node is greater than the bottom node. Hence we can write G = (B, T, E), where B is the set of bottom nodes, T is the set of top nodes, and E are the edges.
We first look at a particular class of two-level posets which just have a zig-zag pattern as shown in Figure 5. We can classify them into three categories, M i , W i , and N i , depending on their starting and ending edge orientation. Here i ≥ 0 represents the number of bottom nodes, or top nodes in case of M i . We define M 0 and W 0 as a single node, and N 0 as the empty set. Their g-numbers follow a nice pattern which we give in the next theorem. This pattern was found independently by Rogers [17].
Theorem 7 The Grundy numbers of the zig-zag posets are given by the following formulas: For (2), the pattern given by the formula looks as follows i 0 1 2 3 4 5 6 7 8 · · · g(N i ) 0 2 0 4 6 4 8 10 8 · · · We determine the g-set of N i : Removing the leftmost bottom node from N i leads to an N i−1 -poset, and removing the leftmost top node leads to an N i−1 -poset with one node in parallel. Hence, g( -Removing the jth bottom node from left from N i leads to an N i−j -poset to the right of this node, and a M j−2 -poset to its left.
-Removing the jth top node from left from N i leads again to an N i−j -poset to the right of this node, whereas we get an M j−1 -poset to its left.
There are no other elements of g-set(N i ). Hence we get that g-set . Hence, the g-number is as claimed in the theorem.
For (3), let us now construct the g-set for W i . Removing any node from it would give us one or two N -posets. There always exists a middle bottom or top node whose removal will lead to the parallel union of two identical N -posets, which has g-number 0. Since by (2), the g-number of N -posets is always even, 1 / ∈ g-set(W i ). Hence, g(W i ) = 1. □ Now, let us look at another poset game. Figure 6 shows a particular class of two-level poset games where there are 2 bottom nodes and t top nodes, connected as a complete bipartite graph.
One can show by induction that the g-number of such a game is 2 · (t mod 2). So, the g-number or the status only depends on the parity of the top nodes. Hence, if we remove all but t mod 2 of the top nodes in the game shown in Figure 6, we get a game with the same g-number. Our next theorem shows how we can do this reduction simultaneously for several such patterns.
Let P = (B, T, E) be a two-level poset game. For nodes x ∈ B and y ∈ T we define the set of neighbor nodes as Theorem 8 Let P = (B, T, E) be a two-level poset game and S ⊆ T be a set of top nodes that all have the same set B 0 of neighbors, i.e., B y = B 0 for all y ∈ S. Construct P ′ from P by removing all but |S| mod 2 of the nodes in S. Then g(P ) = g(P ′ ).
Proof: By Corollary 5 it suffices to show that g(P + P ′ ) = 0, i.e., P + P ′ is a ∀-game. We consider the case that we have removed only two nodes from S. Then the claim follows by induction. Let us denote the two nodes removed from P by α and β. We show that the second player has a winning strategy in P + P ′ .
If the first player plays anything other than α or β, the second player just imitates the same move in the other game. If the first player removes α, the second player plays β, and vice versa. Note that by our assumption, at the first player's turn, either both nodes α and β are still there or none of them: since B α = B β = B 0 , any bottom node move will remove either both or none of them. Hence, the second player is always the last to play. □ Theorem 8 tells us that for any two-level poset game we can assume that it has the following "extensional" property: any two top nodes have a different set of neighbors in B. All other cases can be reduced to this one. Such a poset is essentially a set system, that is, a collection {S 1 , . . . , S t } of subsets of some finite domain B. In the poset, the bottom points form the domain, and each top point corresponds to one of the sets S i , containing those bottom points less than it. There are 2 2 n many set systems on a domain of size n, and so there are at most 2 2 n many two-level posets to consider with n bottom elements. Many of these are isomorphic, so the number of distinct posets is much fewer. For example, of the 256 extensional posets with 3 bottom elements, there are 40 isomorphism types.
A similar theorem can be obtained for the bottom nodes too, but a slightly weaker version. For any set S ⊆ B such that all nodes in S have the same set of neighbors in T , we can remove all but one node from S, if |S| is odd, and obtain an equivalent game. This is analogous to Theorem 8. However, if |S| ≥ 2 is even, then we can remove all but two nodes from S. It does not follow that the cases |S| = 2 and |S| = 0 are equivalent. Therefore, |S| is either 0, 1 or 2.
Theorem 9 Let P = (B, T, E) be a two-level poset game and S ⊆ B, |S| ≥ 3, be a set of bottom nodes that all have the same set T 0 of neighbors, i.e., T y = T 0 for all y ∈ S. Construct P ′ from P by removing two nodes from S. Then g(P ) = g(P ′ ).
Proof: We show again that g(P + P ′ ) = 0. We will describe the winning strategy for the second player.
The second player again just imitates the first player's moves in the other game while she can. If the first player removes a node, say from S in P , then the second player will remove a node from the corresponding set S ′ in P ′ , or vice versa. At some point after the second player moves we will have |S| = 2 in P , and |S ′ | = 0 in the corresponding set in P ′ . By our assumption that |S| ≥ 3 originally, we know that some node from S has already been removed, and so the set T 0 is also removed from both P and P ′ in some previous moves. Now if the first player then removes a node from S, the second player just removes the other node from S. As the set T 0 was already removed, now the games P and P ′ are exactly same, and the second player can continue his imitating strategy. So the second player is always the last player. □

Parity-uniform games
In this section, we present our other main result, which computes the g-number for a certain class of two-level games which we define below.
Fraenkel & Scheinerman [10] have studied a related class of games called hypergraph games. There, the game is a hypergraph, and a valid move is to either remove a vertex and all hyper-edges containing it or remove a hyper-edge and all hyper-edges containing it.
A two-level poset can also be seen as a hypergraph, with bottom nodes being the vertices and the top nodes being the hyper-edges. A valid move in the poset game, however, would be a little different from that in a hypergraph game. Namely, a valid move is to either to remove a vertex and hyper-edges incident on it or else to remove a hyper-edge. Fraenkel & Scheinerman gave an explicit formula for the g-number for p-uniform, p-partite hypergraphs. A p-uniform p-partite hypergraph has a p-partition of its vertices such that every hyperedge is incident on exactly one vertex from each partition. This class of hypergraphs correspond to two-level posets where the bottom layer has p partitions and every top node is connected to exactly one node in each partition of the bottom layer. For this class, the hypergraph game and the poset game have the same rule for a valid move.
We generalize their result to a larger class of two-level posets defined as follows: Definition 10 We say that a two-level poset is parity-uniform if (i ) all top nodes have the same degree parity, and (ii ) there is a bipartition of the bottom nodes such that every top node has an odd number of connections to at least one of the partitions.
Note that parity-uniformity is preserved under valid moves on the poset. This class of posets is clearly a generalization of the uniform p-partite hypergraphs. Note that when every top node has odd degree, then the poset trivially has property (ii ) of Definition 10: we just take (B, ∅) as the bipartition. So property (ii ) is significant only in the other case, when every top node has an even degree, and in this case every top node has an odd number of connections to both partitions. The next theorem gives the g-number for this class of posets.
Theorem 11 Let P = (B, T, E) be a parity-uniform, two-level poset with every top node having degree parity p ∈ {0, 1}. Let b = |B| mod 2 and t = |T | mod 2. Then Proof: We prove the formula by induction on |P |. In the base case when |B| = 0 and |T | = 0, the formula is trivially true. As parity-uniformity is preserved under a valid move in the poset, our inductive hypothesis is that the theorem holds for the game P ′ that we get after a single move. We consider four inductive cases, below. In each, we use b ′ and t ′ to denote the bottom and top parities in P ′ , respectively. b = 0 and t = 0. We need to show that g(P ) = 0. If we remove a bottom node from P to get P ′ , then by the inductive hypothesis, we have g(P ′ ) > 0, since b ′ = 1. If we remove a top node, then t ′ = 1 and b ′ = 0, so g(P ′ ) ≥ 2. Hence g(P ) = 0. b = 1 and t = 0. We need to show that g(P ) = 1. If we remove a top node, then b ′ = 1 and t ′ = 1. By induction, g(P ′ ) ≥ 2. If we remove a bottom node with odd degree, we get a game P ′ with b ′ = 0 and t ′ = 1. So, again g(P ′ ) ≥ 2. If we remove a bottom node with even degree (assuming for the moment that one exists), then b ′ = 0 and t ′ = 0, and by induction, g(P ′ ) = 0. Hence g(P ) = 1.
We claim that there always exists a bottom node with even degree. We note that |E| ≡ pt ≡ 0 (mod 2). As there are an odd number of bottom nodes, and the sum of their degrees should be even, there must be at least one bottom node with even degree.
In the next two cases, t = 1. Also, there is a subset S ⊆ B of the bottom nodes such that every top node has an odd number of connections to S. Therefore, the number of edges incident on S, |E(S)| ≡ t · 1 ≡ 1 (mod 2). Thus there must be a node in S with odd degree. b = 0 and t = 1. If we remove a top node, then b ′ = 0 and t ′ = 0. Hence g(P ′ ) = 0. If we remove a bottom node with odd degree, which always exists, then b ′ = 1 and t ′ = 0. So, by induction, g(P ′ ) = 1. Now we consider two subcases: 1. p = 0. If there is a bottom node with even degree, removing it would lead to b ′ = 1 and t ′ = 1, and thus g(P ′ ) = 3 by induction. Hence, g(P ) = 2.
2. p = 1. The total number of edges |E| ≡ tp ≡ 1 (mod 2). So there must be odd number of bottom nodes with odd degree. And as b = 0, there is a bottom node with even degree. Removing it would lead to b ′ = 1 and t ′ = 1, and thus g(P ′ ) = 2 by induction. Hence g(P ) = 3. b = 1 and t = 1. If we remove a top node then b ′ = 1 and t ′ = 0. So, g(P ′ ) = 1. If we remove a bottom node with odd degree, which always exists, we get b ′ = 0 and t ′ = 0, and thus g(P ′ ) = 0. Again we consider two subcases: 1. p = 1. If there is a bottom node of even degree, removing it would lead to b ′ = 0, t ′ = 1 and g(P ′ ) = 3. Hence, g(P ) = 2.
□ As already mentioned above, when every top node has odd degree, then the game is parityuniform. Hence, with the same notation as in Theorem 11, we get the following special case: Corollary 12 Let P = (B, T, E) be a two-level poset with every top node having odd degree. Then g(P ) = b ⊕ 3t.
By the reduction presented in the proof of Theorem 6, it follows that deciding the winner of a finite poset game with any height k ≥ 3 is PSPACE-complete. In contrast, determining the winner of single-level poset games is trivially obtained by considering the parity of the poset elements.
We have given an explicit formula for the g-numbers of some classes of two-level posets. As a consequence, we can determine in polynomial time whether these games are winning games. For general two-level posets, the question is still open. A natural extension of our work would be to weaken the hypotheses of Theorem 11 and still get an easy formula for the g-number.
We conjecture that two-level poset games can be solved in polynomial time, and consequently, that three levels are necessary for a reduction from PSPACE. But as long as there is no proof for this conjecture, one should also look at the other side of the fence, as it were, and look for a reduction from a NPor PSPACE-complete language to two-level posets.
This work has also spawned a new PSPACE-complete game on sets invented by Fenner and Fortnow (see [7]). Given a collection of finite sets S 1 , . . . , S k , each player takes turns picking a non-empty set S i , removing the elements of S i from all the sets S j . The player who empties all the sets wins. To reduce a poset game into an instance of set-game, simply take the sets as the upper cones of the poset. That is, each set consists of an element and all elements greater than it. However, if the cardinality of the sets is bounded, the complexity is still open.