Oriented Matroids and Combinatorial Neural Codes
Abstract.
A combinatorial neural code is called convex if it arises as the intersection pattern of convex open subsets of . We relate the emerging theory of convex neural codes to the established theory of oriented matroids, both with respect to geometry and computational complexity and categorically. For geometry and computational complexity, we show that a code has a realization with convex polytopes if and only if it lies below the code of a representable oriented matroid in the partial order of codes introduced by Jeffs. We show that previously published examples of non-convex codes do not lie below any oriented matroids, and we construct examples of non-convex codes lying below non-representable oriented matroids. By way of this construction, we can apply Mnëv-Sturmfels universality to show that deciding whether a combinatorial code is convex is NP-hard.
On the categorical side, we show that the map taking an acyclic oriented matroid to the code of positive parts of its topes is a faithful functor. We adapt the oriented matroid ideal introduced by Novik, Postnikov, and Sturmfels into a functor from the category of oriented matroids to the category of rings; then, we show that the resulting ring maps naturally to the neural ring of the matroid’s neural code.
1. Introduction
A combinatorial neural code is a collection of subsets of . Such codes model neural activity, with each codeword in representing a set of neurons which are simultaneously active. Our motivating example is the activity of hippocampal place cells, neurons in the brain which encode an animal’s physical location [okeefe1978]. Each neuron is active when the animal is in a corresponding subset of the animal’s environment , called the -th place field. If neural activity is viewed as a function , then the set is the support of the -th component of this function, the “preferred location” of that neuron. Neurons acting as indicators for a preferred set of stimuli appear across many sensory modalities, so we will use the slightly broader term receptive field to de-emphasize the spatial navigation aspect.
In this simplified model, neurons fire together if and only if their receptive fields overlap, and thus the code represents the intersection pattern of the receptive fields. This information can reveal significant topological and geometric information in experimental data, such as the topology of an animal’s environment [curto2008cellgroups] or the intrinsic geometry of more abstract stimulus spaces [giusti2015clique, zhou2018hyperbolic]. Receptive fields are often observed to be convex, and therefore we are interested in characterizing convex neural codes: codes that arise as the intersection patterns of convex open subsets of some Euclidean space. For example, Figure 1 illustrates three convex receptive fields and the associated convex code.

Beyond experimental motivation, requiring receptive fields to be convex yields rich theoretical results. In particular, the nerve lemma can be used to deduce topological properties of simplicial complexes associated to convex codes [curto2017makes, chen2019neural]. Another useful tool developed to study neural codes is the neural ring [curto2013neural], the coordinate ring of the code as an algebraic variety in . This was used to detect obstructions to convexity in [curto2019algebraic]. However, there are many examples of non-convex codes which cannot be captured by these obstructions [lienkaemper2017obstructions, jeffs2019sunflowers]. While other classes of neural codes have been completely characterized (e.g. codes described by connected receptive fields [mulas2020minimal], or convex codes on five or fewer neurons [goldrup2019classification]), convex codes have evaded full description.
As the literature on combinatorial neural codes proliferated, we observed various similarities with the well-studied realm of oriented matroid theory. For instance, the class of stable hyperplane codes introduced in [itskov2018hyperplane] are defined by a collection of half-spaces intersecting a convex set, which are precisely the sets of topes of a realizable COM (conditional oriented matroid) as studied in [bandelt2018coms]. The neural ideal, defined in [curto2013neural] and further developed in [curto2019algebraic, gunturkun2017polarization, de2019neural], seems to align with the oriented matroid ideal defined in [novik2002syzygies], particularly after the neural ideal is polarized [gunturkun2017polarization]. Finally, morphisms of codes, as defined in [jeffs2019morphisms], seem analogous to strong maps of oriented matroids, as formulated in [hochstattler1999linear]. In this paper, we draw parallels between the notions of convexity for neural codes and representability for oriented matroids, and formalize these connections on a functorial level.

First, we establish strong connections between representable oriented matroids and convex neural codes by considering the map which takes an oriented matroid to the positive parts of its covectors. Representable oriented matroids are precisely those which can be obtained from real hyperplane arrangements, as in Figure 2(a). Isomorphism classes of neural codes form a partially ordered set denoted , introduced in [jeffs2019morphisms]. Roughly, if there is a way to construct a realization for using a realization of , in which case we say is a minor of . We extend a result of [jeffs2019morphisms] and use it to prove that all codes lying below codes of representable oriented matroids have realizations with interiors of convex polytopes, which we call open polytope convex. Further, the converse also holds:
Theorem 1.
A code is open polytope convex if and only if it is a minor of for some representable oriented matroid .
Since every code which has a convex realization in the plane has a realization with convex polygons [bukh2022planar], this result gives a full characterization of planar convex codes in terms of representable oriented matroids. In higher dimensions, it is not yet known whether every convex code has a realization with convex polytopes. If this does hold, then 2 would give a full characterization of convex codes in terms of representable oriented matroids. Without this result, we can still categorize non-convex codes: if a code is not convex, then either it does not lie below any oriented matroid in , or it lies below non-representable matroids only. There are many known examples of non-convex codes [curto2017makes, lienkaemper2017obstructions, jeffs2019morphisms, jeffs2019sunflowers, chen2019neural], and we show that many of these fall into the first category: they are non-convex because they are not below any oriented matroids in . For instance, codes with topological local obstructions do not lie below oriented matroids. Furthermore, sunflower codes [jeffs2019sunflowers], a well known family of non-convex codes with no local obstructions also do not lie below oriented matroids.
Theorem 2.
The non-convex codes with no local obstructions constructed via sunflowers do not lie below codes of oriented matroids in .
We are also able to generate an infinite family of non-convex codes of the second kind, those which lie below non-representable matroids only. In order to obtain this family, we establish a relationship between representability and convexity. We do this for the special case of uniform oriented matroids of rank 3, which correspond to non-degenerate pseudoline arrangements in the plane.
Theorem 3.
Let be a uniform, rank 3 oriented matroid. Then we can construct a code which is convex if and only if is representable.
Using this result, we are able to compare two fundamental decision problems: (1) is a given oriented matroid representable, and (2) is a given neural code realizable by convex sets. We demonstrate that deciding convexity for arbitrary neural codes is at least as hard as deciding representability of an oriented matroid. The latter problem is known to be NP-hard and -hard, leading to the following theorem:
Theorem 4.
The convex code decision problem is NP-hard and -hard.
Finally, we relate algebraic and categorical structures for matroids and codes. Acyclic oriented matroids form a category whose morphisms are given by strong maps, as defined in [hochstattler1999linear]. Neural codes form a category introduced in [jeffs2019morphisms], with morphisms defined using trunks of codes. We show that the map which takes an acyclic oriented matroid to the positive parts of its topes is a faithful functor. Furthermore, we adapt the oriented matroid ideal introduced in [novik2002syzygies] to non-affine oriented matroids, producing the oriented matroid dual ideal and the oriented matroid ring . We show that the map taking an oriented matroid to its oriented matroid ring is a functor, and use this to define the category . Using results from [gunturkun2017polarization], we define the depolarization map , and show that this map is functorial. Finally, we show that these maps play nicely with the functor from [jeffs2019morphisms].
Theorem 5.
The maps , , and are functorial. In particular, the map is a faithful, but not full functor from . Moreover, the square below commutes, that is, .
The paper is organized as follows: In Section 2, we establish notation and background material that will be necessary for later sections. In Section 3, we relate minors of codes to realizability by intersection-closed families of sets, and use this to establish Theorem 2. In Section 4, we discuss classes of non-convex codes and their relationships to oriented matroids. In Section 5, we detail the functors among the categories of acyclic oriented matroids, combinatorial neural codes, and rings. Finally, in Section 6, we present open questions related to each area discussed in the paper.
2. Background
We provide the essential background information on oriented matroids in Section 2.1 and combinatorial codes in Section 2.2. In Section 2.3, we define the maps and which take oriented matroids to combinatorial codes. This section is by no means comprehensive, and we will occasionally make reference to theorems not fully stated in the text. Our primary reference for oriented matroids is [bjorner1999oriented], which collects and synthesizes decades of research on the subject. For combinatorial codes, there is no single comprehensive reference; for those unfamiliar with the subject, [curto2013neural] and [jeffs2019morphisms] are good introductions to the neural ring and morphisms of codes, respectively.
2.1. Oriented matroids
An oriented matroid consists of a finite ground set and a collection of signed subsets of satisfying certain axioms. Typically, we will take , , and . The set is endowed with the involution , exchanging with . The negative of a subset is . The support of a set is the set . The positive part of is and the negative part is .
A set is a signed set if its positive and negative parts are disjoint. If and is a signed subset of , define by if , if , and otherwise; in this way, we can consider signed subsets equivalently as subsets of or as vectors in . The composition of sign vectors and is defined component-wise by
The separator of and is the unsigned set .
Now, we are ready to define oriented matroids, which we do via the covector axioms.
Definition 2.1.
Let be a finite set, and a collection of signed subsets satisfying the following covector axioms:
-
(V1)
-
(V2)
implies .
-
(V3)
implies .
-
(V4)
If and , then there exists such that and for all .
Then, the pair is called an oriented matroid, and its set of covectors.
Maximal covectors (with respect to inclusion) are called topes. An oriented matroid is acyclic if it has a positive tope, i.e. a tope with empty negative part.
Example 2.2.
A central hyperplane arrangement in produces an oriented matroid. Let be linear forms on , and their zero sets (i.e. hyperplanes). We can assign each point to a signed set by
The family of signed sets which arise in this way satisfies the covector axioms, and therefore defines an oriented matroid. Notice that each covector corresponds to a cell of the hyperplane arrangement, and that topes correspond to top-dimensional cells. We will refer to this oriented matroid as the oriented matroid of .
An oriented matroid is representable if for some hyperplane arrangement . Figure 2(a) illustrates an example in . The rank of a representable oriented matroid is the minimum possible dimension of the hyperplane arrangement with . Not every oriented matroid is representable. However, we are able to take this hyperplane picture as paradigmatic. The topological representation theorem guarantees that every oriented matroid has a representation by a pseudosphere arrangement [folkman1978oriented]. For details, see [bjorner1999oriented, Chapter 5].
We can also use oriented matroid theory to describe affine hyperplane arrangements. An affine oriented matroid consists of a pair where is an oriented matroid and is a distinguished element of its ground set. The affine space of is the set . We can embed an affine hyperplane arrangement in as a central hyperplane arrangement in . We replace each affine hyperplane with a central hyperplane , and add an additional hyperplane . Restricting to the plane recovers the original hyperplane arrangement. Each chamber of the affine arrangement corresponds to an element of the affine space of , where corresponds to the hyperplane . Because we can translate between affine and central realizations, the matroid is representable with a central hyperplane arrangement if and only if is representable by an affine hyperplane arrangement for any ground set element .
There are many equivalent axiomatizations of oriented matroids. The two formulations we use most often throughout this work are the covector axioms (V1)-(V4), stated above, and the circuit axioms (C1)-(C4), which we state here.
Definition 2.3.
Let be a finite set, and a collection of signed subsets satisfying the following circuit axioms:
-
(C1)
.
-
(C2)
implies .
-
(C3)
and implies or .
-
(C4)
For all with and an element , there is a such that and .
Then the pair is an oriented matroid, and is its set of circuits.
In some contexts, we admit the sets as improper circuits. We will call a circuit a proper circuit when we wish to emphasize that it is a signed set, i.e. its positive and negative parts are disjoint.
For an oriented matroid arising from a hyperplane arrangement, circuits are the signs of the coefficients in the minimal linear dependencies among the normal vectors to the hyperplanes. As a result, the rank of an oriented matroid can be defined via its circuits – the rank of an oriented matroid is the one less than the cardinality of its largest circuit. An oriented matroid is uniform of rank if all of its circuits have the same cardinality of . Uniform oriented matroids correspond to generic hyperplane arrangements.
An element is a loop of if . An oriented matroid is loopless if no element is a loop.
Proper circuits are related to covectors as follows: Two signed sets and are called orthogonal if either or if there exist such that . A signed set is called a vector of if and only if it is orthogonal to every covector. Equivalently, a signed set is a vector of if and only if it is orthogonal to every tope. The circuits are the minimal vectors of . The vectors of an oriented matroid define a dual oriented matroid, hence the vector and covector axioms are identical. Minimal covectors are know as cocircuits. They also satisfy the circuit axioms.
For a given oriented matroid , each one of the set of covectors , the set of topes , the set of vectors , and the set of circuits is sufficient to recover all of the others.
2.2. Combinatorial codes
A combinatorial code is a collection of subsets of a finite set , i.e. . Typically, we take .
Given an arbitrary set and collection with each , the code of the cover (relative to ) is
Note we do not require ; indeed, if and only if . A code is called open convex if there exists a collection of open convex sets and an open convex set , such that , for some . We will refer to open convex codes simply as convex codes.
Example 2.4.
Morphisms of combinatorial codes were defined in [jeffs2019morphisms] in terms of trunks. For , the trunk of in is the set of codewords which contain ,
A subset of is a trunk if it is equal to for some or if it is empty. A simple trunk is the trunk of a singleton set. A map is a morphism of codes if the preimage of each trunk of is a trunk of . Any set of trunks defines a morphism by , and any code morphism can be obtained in this way [jeffs2019morphisms, Proposition 2.12]. The class of codes, together with these morphisms, forms the category .
A subset can be encoded as a point by setting for and for . Hence, a code can equivalently be thought of as a variety . The vanishing ideal of a code is the ideal
and the neural ring of is the quotient ring . The vanishing ideal is a pseudo-monomial ideal, meaning it is generated by products of the form , called pseudo-monomials. As with circuits, we distinguish between proper pseudo-monomials, with and disjoint, and improper pseudo-monomials, which are divisible by some . We will briefly discuss the vanishing ideal and neural ring in Section 5.1, but many more details can be found in [curto2013neural]. For clarity, we will denote pseudo-monomials and monomials with superscripts, i.e.
2.3. Codes from oriented matroids
Consider an oriented matroid on ground set . We can consider the positive parts of covectors (respectively, topes) as a code on , which we denote (respectively ) to emphasize the change in categories:
In Sections 3 and 4 we will show how relates representability of oriented matroids with convexity of codes. In Section 5, we will examine the functorial properties of ; culminating in a proof of 5.
If is the matroid of a hyperplane arrangement the code matches the code of the cover given by positive sides of the hyperplanes (as in Figure 2). This extends to any topological representation of by a pseudosphere arrangement (as introduced in [folkman1978oriented]).
Observation 2.5.
If is any oriented matroid and is an oriented pseudosphere arrangement topologically realizing , then
In particular, if is a representable oriented matroid and is an oriented hyperplane arrangement realizing , then
The map is better behaved geometrically than . In particular, 2.5 fails for . For instance, in the hyperplane arrangement pictured in Figure 2, is a codeword in the code of the cover given by the positive open half-spaces, but is not the positive part of any tope.
Remark 2.6.
If is an acyclic oriented matroid, then the the signed set is a tope. Thus, if is the positive part of some covector , then is also the positive part of the tope Thus, on acyclic oriented matroids, and coincide.
3. Intersection-closed families and morphisms
In [jeffs2019morphisms], Jeffs shows that the image of a convex code under a code morphism, as well as any trunk of a convex code, is itself a convex code. From this observation, he defines the poset of isomorphism classes of codes in which convex codes form a down-set: if in and is convex, then so is . In this section, we generalize this statement to intersection-closed families, of which open convex subsets of is one example. A family of subsets of a topological space is called intersection-closed if it is closed under finite intersections and contains the empty set. We say that a neural code is -realizable if for some and . For instance, a neural code is convex if and only if it is -realizable for the set of convex open subsets of some . Then, using this result, we prove 2.
We recall the relevant definitions. Two codes and are isomorphic if there is a bijective code morphism whose inverse is also a code morphism. If there is a sequence of codes such that each successive code is either the image of a morphism from or a trunk of the preceding code, we say is a minor of [jeffs2021embedding]. Codes are then quasi-ordered by setting if is a minor of . The poset of isomorphism classes of codes induced by this order is denoted .
Proposition 3.1.
For any intersection closed family , if is -realizable and , then is -realizable.
Proof.
We first check the case . This closely follows the proof of Theorem 1.4 in [jeffs2019morphisms], since the only property of convex sets this proof uses is that the family of open convex subsets of is closed under finite intersection. We repeat the details here. Let , , and be the trunks in that define the morphism . Let be an -realization of .
If is nonempty, let be the intersection of all elements of , which is the unique largest subset of such that . Then, for , define
Since is closed under finite intersection and contains the empty set, for all . Thus, it suffices to show that the code that they realize is . To see this, note that we can associate each point to a codeword in or by and . Then let be arbitrary, and let and be the associated codewords in and respectively. By the definition of the , we have that if and only if , which is equivalent to . Since was arbitrary and every codeword arises at some point, we conclude that , as desired.
Next, we check the case . In this case, let , , be a -realization of . Then for define where
Then . To check this, as above, we can associate each point to a codeword by . Since , each of these codewords will contain , and we will obtain every codeword of containing in this way. ∎

Our first application of Proposition 3.1 is to good cover codes. A code is a good cover code if there exist open sets realizing which form a good cover, i.e. all intersections are either empty or contractible. Good cover codes are precisely the codes with no local obstructions, as proved by [chen2019neural, Theorem 3.13]. Codes with local obstructions formed the first known class of non-convex codes [curto2017makes]. Recall the link of a face in a simplicial complex is the subcomplex
For a code , is the simplicial complex of , obtained by taking the closure of under taking subsets. A neural code has a local obstruction if there is some such that is not contractible.
We show that codes with no local obstructions form a down-set in . The only requirement to be an open set in some good cover is contractibility, and the family of contractible sets is not intersection-closed. Instead, we consider the sets in one particular good cover and their intersections as our intersection-closed family.
Corollary 3.2.
The set of codes with no local obstructions is a down-set in .
Proof.
Let be a code with no local obstructions. By [chen2019neural, Theorem 3.13], is a good cover code. Fix a good cover realizing . Let denote the family of sets obtained by arbitrary intersections of sets in , together with the empty set. This family still forms a good cover. Any code is -realizable by Proposition 3.1; it is therefore a good cover code and thus has no local obstructions. ∎
Armed with these results, we look at the codes of oriented matroids and those lying below them. In particular, we examine the intersection-closed family of interiors of convex polytopes in . We say that a code is polytope convex if there exists a collection of interiors of convex polytopes and a bounding convex polytope such that . Note that polytope convex codes are open convex. Proposition 3.1 implies that the image of any polytope code under a surjective morphism is also a polytope code. Thus, since the codes of representable oriented matroids correspond to codes of hyperplane arrangements, all codes which lie below a representable oriented matroid are polytope codes. We prove the converse, showing that every polytope code is itself the image of the code of an oriented matroid under some surjective morphism. This demonstrates that polytope codes are a down-set generated by the set of representable oriented matroid codes.
We begin by noting that codes below oriented matroids have no local obstructions. This result appears in different language in [edelman2002convex]. We flesh this out.
Proposition 3.3.
Let be an oriented matroid. If in , is a good cover code, and thus has no local obstructions.
Proof.
Edelman, Reiner, and Welker define a simplicial complex which is identical to [edelman2002convex]. Proposition 11 and Lemma 13 of [edelman2002convex] establish that if , then is contractible. Thus, has no local obstructions, and is therefore a good cover code. By 3.2, good cover codes form a down-set in , so if in , then has no local obstructions. ∎
Theorem 2.
A code is polytope convex if and only if there exists a representable oriented matroid such that .
Proof.
() A polytope is an intersection of half-spaces, so this follows from 2.5 and Proposition 3.1.
() Let be a polytope convex code with a realization of with convex polytopes and bounding convex set . Without loss of generality, we can choose to be a convex polytope. Then each is the intersection of a collection of open half spaces , and is the intersection of open half spaces . Now, let . Let be the trunk of the neurons associated to . Now, we define a surjective morphism as follows. Choose trunks of by . Let be the morphism defined by the trunks . We now show that its image is .
To do this, construct the realization of given in the proof of Proposition 3.1. This construction gives the realization
relative to the convex set . Thus, . ∎
In dimension two, every convex code admits a realization with convex polytopes [bukh2022planar]. Thus, in dimension two, we can strengthen Theorem 2 as follows:
Corollary 3.4.
A code including the empty codeword is open convex with minimal embedding dimension two if and only if there exists a representable affine oriented matroid of rank three such that .
Proof.
First suppose is a planar convex code. By intersecting each of the convex sets with the same sufficiently large ball, we obtain a realization of by bounded convex sets. Then by Theorem 1 of [bukh2022planar], has a realization with interiors of convex polygons in . These convex polygons are intersections of half-spaces. Let be the affine oriented matroid of the corresponding affine, oriented hyperplane arrangement. Notice that is representable and rank three, since it arises from the centralization of a hyperplane arrangement in . The covectors in the affine space of each contain in their positive part. Then by the argument used in the proof of Theorem 2, .
Now suppose that , where is a representable affine oriented matroid of rank two. Then by Theorem 2, has a realization with intersections of half spaces in , and is thus convex with minimal embedding dimension two. ∎
4. Non-convex codes
In dimensions three or higher, it is unknown whether every convex code has a realization with convex polytopes. However, the contrapositive to Theorem 2 still helps us characterize non-convex codes. If is not convex, one of two possibilities hold: either does not lie below any oriented matroid, or lies below only non-representable oriented matroids in . In this section, we prove that codes with local obstructions as well as “sunflower codes” do not lie below any oriented matroids. We also construct a new class of non-convex codes which lie below non-representable oriented matroids.
4.1. Sunflower codes do not lie below oriented matroids
The first example of a non-convex code with no local obstructions,
appeared in [lienkaemper2017obstructions]. In [jeffs2019morphisms], Jeffs uses this code to construct a smaller non-convex code with no local obstructions,
This code is minimally non-convex, in the sense that any code in is convex. The proofs that and are not convex depend on the case of the following theorem:
Theorem 4.1 ([jeffs2019sunflowers], Theorem 1.1).
Let be convex open sets in such that for all , . Then any hyperplane which passes through each of passes through .
Jeffs uses this theorem to construct an infinite family of minimally non-convex codes with no local obstructions generalizing ; we refer to these as “sunflower codes.” In the rest of this subsection, we define the code for and give a proof that for all , the code does not lie below any oriented matroid, representable or otherwise.
Definition 4.2 ([jeffs2019sunflowers], Definition 4.1).
Let , and be sets of size . Denote by the code that consists of the following codewords:
-
•
;
-
•
;
-
•
;
-
•
the codeword for each ;
-
•
the codewords for each ;
-
•
and for each .
We will refer to the regions indexed by as petals, and the regions indexed by as simplices.

The proof of 2 depends on some basic facts about tope graphs of oriented matroids. The tope graph of an oriented matroid is a graph whose vertices are the topes of , and whose edges connect pairs of topes which differ by one sign. A subgraph is called -convex if it contains the shortest path between any two of its members. Any divides the tope graph into two half-spaces and . A subgraph is -convex if and only if it is an intersection of half-spaces [bjorner1999oriented, Proposition 4.2.6].
Theorem 3.
For each , the code for any oriented matroid .
Proof.
Fix . Suppose to the contrary that there is an oriented matroid such that . For ease of notation, let denote the code . Since , we can assume without loss of generality that for some code morphism .
Denote the ground set of by . The map must be defined by trunks
with corresponding to and respectively.
Claim 1: There is a tope of such that
.
Roughly speaking, we are producing a codeword in the intersection of the
last petal and all simplices, which also lies in the convex hull of the other petals.
Define a morphism by the trunks , with for . Let .
Since for each , we deduce that is a codeword of for each . Thus, is either a hollow -simplex or a solid - simplex. Since we have defined as the image of an oriented matroid code, it cannot have local obstructions. The codeword is not in ; if it were, then would contain a codeword of including without any other . No such codeword exists in . Thus must be contractible and so must be a solid -simplex; therefore, is a codeword of .
Based on the trunks defining , we know that for any codeword . By definition of , we must also have for any codeword ; however, the only codeword of which contains is . Thus, there is a codeword of containing . This implies that has a covector such that . To produce a tope satisfying the condition, take for any tope of .
Claim 2:
implies for any tope of .
The intuition here is that the last petal must intersect the convex
hull of the other petals only in the common intersection of all petals.

Let be a tope with . Such a tope must exist, since . Suppose for the sake of contradiction that there exists a tope such that
Consider a shortest path from to in the tope graph of . Each edge of the tope graph is naturally labeled by the ground set element by which the two incident topes differ. By the -convexity of intersections of half-spaces in the tope graph, each tope along this path has in its positive part, so no edge is labeled with an element of .
Thus at some point along the path from to , we must cross an edge labeled by a ground set element . Choose the first such edge labeled with ground set element . By our choice of , there exist such that , and . This means , whereas . Then , but . However, the only codeword of containing is , so we have reached a contradiction. Therefore, no such tope may exist.
By Claim 1, must have a tope which has . Because satisfies , Claim 2 implies that . Therefore, , but this implies , a contradiction. ∎
By showing that the family of codes do not lie below oriented matroids, we have given an alternate proof that these codes do not have realizations with interiors of convex polytopes. This proof is significantly different in structure than the original proof that these codes are not convex using 4.1, which is in turn proved by induction on dimension. In contrast, our proof makes no reference to rank or dimension, and does not use induction. While the codes are not open convex, they do have realizations with closed convex sets, which can even be chosen to be (non-full dimensional) closed convex polytopes. Notice that 2 establishes that if has a realization with interiors of convex polytopes, then . However, the fact that a code has a realization with closed convex polytopes does not guarantee this. Further, in showing that these codes do not lie below any oriented matroids at all, we have established that, even while these codes are good cover codes, their obstructions to convexity are somehow still topological in nature.
4.2. Representability and convexity
Having exhibited that many well-known non-convex codes do not lie below any oriented matroids at all, we now exhibit a family of non-convex codes which lie below non-representable oriented matroids. For each uniform, rank 3 affine oriented matroid , we construct a code which is convex if and only if is representable (recall a uniform oriented matroid is one in which all circuits have the same cardinality). Moreover, this code is always the image of an oriented matroid under a code morphism.
Consider a uniform, affine oriented matroid of rank 3. A pseudoline is a simple curve in , unbounded in both directions, which partitions the plane into unbounded pieces . By the topological representation theorem ([bjorner1999oriented, Section 1.3],[folkman1978oriented]), can be represented by a uniform arrangement of piecewise linear pseudolines, that is, a family of pseudolines such that each pair intersects exactly once and no more than two meet at any point. The sign vectors of this arrangement are the covectors of . An example is illustrated in Figure 6(a).
Note that the oriented matroid of a pseudoline arrangement is completely determined by the order in which each line meets all of the other lines. We can record this information as follows: Let be a pseudoline arrangement. For each pseudoline, fix one end of the pseudoline as the “head”. Let denote the index such that is the -th pseudoline we encounter as we follow from the head to the tail.
We use this order to define a code . We then use the concept of order-forcing introduced in [jeffs2020order] to prove that the code is convex if and only if is representable. Order-forcing depends on feasible walks in the codeword containment graph.
Definition 4.3.
Let be a neural code. The codeword containment graph of is the graph whose vertices are codewords of , with edges when either or . A walk in is called feasible if for all . A sequence of codewords is order-forced if every feasible walk contains that sequence as a subsequence.
Order forcing constrains the realizations of a code by forcing certain sequences of codewords to correspond to straight-line paths in all convex realizations. In any realization of a code, the atom corresponding to codeword is the region .
Theorem 4.4 ([jeffs2020order], Theorem 1.1).
Let be an order-forced sequence of codewords in a code . Let be a (closed or open) convex realization of , and let and . Then the line segment must pass through the atoms of , in this order.
Now, we construct the code so that a sequence of codewords along each pseudoline is order-forced.
Definition 4.5.
Let be a uniform, affine oriented matroid of rank 3 with pseudoline arrangement .
Without loss of generality, assume we have labeled pseudolines , with their heads in clockwise order around the outside of the plane.
An example is illustrated in Figure 6 (a).
is a code on neurons, labeled:
: | Strips corresponding to each pseudoline of . |
: | Strips corresponding to two new “boundary” pseudolines whose positive quadrant includes all pseudoline intersections. |
for all : | neurons along each to apply order-forcing. |
for all : | neurons along and to apply order-forcing. |
The codewords of are as follows:
: | Intersection of the two boundary strips. |
: | Order-forcing along each boundary strip |
(, .) | |
: | Intersection of each pseudoline with right boundary strip, with order-forcing neurons. () |
: | Intersection of final pseudoline with right boundary strip (one less order-forcing neuron is required.) |
: | Intersection of each pseudoline with left boundary strip plus order-forcing neurons. (.) |
: | Intersection of first pseudoline with left boundary strip. |
: | Order-forcing along each pseudoline |
(, ) | |
Pairwise intersections of pseudolines plus order-forcing | |
: | (, .) |
We include an example of a good cover realization of this code in Figure 6(b).

Proposition 4.6.
For any uniform, rank 3 affine oriented matroid , there exists a rank 3 oriented matroid such that .
Proof.
We describe the pseudoline arrangement associated to . Fix a piecewise-linear pseudoline arrangement representing consistent with the labeling in . Let be a line which meets in the clockwise order consistent with the labeling. Let be a line which meets and then in the opposite of this clockwise order. Orient and such that and are the half-spaces containing all bounded cells of the pseudoline arrangement. Orient each such that lies in .
Now, for each , we define a pseudoline which acts as a translation of into its positive half-space. That is, we let be a pseudoline which intersects , and each in the same order as , and such that for each other pseudoline , the intersections of and are adjacent along . Further, we ensure that do not intersect. Orient so that . Define and orient them analogously. This pseduoline arrangement is illustrated in Figure 6(c).
Finally, we produce an oriented matroid from this pseudoline arrangement by fixing a ground set element such that the set of covectors of the pseudoline arrangement is the affine space of . We claim the oriented matroid of this arrangement, , lies above . The morphism such that is defined by the the trunks
corresponding to the neurons of . We let (for each ), and be the ground set elements corresponding to and respectively. These trunks are defined as follows:
In order to define , we introduce some notation. Let
That is, is whichever of the pseudoline meets first as we follow it from its intersection with to its intersection with , and is whichever it hits second. Now, we define
Finally, we verify that the map has image . Each specifies the open set given by the intersection of the open half-spaces indexed by . By construction, the give rise to a good cover realization of .
∎
Theorem 4.
Let be a uniform, rank 3 oriented matroid. Then for , the code is convex if and only if is representable.
Proof.
First, we show that if is representable, is convex. Note that by Proposition 4.6, we have that . Also note that by construction, if is representable, then so is . Therefore, by Theorem 2, if is representable, is convex.
Next, we show that if is convex, then is representable. Note that the following sequences are order-forced in .
-
(1)
The only feasible path from to in is
-
(2)
The only feasible path from to in is
-
(3)
For each , the only feasible path from to in is
We claim if is convex, then it has a realization in the plane. Suppose that is convex, and fix a realization in . Choose points in the atoms , , and respectively. We will show that each atom in this realization has a nonempty intersection with . By order forcing (1), the line from to must pass through the atoms of all codewords containing in the listed order. Likewise, by order forcing (2), the line from to must pass through the atoms of all codewords containing in the listed order.
In particular, we have shown that for each , the atoms of and have a nonempty intersection with . For each , pick a point and a point . Applying order forcing (3) for each , we have that the line from to passes through the atoms of all codewords containing , in the listed order. This accounts for every codeword of . Thus, intersecting the open sets in with the plane produces a two-dimensional convex realization of .
Now, we obtain a straight line arrangement for in this plane by extending the line segment from to to be a line. By uniformity of and our choice of bounding lines, every pair of pseudolines intersects in and so no new intersections are introduced. Notice that by order forcing (3), this line meets the sets in the order consistent with the pseudoline arrangement. Thus, if this code is convex, is representable. ∎
Proposition 4 demonstrates that matroid representability and convex code realizability are intertwined. One consequence is that non-representable oriented matroids are a new source for constructing non-realizable codes:
Corollary 4.7.
There is an infinite family of non-convex codes which lie below oriented matroids in .
Proof.
Example 4.8.
Let be the uniform non-Pappus matroid from [shor1991stretchability], whose pseudoline arrangement appears in Figure 7. This matroid is non-representable, since a realization of it would violate Pappus’s hexagon theorem. Then is a non-convex code with no local obstructions.

.
4.3. The convex code decision problem is NP-hard
We now turn to the computational aspects of convex codes. Using the relationship between convex codes and representable oriented matroids (Theorem 3), we demonstrate the convex code decision problem is NP-hard and -hard, though it remains open whether the convex code decision problem lies in either of these classes, or is even decidable. The complexity class , read as the existential theory of the reals, is the class of decision problems of the form
where is a quantifier-free formula whose atomic formulas are polynomial equations, inequations, and inequalities in the . In other words, a problem in defines a semialgebraic set over the real numbers and asks whether or not it contains any points [broglia2011lectures]. Many well known problems in computational geometry lie in , including some problems very similar to determining whether a code is convex. For instance, determining whether a graph is the intersection graph of convex sets in the plane is complete [schaefer2009complexity].
Theorem 3 implies the convex code decision problem is at least as difficult as deciding if an oriented matroid is representable. This decision problem is -complete [mnev1988universality, shor1991stretchability, sturmfels1987decidability, richter1999universality]: given any decision problem in , there is a polynomial time algorithm to produce an oriented matroid (presented in terms of covectors) which is realizable if and only if the decision problem has a positive answer. Therefore the convex code decision problem is -hard.
Theorem 5.
Any problem in can be reduced in polynomial time to the problem of determining whether a neural code is convex.
Proof.
By the Mnëv-Sturmfels universality theorem (see [mnev1988universality, sturmfels1987decidability, shor1991stretchability, bjorner1999oriented, richter1999universality]), determining whether a rank 3 uniform oriented matroid (presented in terms of covectors) is representable is complete for the existential theory of the reals. By Proposition 4, a rank 3 uniform oriented matroid is representable if and only if is a convex neural code. Further, the number of neurons in is quadratic in the size of the ground set of , and the number of codewords of is less than the number of covectors of . Finally, we can construct from the covectors of in polynomial time. Any problem in can be reduced in polynomial time to deciding representability of a uniform oriented matroid and thus convexity of the corresponding code. ∎
Since any complete problem is also -hard, we have as a corollary that determining whether a code is convex is -hard.
Corollary 4.9.
The problem of determining whether a code is convex is -hard, where the problem size is measured in the number of codewords.
Notice that because we can perform this reduction of a problem in to a neural code in polynomial time, this result holds even when we measure the problem size in terms of the number of codewords, which may be exponentially large in the number of neurons. Again, this NP hardness result is not surprising. For instance, it parallels the result that recognizing whether a simplicial complex is the nerve of convex sets in is -hard for [tancer2010d].
5. Categories of codes, matroids, and rings
5.1. The Neural Ring
To set the stage for the functorial connections between combinatorial codes and oriented matroids, we begin with a brief discussion of the functor defined in [jeffs2019morphisms], and its relation to the combinatorial relations of a code, introduced in [curto2013neural]. Recall that the neural ring of a code is , where is the vanishing ideal of as a variety in . This is the ring of -valued functions on with distinguished coordinate functions , that is, iff . The category is the category of neural rings together with monomial maps, ring homomorphisms which map the coordinate functions of either to products of coordinate functions in or to . By restricting to this class of homomorphisms, the functor which takes a code to its neural ring is a contravariant equivalence of categories [jeffs2019morphisms, Theorem 1.6]. For a morphism of codes defined by trunks for , the ring homomorphism sends the coordinate function in to the product in .
The pseudo-monomials in provide a dual description of . They record the dependencies among the elements of , or, equivalently, among the sets in any realization of . If , then [curto2013neural, Lemma 4.2] implies:
(1) |
Containment relationships as in the right hand side of (1) are called the combinatorial relations of . As a generating set for , the minimal pseudo-monomials, i.e. the minimal combinatorial relations, are sufficient to recover the code . The minimal proper pseudo-monomials in are called the canonical form of [curto2013neural]. The following lemma shows that the structure of a pseudo-monomial ideal encodes the weak elimination axiom (axiom (C4)) of oriented matroid circuits.
Lemma 5.1.
Let be a combinatorial code. Denoting pseudo-monomials as sets , the minimal relations of satisfy circuit axiom (C4) (weak elimination).
Proof.
Suppose and are minimal in , with . Then
Thus, some minimal pseudo-monomial in divides , i.e. and , which is exactly circuit axiom (C4). ∎
Note that, while the proper circuits of an oriented matroid satisfy axiom (C4), we must include improper pseudo-monomials of the form in order for the generators of to satisfy (C4). While elements of the canonical form are minimal combinatorial relations, they do not satisfy axiom (C3) (incomparability). Combinatorial relations on the same support need not be equal or opposite: for instance, the combinatorial relations of the code are , and , which are all supported on the set .
The relationship between pseudo-monomials in and codewords in is analogous to the relationship between circuits and topes. In light of 5.1, the oriented matroid analogue of maps an oriented matroid to an ideal generated by the circuits of and then the depolarization map is simply the algebraic analogue of . As we will see, most of the work involved in establishing these connections is in showing and are functors.
5.2. Oriented matroids to neural codes
We now show that the map is a contravariant functor from the category whose objects are acyclic oriented matroids and whose morphisms are strong maps, to the category whose objects are neural codes and whose objects are code morphisms.
We define strong maps in terms of convexity following [hochstattler1999linear]. First, we include the requisite information on convexity for oriented matroids.
Definition 5.2.
A subset is convex in if for all , there is no circuit such that . The convex closure of a set is the intersection of all convex sets that contain .
Remark 5.3.
This definition differs from [bjorner1999oriented, Exercise 3.9, p 152] in that it acts on subsets of rather than . The intuition behind this definition comes from vector arrangements. A signed-linear dependence on gives a signed-linear representation of in terms of : just add to both sides of the equation. This can be rescaled to a convex combination of elements in ; therefore, should be in the convex closure.
We now define strong maps:
Definition 5.4.
Let be a pair of oriented matroids on ground sets and such that . Extend to a map on the signed ground sets by , where . We say that induces a strong map if whenever is a convex set of , is a convex set of .
Remark 5.5.
We briefly explain the loops in the definition of strong maps. We want the function on sets to be well-defined while still allowing some elements to “disappear,” so we add in the target to absorb the disappearing elements. Since strong maps between matroids on the same ground set have certain duality properties, we include in the source as well.
The following lemma gives us an equivalent definition of convexity in terms of topes. We will make use of a corollary (5.7) along the way to proving is a functor.
Lemma 5.6.
A subset is convex if and only if for all and containing no signed circuits, there exists a tope such that .
Proof.
Assume that for all and containing no signed circuits, there is a tope with .
Suppose that is not convex, by way of contradiction. Then there exists some for which there is a circuit with . But, is a subset of containing no signed circuits (by axiom (C3)), and if any tope contained , that would contradict tope-circuit orthogonality.
For the reverse implication, we prove the contrapositive using the four-painting axioms [bjorner1999oriented, Theorem 3.4.4 (4P)]. Suppose that there is some set containing no signed circuits and an element such that is not contained in any tope. Paint the ground set to be black and white coincident with , and to be red on the remaining elements. By the four-painting axioms, there must be a circuit supported on the elements of ; this proves that is not convex. ∎
Corollary 5.7.
Every tope of a loopless matroid is convex.
Proof.
Let be a tope. By tope-circuit orthogonality, there is no circuit contained in . Consider . Since topes have full support, implies . This means that for any , the set , which is a tope. Therefore is convex. ∎
Now we define the contravariant functor . We restate the map on objects and add the action on morphisms.
Definition 5.8.
Let be an acyclic oriented matroid. Take to be the code consisting of the positive parts of topes of ,
Let be a strong map with associated set map . Then, take , to be the map on codewords .
In order to prove that is a functor, we must prove that is actually a well-defined function with the desired domain. At this point, acyclicity becomes necessary.
Example 5.9.
Consider the matroid on ground set defined by the columns of the matrix
The topes of are . Let be the rank-1 matroid on one element obtained by contracting the first two columns of . That is, is the oriented matroid on ground set with topes . The contraction is the strong map induced by the set map , .
Passing to , we have and . For the functor to work, we would need to be the positive part of some tope, but there is no such tope. By demanding that the matroids are acyclic we avoid this problem. Acyclic oriented matroids are also loopless, so topes of acyclic oriented matroids have full support.
Proposition 5.10.
Let and be acyclic oriented matroids on and respectively, and a strong map induced by . If is a tope, there is a tope such that .
Proof.
Since both matroids are loopless, topes of each have full support on their ground sets. By 5.7, is convex, and since is a strong map, we conclude that is convex. We claim that omitting the positive-signed elements of to obtain retains convexity.
If not, then by nonconvexity of , there is , such that is in some circuit contained in . Thus, would be an element in the convex closure of but not in itself, rendering nonconvex. Because has full support, this means , implying . Because is acyclic, must have at least one element . But this implies that should be in the convex closure of , contradicting convexity.
Finally, by 5.7, we note that a maximal signed convex set must be a tope, indicating that is a tope satisfying our constraints. ∎
Thus, Proposition 5.10 confirms that the map of codes has the desired domain, so it is well-defined as a map of sets. We need to confirm that this set map is also a morphism of codes (i.e. the preimage of a trunk is a trunk).
Proposition 5.11.
For a strong map of acyclic oriented matroids , the map of neural codes given by is a morphism of codes.
Proof.
Let for . It is sufficient to check that the preimage of a simple trunk (i.e. the trunk of a singleton set) is a trunk. Thus, we compute . Let , so . By our definition of , this is equivalent to the condition . By the definition of a trunk, this is equivalent to , or . Thus, if and only if . Therefore
Thus, the map is a morphism of neural codes. ∎
To finish off the proof that is a functor, we need only check that it respects the identity morphism and composition of morphisms.
Proposition 5.12.
The identity strong map on a matroid yields the identity on the corresponding code.
Given two strong maps and , the morphisms and from are equal.
Proof.
Based on Proposition 5.10, the map of codes is well-defined. The composition of strong maps is defined by . Then
Thus respects composition of morphisms. Next, we check that
thus respects the identity morphism. Therefore, is a functor. ∎
Proposition 5.13.
The map is a faithful, but not full, contravariant functor from the category of acyclic oriented matroids with strong maps to the category of neural codes with code morphisms.
Since we have already proven that the map of categories is indeed a functor, we only need to prove that the functor is faithful but not full to complete the proof of Proposition 5.13.
Proof.
For a given strong map , it is easy to read out the map on ground sets from the values of . Because the set map uniquely determines the strong map, the functor is faithful – that is, it is injective on morphisms.
To show that not all morphisms of codes arise from strong maps of oriented matroids we produce the following example:
Take the morphism , where
and the morphism is defined by trunks and . See Figure 8 for realizations of these codes. By construction, is a morphism of neural codes. Both codes are hyperplane codes, thus they arise from oriented matroids and . However, the map does not arise from any strong map. To see this, notice that the proof of Proposition 5.11 actually proves that the preimage of a simple trunk is a simple trunk for any morphism arising from a strong map. However, by construction, , which is not a simple trunk.
This proves that the functor is not full. ∎

5.3. Oriented matroids to rings
We now describe the oriented matroid ring and show that the map taking an oriented matroid to its associated ring is a functor. The key ingredient for doing this is the oriented matroid ideal introduced in [novik2002syzygies]. As defined in that paper, the oriented matroid ideal is associated to affine oriented matroids; in other words, oriented matroids with a distinguished element. We alter their definition to avoid the need for a distinguished element, and show that the affine oriented matroid ideal can be constructed algebraically from the oriented matroid ideal. Finally, we define the oriented matroid ring as the quotient by the Alexander dual ideal. We define the functor which takes an oriented matroid to its oriented matroid ring and describe its image, which we take as our category .
Fix a field . We will consider polynomial rings over with variables indexed by the ground set of an oriented matroid; when the indexing set is apparent, we will denote these as or . The affine oriented matroid ideal is defined in [novik2002syzygies] (under the name “oriented matroid ideal”) with an equivalent description from their Proposition 2.8 as follows:
Definition 5.14.
Let be an affine oriented matroid with .
(Covectors) For every sign vector , associate a monomial
The affine oriented matroid ideal is the ideal in
generated by all
monomials corresponding to covectors .
(Circuits) The minimal prime decomposition of the affine oriented matroid ideal is
,
where is the ideal generated by variables , ,
and the intersection is over all circuits such that .
We define the oriented matroid ideal in terms of generators, and show that it also has this dual description in terms of minimal primes.
Definition 5.15.
Let be a loopless oriented matroid. Let the oriented matroid ideal denote the ideal generated as
Remark 5.16.
This definition can be extended in a straightforward way to matroids with loops, but “topes” would be replaced with “complements of covectors.” Note that the minimal complements of covectors in loopless matroids are indeed the topes.
Proposition 5.17.
Let be a loopless oriented matroid. The minimal prime decomposition of is given by , where is the ideal generated by variables , and the intersection is over all (proper and improper) circuits .
Proof.
Note that is a monomial ideal, as is the intersection of the monomial ideals . Therefore, it is sufficient to check that the sets of monomials in the two ideals are identical.
First, consider for . We will show that for all . For each element , exactly one of or is in every tope , so ; this covers improper circuits of the form . For every proper circuit , both and are non-empty by tope-circuit orthogonality. In this case, there exists (resp, ) such that (); this means that for which implies . Since for all types of circuits, it is also in the intersection.
In the reverse direction, we show that for any monomial in , there is a tope such that . For all elements , either or ; so there exist disjoint sets such that and
We claim that is a tope of . It is enough to show that every circuit is orthogonal to . The fact that and means that both and are nonempty, implying orthogonality. ∎
The affine oriented matroid ideal can be obtained from the oriented matroid ideal using the following construction.
Proposition 5.18.
The affine oriented matroid ideal can be obtained via the following ideal quotient and specialization
Proof.
By 5.14,
Ideal quotients commute with intersection, so we can apply the quotient to each component. The first component becomes the ideal quotient of by itself, which is the full ring. After specializing , the second component is also the full ring. Turning to the third component, we need to prove that .
A monomial is in the quotient if and only if for all where , either or there exists covector with such that . Suppose . Then since is defined on the deletion by ; this implies that . Suppose instead that . This implies that there is a covector of with such that . By [bjorner1999oriented, Prop 3.8.2 (b)], this implies that the support of is a covector of the matroid. Since , the support of must include , implying that its support is a covector of with . This implies . We conclude that . Specializing leaves us with . ∎
One more step is needed to make the functor work. The oriented matroid ideal is a square-free monomial ideal; we take its Alexander dual (see e.g. [miller2004combinatorial, Definition 1.35]) to obtain . This takes the oriented matroid ideal and swaps the role of topes and circuits; i.e. irreducible components now correspond to topes, and monomial generators to circuits. Let be a tope and let . Then, for acyclic oriented matroids,
(2) |
The oriented matroid ring is then the quotient ring .
Proposition 5.19.
Let be defined as above.
Let be an oriented matroid and be a strong map of matroids with associated set map .
Define . Define by
We refer to the ring as an oriented matroid ring and the map as a strong monomial map. Then, is a covariant functor from to .
Proof.
We need to prove that this map defines a ring homomorphism, respects the identity morphism, and respects composition of morphisms.
We begin by checking that the map is a ring homomorphism. Since it is defined as a map on generators, defines a ring homomorphism We need to check that this map respects the quotient structure. That is, we must show that if , then .
Since is a monomial ideal, it is sufficient to check this for monomials If (or ) for some (), then . Next, we consider the case when for all . Because is a monomial ideal, implies that divides for some generator .
If is not a signed set, then it contains an improper circuit of the form , so is divided by , so as desired. Thus, suppose that is a signed set. We show that contains a circuit. Let . We will show that is in the convex closure of ; this implies that there is a circuit of such that
which is what we need. Suppose that is not in the convex closure of . Then there is some convex set such that , . By the definition of a strong map, must be convex. However, , and
contradicting convexity of . We conclude that is in the convex hull of . Thus, there is a circuit of such that , so divides .
To see that respects the identity morphism, note that if for each , then and , so is the identity on . Now, let and be strong maps. First, suppose neither nor . Without loss of generality, we check that composition of morphisms is respected on the . Then . Now, if either or , then . Thus the map respects composition of morphisms. ∎
We define the category to be the category whose objects are oriented matroid rings with distinguished generators . The morphisms of are the strong monomial maps , where is a strong map of oriented matroids.
5.4. Oriented matroid rings to neural rings and back
The final piece of the puzzle is describe the relationship between and the category of neural rings . Note that neural rings are defined over , thus we take all rings in this section to be over . The vanishing ideal of a code is a pseudo-monomial ideal, meaning it has a pseudo-monomial generating set. Polarization of a pseudo-monomial ideal, introduced in [gunturkun2017polarization], produces a true monomial ideal which encodes the same combinatorial information. As is not a full functor and is an equivalence of categories, there is no reason to expect polarization to be a functor. Instead, we will use the operation of depolarization to define the functor so that , i.e. the diagram below commutes.
(3) |
Definition 5.20.
Let be an oriented matroid ring. Define to be the ring with distinguished coordinate functions .
If is a morphism in with underlying set map , then define to be the map sending if and otherwise.
Proposition 5.21.
The map is a functor to .
Proof.
We first show maps an oriented matroid ring to a neural ring. Denote and . Let denote the ideal with the same generators as , but considered as an ideal of , i.e. , and let . We apply standard isomorphism theorems to conclude
Observe that under the map . Under this same map, , so is a pseudo-monomial ideal; since for all , we have for all and therefore is the vanishing ideal of a combinatorial code.
Next we check that if is a strong monomial map, then is a monomial map of neural rings. By definition, induces a monomial map , sending each to some or 0 as appropriate. So, we only need to check this is a well-defined ring homomorphism. This follows from properties of polarization: if and only if [gunturkun2017polarization]. Therefore,
Thus, is a well-defined monomial map.
To complete the proof is a functor, we need to show respects the identity and composition of morphisms. These are immediate from the definitions: and . ∎
Proposition 5.22.
The diagram (3) commutes.
Proof.
We will show that:
-
(1)
for any acyclic oriented matroid ,
-
(2)
for a strong map of acyclic oriented matroids ,
(1) We prove the first part by showing that the ring of functions on is precisely the ring . We do this by showing that they are both quotients of by the same ideal. For a tope , denote , i.e. the image of under the map (recall Eq. 2). Then we have
Now consider . For each tope , let , the maximal ideal of vanishing at codeword . As the vanishing ideal of a finite variety, we have
By construction, . By symmetry (axiom (V2)), is a tope if and only if is a tope. Therefore, the ideals are defined by the same intersection and therefore the corresponding quotients are identical.
(2) Now we prove that strong maps point to the same monomial map via and . It is sufficient to check the action of each monomial map on generators of .
A strong map is defined by a set map satisfying convex implies convex. The strong monomial map sends to if and otherwise; it acts similarly on . Applying , the monomial map still sends to if and otherwise.
Going around the diagram the other way, sends a codeword to . The functor sends a morphism of codes to the ring homomorphism given by sending to its precomposition with , i.e. . Starting with a strong map , let us consider the action of on generators of :
This function takes as input a codeword . If , then it takes the value , and if then it takes the value . If , then the function is identically zero. If , then is equal to , proving that the monomial maps and are the same. ∎
5 (proven by Propositions 5.13, 5.19, 5.21 and 5.22) gives us a new lens to see the neural ideal. In essence, neural codes can be seen as a relaxation of oriented matroids. The neural ideal is a generalization of the oriented matroid ideal to the less constrained category of neural codes. Further, Propositions 5.21 and 5.22 demonstrates that the duality between a neural code and its combinatorial relations is analogous to the duality between topes and circuits. In particular, in the special case when a neural code arises from an oriented matroid, the codewords correspond to topes and the elements of the canonical form correspond to circuits. 5.1, which states that the elements of the canonical form partially follow the circuit axioms, strengthens this analogy.
6. Open questions
The preceding sections have presented our case for employing oriented matroid theory in the study of neural codes. However, we stand at the very beginning of exploring this connection. In this section, we outline some directions for future work.
6.1. Is the missing axiom of convex neural codes also lost forever?
Oriented matroids capture much of combinatorial structure of hyperplane arrangements in a few axioms. Is it possible to give a similar characterization for convex neural codes, or at least for codes which lie below oriented matroids in ? While general neural codes are not required to satisfy any axioms, the codes below oriented matroids may be more tractable to combinatorial description.
Question 6.1.
Can the class of neural codes below oriented matroids be characterized by a set of combinatorial axioms?
The functorial view we introduced in Section 5 may be helpful in finding this characterization. If this question is answered in the affirmative, then these codes can be thought of as “partial oriented matroids.” Suppose that is a code and is an oriented matroid on ground set such that ; then, we obtain constraints on the set of covectors of . Each included codeword implies existence of a preimage covector in , and each excluded codeword implies a set of forbidden covectors which may not be in . The oriented matroids satisfying these constraints can then be said to be “completions” of the partial oriented matroid.
Just as we wish to characterize codes lying below oriented matroids with a set of combinatorial axioms, we might also wish to characterize convex codes using a set of combinatorial axioms. However, this is likely not possible. In [mayhew2018yes], Mayhew, Newman, and Whittle show that “the missing axiom of matroid theory is lost forever.” Slightly more formally, they show that there is no sentence characterizing representability in the monadic second order language , which is strong enough to state the standard matroid axioms. Roughly, this means that there is no “combinatorial” characterization of representability, or no characterization of representability in the language of the other matroid axioms.
Because we have found strong connections between representability and convexity, it is natural to ask whether a similar statement can be proven for convex codes.
Question 6.2.
Is there a natural language in which we can state “combinatorial” properties of neural codes, in analogy with the for matroids? If so, is it possible to characterize convexity in this language?
6.2. Computational questions
While we have shown that the convex code decision problem is -hard, we have not actually shown that the convex code decision problem lies in , or is even algorithmically decidable. A similar problem, that of determining whether a code has a good cover realization, is undecidable by [chen2019neural, Theorem 4.5]. Here, the distinction between codes with good cover realizations and convex realizations may be significant. For instance, while there is an algorithm to decide whether, for any given , a simplicial complex is the nerve of convex open subsets of , for each , it is algorithmically undecidable whether a simplicial complex is the nerve of a good cover in [tancer2013nerves].
We outline a possible path towards resolving [chen2019neural, Question 4.5], which asks whether there is an algorithm which decides whether a code is convex. Our approach hinges on 2: a code is polytope convex if and only if it lies below a representable oriented matroid. A first step towards solving the convex code decision problem is answering the following open question:
Question 6.3.
Can every convex code be realized with convex polytopes?
In dimension two, this question has an affirmative answer, as a result, the class of planar convex codes is decidable [bukh2022planar]. If this holds in all dimensions, then our Theorem 2 becomes strengthened to the following:
Conjecture.
A code is convex if and only if for a representable oriented matroid.
If this conjecture holds, then we can replace the problem of determining whether a code is convex with the problem of determining whether a code lies below a representable matroid. We only need to consider the set of minor-minimal matroids lying above the code, and check these matroids for representability.
Question 6.4.
Given a code , is the set of minor-minimal matroids above finite? If so, is there an efficient algorithm to enumerate them?
One way to find oriented matroids above a code is to travel step-by-step up the poset . While there is a straightforward algorithm to enumerate the codes which are covered by a code in [jeffs2019sunflowers], we do not know of a straightforward way to characterize the codes which cover . If we can characterize these codes as well, we may be able to find a way to “climb up” towards an oriented matroid. Alternatively, we can use the “partial oriented matroid” perspective described above to obtain a set of constraints that must be obeyed by any oriented matroid above this code. Then we can look for a matroid satisfying these constraints.
Both of these approaches depend on the minimal size of the ground set of oriented matroids that lie above in . Let
be the smallest such that any code on neurons which lies below an oriented matroid lies below an oriented matroid with ground set of size at most . Similarly, let
be the smallest such that any code on neurons below a representable oriented matroid lies below a representable oriented matroid with ground set of size at most . Clearly, , since any representable matroid is a matroid.
Question 6.5.
Describe the growth of and as functions of . Are they equal?
Note that if is a computable function of , and Question 6.3 is answered in the affirmative, then the convex code decision problem is decidable.
6.3. Other questions in geometric combinatorics
Many classic theorems about convex sets, such as Helly’s theorem, Radon’s theorem, and Caratheodory’s theorem, have oriented matroid analogues. In some way, we can view our Theorem 2 as an oriented matroid version of Jeffs’ sunflower theorem [jeffs2019sunflowers, Theorem 1.1]. The fact that the non-convex codes constructed from the sunflower theorem do not lie below oriented matroids shows us that there is some fact about oriented matroids underlying the sunflower theorem.
Question 6.6.
Is there a natural oriented matroid version of Jeffs’ sunflower theorem?
Proposition 3.3 stated that if is an oriented matroid, the code has no local obstructions. That is, for any , is contractible. This result can also be found in [edelman2002convex], where is is phrased as a result about the simplicial complex . Something stronger holds for representable oriented matroids: by [chen2019neural, Theorem 5.10], if is a representable oriented matroid, and , then must be collapsible. Expanding upon this work, [jeffs2019convex] gives stronger conditions that the link of a missing codeword in a convex code must satisfy.
We ask whether this holds for all oriented matroids:
Question 6.7.
If is an oriented matroid, and , is collapsible? More generally, which simplicial complexes can arise as for ?
If not, then the non-collapsibility of gives a new “signature” of non-representability.
6.4. Functorial questions
The maps and established analogies between structures of oriented matroids and neural codes. Topes and covectors are translated into the codewords, and signed circuits are mapped to the combinatorial relations. This leads us to the following natural question:
Question 6.8.
Do and map other matroid features to meaningful structures associated to neural codes? In particular, do the chirotope, rank function, and convex closure function have a natural interpretation when mapped to general neural codes?
This paper focused on the category of oriented matroids, since they have a well-established notion of morphisms (strong maps) and since they are extensively studied. However, there is also a notion of “affine strong maps” defined in [hochstattler1999linear] that may serve to turn affine oriented matroids into a category. This might also admit a natural functor to neural codes. Additionally, the recently defined objects COM’s (which stands for both conditional oriented matroids and complexes of oriented matroids) [bandelt2018coms] are a natural place to try to extend strong maps next.
Question 6.9.
Can affine oriented matroids with affine strong maps be embedded in ? Can strong maps be defined for COM’s in such a way that the resulting category can be embedded in ?
While strong maps are more frequently used as morphisms of oriented matroids, weak maps are the next best option.
Question 6.10.
Can the category of oriented matroids with morphisms given by weak maps be embedded in ?
Acknowledgements
The authors thank Carina Curto, Emanuele Delucchi, Boaz Haberman, Gregory Henselman-Petrusek, Vladimir Itskov, R. Amzi Jeffs, Anne Shiu, Bernd Sturmfels, and Nora Youngs for helpful conversations. We remark that Henselman-Petrusek developed connections between neural codes and oriented matroids independently, and we look forward to his upcoming article on the topic. They also extend deep gratitude to Anne Shiu, R. Amzi Jeffs, and Carina Curto for their comments on an early draft. Further, they also thank Laura Anderson for heroic efforts to fix the proof of an earlier version of Proposition 4. They also appreciate the thorough reviews by anonymous referees which contributed significantly to readability and accuracy of the results. CL was supported by NSF fellowship grant DGE1255832. ABK was supported by an NLM Training Program fellowship T15LM007093