Open, Closed, and Non-Degenerate Embedding Dimensions of Neural Codes

We study the open, closed, and non-degenerate embedding dimensions of neural codes, which are the smallest respective dimensions in which one can find a realization of a code consisting of convex sets that are open, closed, or non-degenerate in a sense defined by Cruz, Giusti, Itskov, and Kronholm. For a given code $\mathcal C$ we define the embedding dimension vector to be the triple $(a,b,c)$ consisting of these embedding dimensions. Existing results guarantee that $\max\{a,b\} \le c$, and we show that when any of these dimensions is at least 2 this is the only restriction on such vectors. Specifically, for every triple $(a,b,c)$ with $2\le \min \{a,b\}$ and $\max\{a,b\}\le c$ we construct a code $\mathcal C_{(a,b,c)}$ whose embedding dimension vector is exactly $(a,b,c)$. Our constructions combine two existing tools in the convex neural codes literature: sunflowers of convex open sets, and rigid structures, the latter of which was recently defined in work of Chan, Johnston, Lent, Ruys de Perez, and Shiu. Our constructions provide the first examples of codes whose closed embedding dimension is larger than their open embedding dimension, but still finite.


Introduction
In 2013 Curto, Itskov, Veliz-Cuba, and Youngs [6] initiated the study of convex neural codes, which are the combinatorial codes C ⊆ 2 [n] that record the intersection and covering relations among n convex open sets in Euclidean space (see Definition 1.2 below).Their motivation arose from neuroscience, namely the study of place cells, which are hippocampal neurons that fire when an animal is in a particular region of its environment.Place cells can be thought of as encoding a cognitive map of the animal's environment (see [19]), and the study of convex neural codes seeks to understand how well this cognitive map can capture the geometry and topology of the environment.
Mathematical research on convex codes has blossomed since 2013.An efficient characterization of convex codes is unfortunately out of the question-recent work in [17] shows that recognizing convex codes is ∃R-hard.Nevertheless, researchers have used techniques from algebra [5,8,10], discrete geometry [1,3,11,16,18], and topology [2,4] to analyze many interesting families of codes and develop frameworks in which to test whether or not a code is convex.Some works also study codes that arise from "good covers" [2,4], collections of closed convex sets [3,9], and "non-degenerate" collections of convex sets [1,3].
Let us begin by recalling some fundamental definitions.Our combinatorial objects of study are codes, which are just subsets of the power set 2 [n] , where [n] := {1, 2, . . ., n}.Definition 1.1.A collection C ⊆ 2 [n] is called a code.The elements of C are called codewords.If C ⊆ 2 σ for some σ ⊆ [n], we say that σ is a base set for C.
We will adopt the convention that ∅ is a codeword in every code, which is typical in the study of convex neural codes.Codes can be used to record information about how sets in a collection intersect and cover one another, as follows.
where the empty-indexed intersection is equal to R d by convention.We say that U is a realization of code(U).
In words, we obtain code(U) by labeling every point p ∈ R d by the indices i ∈ [n] for which p ∈ U i , and then collecting all the labels obtained in this way.If U consists of convex open sets we say that U is a convex open realization of code(U).We may similarly define convex closed realizations, and we typically use the notation X = {X 1 , . . ., X n } for collections of closed convex sets.Every realization in this paper will consist of convex sets, so we will usually drop the adjective "convex."Note that our convention that ∅ is always a codeword amounts to the requirement that a realization U does not cover R d -in particular, by intersecting with a sufficiently large closed or open ball we may assume all of our realizations are bounded.
Figure 1 shows an open realization U = {U 1 , U 2 , U 3 , U 4 } of C in R 2 .One could also regard this figure as an illustration of a closed realization: replacing each set by its closure does not change the realized code.Remark 1.4.We will always illustrate open convex sets with a solid border.To avoid confusing these illustrations with closed convex sets, our captions will always specify whether we are regarding the illustrated sets as closed or open.
In Example 1.3, it was convenient that we could regard our realization as either closed or open without changing the realized code.This is not always the case-for example, in an open realization we may have disjoint sets which share boundary points, so that replacing them by their closures changes the code that they realize.In fact, this may be the case in every open realization of a code: [3] gives an example of a code in which every open realization is forced to include disjoint sets that share boundary points.Motivated by this difficulty, [3] introduced a notion of non-degeneracy for realizations, which places technical geometric and topological criteria on a realization in such a way that replacing sets by their interiors or closures preserves the realized code.Recently, [1] proved that non-degenerate realizations are exactly those for which replacing sets by interiors or closures does not affect the realized code-we will take this as the definition of non-degeneracy.
It is of particular interest to determine the smallest dimension in which a code has an open, closed, or non-degenerate realization.These minimum dimensions are referred to as embedding dimensions of a code.Above, the minimum over the empty set is equal to ∞ by convention.The embedding dimension vector of C is the 3-tuple odim(C), cdim(C), nddim(C) .
For a fixed code C ⊆ 2 [n] , what can we say about the embedding dimensions of C and their relationships to one another?Determining these dimensions exactly is often an infeasible task, but it is possible in some specific cases, and sometimes one may obtain general bounds that are interesting even if they are not exact.For example, when C is intersection complete (i.e. the intersection of any two codewords is again a codeword), [3] showed that nddim(C) ≤ max{2, m} where m + 1 is the number of inclusion-maximal codewords in C, and [13] showed that cdim(C) ≤ 2d + 1 if every codeword has size d + 1 or less.
As a very basic start, every non-degenerate realization can be regarded as a closed or open realization, so we have the following: Proposition 1.7.If C has embedding dimension vector (a, b, c), then max{a, b} ≤ c.
It is natural to ask whether we can guarantee stricter relationships between the various embedding dimensions of a code.As we will see in Theorem 1.9, the answer in general is "no."However, in some special cases, the answer is yes.For example, if C is a simplicial complex then cdim(C) = odim(C) = nddim(C) (see [13,Theorem 1.4]).If C is intersection complete, then cdim(C) ≤ odim(C) = nddim(C) (see [14,Lemma 2.2.4

and Theorem 2.2.7]).
One final special case is when any of the embedding dimensions is equal to 1.In this case, all embedding dimensions must be equal to 1.This fact was first posed as a conjecture in [1,Conjecture 3.4], and we prove it below using ideas based on discussions with the authors.Theorem 1.8.Let C be a code.Then the following are equivalent: Proof.We claim that such a realization is necessarily non-degenerate.Observe that if some codeword c arises at a point p, then the same codeword arises at every point in a small closed interval with one of its endpoints equal to p. Thus replacing our intervals by their interiors or closures does not change the realized code, and the realization is non-degenerate.□ Beyond the 1-dimensional case, the only relationship that we can guarantee between embedding dimensions is that the open and closed embedding dimensions are no larger than the non-degenerate embedding dimension.The following theorem captures this fact formally.Theorem 1.9.Let 2 ≤ a, b, c ≤ ∞ and suppose that max{a, b} ≤ c.Then there exists a code C (a,b,c) with embedding dimension vector (a, b, c).
Rather than construct all C (a,b,c) directly, we will reduce to three cases, from which one can build any C (a,b,c) .For this reduction, we observe that any two codes C and D may be relabeled so that they have disjoint base sets, and then combined to yield a code whose embedding dimension vector is the component-wise maximum of the original embedding dimension vectors.Our constructions primarily make use of two existing tools.First, in [13,11] we studied "sunflowers" of convex open sets, obtaining examples of codes with large open embedding dimension and small closed embedding dimension.Second, Chan, Johnston, Lent, Ruys de Perez, and Shiu introduced "rigid structures" in [1].Their results guarantee that sets in a closed realization must have a union which is convex under certain conditions-and importantly, their results do not hold for open realizations.
Informally, sunflowers guarantee structure in open (but not closed) realizations, while rigid structures provide the opposite.By combining these tools in various ways we are able to obtain all the desired codes C (a,b,c) .In the interest of concision, we do not explain sunflowers or rigid structures in full generality.Instead, we state versions of these results that suffice in our context, and provide citations for a more general presentation.

Constructing the Codes
We begin by constructing the codes C (d,2,d) for all finite d.In fact, there is an existing family in the convex codes literature that suffices: sunflower codes.We first introduced and studied these codes in [13,Definition 5.3], where we were primarily concerned with their open embedding dimensions.Below we review the definition of these codes, illustrate a few small examples, and provide citations for the results implying that they have the appropriate embedding dimension vector.Definition 2.1 (See also [13] and [14]).For 2 ≤ d < ∞, define S d ⊆ 2 [d+1] to be the code consisting of the following codewords: [d], all singleton sets, all pairs {i, d + 1} for i ∈ [d], and the empty set.
The code S d has two salient geometric features.First, in any realization the first d sets must form a "sunflower" in the sense that their various pairwise intersections must be the same, and must be nonempty.Second, the (d + 1)-st set intersects all the other sets, but not their common intersection.It turns out that such an arrangement is only possible to achieve with convex open sets in dimension at least d.For a full discussion of this fact, see [13,Section 5].Below we illustrate a few of these codes to provide intuition.We conclude this section by formally observing that S d has the desired embedding dimension vector (d, 2, d).We provide several citations rather than a detailed proof since the results characterizing the embedding dimensions of S d are already established.
Proof.The results [14, Theorem 5.2.2 and Proposition 5.The code C (2,d,d) will have a base set of size 4d.Rather than simply use the integers {1, 2, . . ., 4d}, we use four types of labeled symbol, with d-many of each.Below, we let where each α i is a formal symbol in our base set.For any σ ⊆ [d], we let α σ = {α i | i ∈ σ}, and in specific examples we will sometimes omit braces on σ-so for example, This notation has two distinct advantages.First, it streamlines the indexing in the results below, so that we need not deal with cumbersome offset factors in our base set indices.Second, it highlights that each type of base set element plays a different role in the code.Before commenting on these various roles, we provide a formal definition.
Informally, the base set elements and codewords above each play the following roles.The various α i are defined so that the various U α i in any realization of C (2,d,d) form a sunflowerrecall the commentary following Definition 2.1-thanks to the codewords of type (vi) and (vii).The codewords of types (i)-(iv) guarantee that the various β i and δ i form a "rigid structure" as defined in [1]-this means that the union of all X β i and X γ i in a closed realization must be convex (see Lemma 3.6 below).Moreover, the codewords of type (v) force this rigid structure to intersect the various sunflower petals U α i .Finally, the various δ i have essentially the same behavior as the α i , with the exception of the codeword (viii), which ties the structure of C (2,d,d) In words, U α i is P plus the i-th flap, while U δ i is P plus the i-th flap and the (d + 1)-st flap.Observe that the nonempty codewords arising in this arrangement are exactly those of types (vi), (vii), and (viii) in Definition 3.1.Indeed, the codeword {α i , δ i } arises in arises in the interior of P , and the codeword δ [d] arises inside F d+1 .
We can now define the sets U β i and U γ i in our realization.For each i ∈ [d + 1], let L i be a line that is parallel to the i-th edge of P , moved a small distance away from P but still intersecting the flap F i .Let L ′ i be a second copy of L i moved twice as far from P as L i , and note that L ′ i does not necessarily pass through F i .For 2 ≤ i ≤ d, label points in the intersections of the various L i and L ′ i as follows: These points are shown in Figure 3.Moreover, we define the following edge cases: . Now, with these points labeled, for i ∈ [d] we define: We claim that this completes our open realization of C (2,d,d) .The U β i and U γ i do not fully cover any of the regions giving rise to the codewords of types (vi)-(viii) that we described Figure 3.Some of the points used to construct U β i and U γ i .The polygons P and P ′ are not pictured.
previously, so it suffices to show that the codewords arising inside the various U β i and U γ i are exactly those of types (i)-(v) in Definition 3.1.
Note that the union of the various U β i and U γ i is a bent, thickened line segment which wraps around the first d edges of P .For i ∈ [d − 1], the codewords arising near the i-th joint in this bent region are exactly  Note that this open realization is degenerate: the disjoint sets U γ i and U γ i+1 share the boundary point These are all codewords of type (i)-(iv), and we see that all such codewords arise for various choices of i. Away from the joints, the only codewords that arise are {β i , γ i } and {α i , β i , γ i , δ i }, the latter arising near the midpoint of L i .This accounts for the codewords of type (v), and so we have indeed realized the code C (2,d,d) as desired.□ Example 3.3.In Figure 5 we illustrate the open realization of C (2,d,d) constructed in Proposition 3.2 in the case d = 4. Explicitly, the code we realize is In the first four lines above we have written the codewords that appear in the bent region around the outside of the central pentagon in the order that they appear.In the final line we have written the codewords that appear in the five "flaps" around the pentagon and the codeword α 1234 δ 1234 that appears in the pentagon itself.
With this construction achieved, we can proceed to construct a non-degenerate open (and hence also closed) realization of C (2,d,d) in R d .This construction is the most technical result in the paper, and requires us to carefully manipulate a variety of inequalities that define the sets in our realization.However, the broad intuition for this construction is not too complex: we thicken the coordinate axes into open cubical prisms to form the various U α i and U δ i , and we form the various U β i and U γ i by sequentially slicing through a thickened simplex in the positive orthant which lies far form the origin.This construction is illustrated for the case d = 3 in Example 3.5 below.
x j > 1 , and In words, U δ i is obtained from an open unit hypercube in the positive orthant by extending it infinitely in the i-th coordinate direction.The set U α i is the subset of U δ i in which the sum of all coordinates is larger than one-that is, U α i is obtained from U δ i by slicing off the simplex in which the sum of coordinates is one or less, which lies in the corner of the positive orthant.
We claim that the nonempty codewords that arise among these sets are exactly those of types (vi), (vii), and (viii) in Definition 3.1.Note that outside of the open unit hypercube in which each coordinate is between zero and one, the only nonempty codewords appearing are {α i , δ i } for i ∈ [d].This follows from the fact that U α i and U γ i are the same outside the hypercube, and U α i does not meet U α j outside the hypercube when j ̸ = i.Inside the hypercube there are two regions.Where the sum of coordinates is larger than one, all U α i and U δ i appear, giving rise to the codeword α x so that the sum of the coordinates of x is between 5d 2 and 5d 2 + 1.Now, for i ∈ [d] define We aim to show the addition of these sets to our realization gives rise to exactly the codewords of type (i)-(v) from Definition 3.1.First, let us determine the codewords that arise from these sets independent of the U α i and U δ i .If x ∈ C, then observe that the value of ℓ(x) completely determines which codeword arises at x: • {β i , β i+1 } for i ∈ [d − 1] arises when 5id 2 + 2d 2 ≤ ℓ(x) ≤ 5id 2 + 3d 2 , and arises when 5id 2 + 3d 2 < ℓ(x) < 5id 2 + 4d 2 .By construction of C we have 4d 2 < ℓ(x) < 5d 3 + d 2 for all x ∈ C, and so these cases cover all points in C. To show that each case actually occurs, we will construct a line segment L along which ℓ takes values covering all cases above.
Let p be the point whose first coordinate is 5d 2 − d + 1 2 , and whose remaining coordinates are all equal to 1 + 1 d−1 .Observe that the sum of the coordinates of p are exactly 5d 2 + 1 2 .Moreover, we have Symmetrically, let q be a point whose last coordinate is 5d 2 − d + 1 2 , and whose remaining coordinates are equal to 1+ 1 d−1 .As with p, we see that the sum of coordinates of q is exactly 5d 2 + 1 2 .Furthermore, we may compute Since ℓ is linear, we conclude that ℓ takes all real values between ℓ(p) < 5d 2 + d 2 and ℓ(q) > 5d 3 − d 2 on the line segment L.Moreover, every point on L has sum of coordinates equal to 5d 2 + 1 2 , so L is contained in C. In particular, there are points in L ∩ C for which ℓ attains a value covering each case in the bulleted list above.Thus all codewords of types (i)-(iv) arise along L, and no others arise from the various U β i and U γ i We have determined that the various U α i and U δ i give rise to exactly the codewords of types (vi)-(vii) in isolation, while the various U β i and U γ i give rise to exactly those of types (i)-(iv) in isolation.We must now argue that when considered together, all these codewords remain, and the only new codewords that appear are exactly those of type (v) in Definition 3.1.
Considering the sets together, we do not lose any codewords.Those of types (vi)-(vii) arise outside of C, which contains the various U β i and U γ i .Those of types (i)-(iv) arise along L, and every point in L has all coordinates larger than one, so L does not meet any U α i or U δ i .To see that only codewords of type (v) arise when considering the sets together, it will suffice to show that U α i ∩ C is nonempty, and is contained in the region where the codeword {β i , γ i } arises (recall that U α i and U δ i are identical outside of the unit hypercube, which does not meet C).That is, it will suffice to show that 5id 2 − d 2 ≤ ℓ(x) ≤ 5id 2 + d 2 for all x ∈ U α i ∩ C, and to find an example of one such x.
The points in x in U α i ∩ C are exactly those which satisfy the following d + 1 conditions: x i < 5d 2 + 1, 0 < x j < 1 for j ̸ = i, and x i > 0.
Note that ℓ(x) is smallest when the early coordinates of x are larger and the overall sum of the coordinates is smallest.Thus for x ∈ U α i ∩ C, the value of ℓ(x) is bounded below by On the other hand, ℓ(x) is largest when the later coordinates of x are larger, and the overall sum of the coordinates is largest.Thus the value of ℓ(x) on the region This shows that U α i ∩ C is contained in the region where the codeword {β i , γ i } arises, so the only codeword that could arise in our overall realization involving both α i and some β j is exactly {α i , β i , γ i , δ i }.To see that this codeword actually does arise, consider the point whose i-th coordinate is 5id 2 + 1 2 − ε, and all of whose other coordinates are ε d−1 .For a sufficiently small ε > 0, this point will lie in C ∩ U α i , and thus give rise to the codeword {α i , β i , γ i , δ i }.
So far we have shown that our collection is an open convex realization of C (2,d,d) .Let us finally argue that our realization is non-degenerate.It suffices to observe that replacing the sets in our realization with their closures does not change the realized code.The arguments above can be applied verbatim, provided that we swap any strict inequalities for non-strict inequalities, and vice versa.□ Example 3.5.Let us consider the code C (2,d,d) in the case d = 3.We have Figure 6 illustrates the construction used in Proposition 3.4 to obtain a non-degenerate realization of C (2,3,3) in R 3 .Note that Figure 6 is only a sketch of our construction-we do not precisely illustrate the inequalities that define the set C, and the various U α i and U δ i would be thinner relative to C in an exact illustration.
So far, we have established appropriate upper bounds on the embedding dimensions of C (2,d,d) .We now move on to establish matching lower bounds.It will suffice to show that cdim(C (2,d,d) ) = d, which we do in Proposition 3.7.Our proof requires two existing tools.The first tool is a notion of "rigid structures" defined by [1], which guarantees that a union of certain sets in a closed realization is convex-we do not state the definition of a rigid structure in full generality, but instead give a sufficient version of this result as a lemma below.The second tool we require is a code A d from [7].The relevant feature of this code is that if we add a certain codeword to it, the resulting code has closed embedding dimension equal to d-the codeword of type (viii) from Definition 3.1 will be exactly the codeword that we need, up to a relabeling of the base set.Lemma 3.6 (Version of Lemma 4.21 from [1]).Let X = {X 1 , X 2 , . . ., X n } be a closed convex realization of a code C, and suppose that the nonempty codewords in C can be labeled c 1 , c 2 , . . ., c k so that (i)

ii) no other containments occur between nonempty codewords, and (iii)
Then the union i∈[n] X i is convex.
Consider the code that arises only from the various X β i and X γ i .The nonempty codewords in this code will be exactly the codewords of types (i)-(iv) in Definition 3.1.Observe that we may order these codewords sequentially so that we have the containments Moreover, no other containment relations exist between these codewords, and the intersection of any three consecutive codewords is nonempty (in particular, the intersection will contain some β i ).Thus by Lemma 3.6, the union of all X β i and The code realized by the collection We have established all the necessary constructions and results to exactly characterize the embedding dimensions of C (2,d,d) .We compile and summarize these results in the theorem below.
The close relationship between C (2,2,d) and C (2,d,d) greatly simplifies our analysis of C (2,2,d) .As a start, we have the following.Proof.Informally, we may form a closed realization by arranging the various X β i and X γ i sequentially along the x-axis, and then letting the various X α i be triangles which meet at a common point above the x-axis and intersect the x-axis sequentially.Formally, let C be the strip {(x, y) ∈ R 2 | −1 ≤ y ≤ 0 and 0 ≤ x ≤ 4d − 3}.Then for i ∈ [d] we define Let p = (0, d), and for i ∈ [d] let q i = (4i − 3.75, 0) and r i = (4i − 3.25, 0).Then define We claim that this yields a closed realization of C (2,2,d) .Observe that the X α i are triangles which only meet at p, so the codewords they give rise to in isolation are simply {α i } for i ∈ [d] and α [d] , the latter arising only at p.These are exactly the codewords of types (vi) and (vii) in Definition 4.1.
The codewords that arise from the various U β i and U γ i in isolation are completely determined by the x coordinates of points in C. Indeed, if (x, y) is a point in C then the codeword arising at this point is  We are now ready to prove that nddim(C (2,2,d) ) = d.Our proof proceeds similarly to the proof of Proposition 3.7-namely, it relies on the rigid structure result in Lemma 3.6, and on the characterization of the embedding dimensions of an existing family of codes.
As in the proof of Proposition 3.7, the codewords of types (i)-(iv) satisfy the conditions of Lemma 3.6, and so the union of all X β i and X γ i is a closed convex set.Let us call this set X d+1 , and for i ∈ [d] define X i = X α i .Now, we claim that non-degeneracy of the realization X guarantees non-degeneracy of the realization X ′ = {X 1 , X 2 , . . ., X d+1 }.First observe that the sets {X 1 , . . ., X d } are nondegenerate in isolation, and realize the code {[d], {1}, {2}, . . ., {d}, ∅}.The set X d+1 is full-dimensional, and since the codewords of type (v) in Definition 4.1 are the only ones that simultaneously contain some α i and β j or γ j , we conclude that X d+1 intersects each other X i at a point common to both their interiors, while avoiding the common intersection of all X i for i ∈ [d].
However, the analysis above tells us that code(X ′ ) = S d (recall Definition 2.1).The code S d has non-degenerate embedding dimension exactly d, and since X ′ is a realization in R d ′ with d ′ < d, we have reached a contradiction.This proves the result.□ We have now characterized the embedding dimension vector of C (2,2,d) , as summarized in the theorem below.Proof.In Proposition 4.2 we showed that the open and non-degenerate embedding dimensions of C (2,2,d) were no larger than two and d, respectively.Proposition 4.3 showed that the closed embedding dimension was no more than two.In Proposition 4.5 we argued that the non-degenerate embedding dimension was exactly d, which then implies that the closed and open embedding dimensions are both exactly two-if they were smaller, so would be the non-degenerate embedding dimension.We now treat the three remaining cases, in which some embedding dimensions may be infinite.As we did in Section 2, we draw on some existing examples in the literature which suffice-in fact, the codes C (∞,2,∞) and C (2,∞,∞) have already been defined an analyzed in [18] and [3]   Proof.[18,Theorem 3.1]   Proof.Figures 9 and 10 show closed and open realizations of C (2,2,∞) in R 2 .It remains to show that no non-degenerate realization of this code exists.Suppose for contradiction that we have a closed non-degenerate realization X = {X 1 , X 2 , . . ., X 9 } in R d .We may assume without loss of generality that the various X i are compact.
Let us first examine the sets {X 4 , X 5 , . . ., X 9 } in isolation.The codewords that arise from this collection will be {45, 456, 46, 467, 67, 678, 68, 689, 89, ∅}.These codewords satisfy the conditions of Lemma 3.6-namely, we have the containments 45 ⊂ 456 ⊃ 46 ⊂ 467 ⊃ 67 ⊂ 678 ⊃ 68 ⊂ 689 ⊃ 89, no other containments occur, and the intersection of any three consecutive codewords is nonempty.Thus the union X 4 ∪ X 5 ∪ • • • ∪ X 9 is convex.Since our realization is nondegenerate, the interior of this union is a nonempty convex open set-let us call this interior U .Now, let p be a point in the interior of X 123 , let q be a point in the interior of X 145 , and let r be a point in the interior of X 389 .Observe that q and r both lie in U , so the line segment qr is contained in U .Thus the consecutive codewords that appear along qr must all contain some index between 4 and 9.In fact, consecutive codewords that appear along this line segment must contain one another (see [15,Lemma 2.1]).The only possible sequence of codewords that can arise along L is therefore 145 45 2456 246 2467 67 678 68 689 89 389.
In particular, L passes through X 2 in addition to the interiors of X 1 and X 3 .By possibly perturbing q and r by a small distance, we may assume that qr passes through the interior of X 2 .
Let A be the affine span of p, q, and r.We may assume that these points are in general position so that A has dimension exactly two.Define U i = int(X i ) ∩ A for i ∈ [3], and U 4 = U ∩ A. The sets U 1 , U 2 , U 3 , and U 4 may then be regarded as convex open sets in We claim that the code realized by U = {U 1 , U 2 , U 3 , U 4 } is exactly S 3 (recall Definition 2.1).Our choice of p guarantees that U 1 ∩ U 2 ∩ U 3 is nonempty, while the line segment qr ⊆ U 4 guarantees that U 4 intersects each of U 1 , U 2 , and U 3 .The set U 4 does not meet U 123 since U 4 is contained in U which does not meet X 123 , which in turn contains U 123 .Finally, codewords containing any of 12, 13, or 23 do not appear in this realization-if they did, then non-degeneracy of X would imply that there was some codeword appearing in the original realization which contained one of these.No such codeword exists in the original realization, so U is an open convex realization of S 3 in R 2 .This contradicts the fact that odim(S 3 ) = 3 (recall Proposition 2.3).Thus C (2,2,∞) does not have a non-degenerate realization in any dimension.□

Conclusion
We have constructed several families of codes and characterized their embedding dimension vectors.In combination, these families guarantee that every vector (a, b, c) with 2 ≤ a, b, c ≤ ∞ and max{a, b} ≤ c arises as the embedding dimension vector of some code (Theorem 1.9).Moreover, such vectors are exactly those that can arise as embedding dimension vectors, with the exception of the vectors (0, 0, 0) and (1, 1, 1).Although our results required careful and sometimes lengthy proofs, our arguments were primarily based on existing tools in the convex neural code literature: sunflowers of convex open sets (recall Section 2, which restates results of [13]), and rigid structures of closed convex sets (recall Lemma 3.6, which restates results of [1]).Our contribution was to find combinations of these tools which yielded the correct embedding dimension vectors, and carry out the necessary analysis to characterize these vectors.
Although we have settled the question of which vectors can arise as embedding dimension vectors, it is still very difficult to bound the embedding dimensions of an arbitrary code C ⊆ 2 [n] .In fact, it is even an open question whether or not there exists an algorithm which can decide the open, closed, or non-degenerate embedding dimension of a code.
A further area of study which we did not explore in this work was the relationship between the size of the base set of a code and its embedding dimensions.Such a line of investigation would help characterize how "efficiently" codes can capture the dimension of a space in which they are realized.We thus ask the following: Question 6.1.Among all codes C with base set [n], what is the maximum finite open (respectively, closed or non-degenerate) embedding dimension that arises?Which codes achieve this maximum?
As a start, we conjecture that each additional base set element yields a strict increase in the maximum embedding dimension.Conjecture 6.2.The maximum described in Question 6.1 is a strictly increasing function of n.That is, if C ⊆ 2 [n] has maximum open embedding dimension among all codes on [n], while D ⊆ 2 [n+1] has maximum open embedding dimension among all codes on [n + 1], then odim(D) > odim(C).Moreover, the analogous result should hold for closed and nondegenerate embedding dimensions.
Rather than stratifying codes by the size of their base sets, and then asking for the maximum embedding dimension in each strata, one could take the reverse perspective: stratify by embedding dimension, and then ask for the smallest base set size.We formalize this point of view below.Note that this is not simply a reformulation of Question 6.1, though these two questions do provide bounds for one another.

Definition 1 . 2 .
Let U = {U 1 , U 2 , . . ., U n } be a collection of sets in R d .The code of U is code(U) := {σ ⊆ [n] | There exists p ∈ R d such that p ∈ U i if and only if i ∈ σ}

Figure 1 .
Figure 1.An (open or closed) realization of C in R 2 , with an arrow pointing to the region where the codeword 12 arises.

Definition 1 . 6 .
Let C be a code.The open, closed, and non-degenerate embedding dimensions of C are the following quantities, respectively: odim(C) := min{d | C has an open convex realization in R d }, cdim(C) := min{d | C has a closed convex realization in R d }, and nddim(C) := min{d | C has a non-degenerate (open or closed) convex realization in R d }.

Figure 2
Figure2shows open realizations for S 2 and S 3 in R 2 and R 3 respectively.The code S 4 does not have an open realization in R 3 , so we illustrate a closed realization in R 2 .

Figure 2 .
Figure 2. Open realizations of S 2 and S 3 , and a closed realization of S 4 .

3 .
2.3] tell us that odim(S d ) = d and cdim(S d ) = 2.The code S d is intersection complete, and [14, Lemma 2.2.4] guarantees that open and non-degenerate embedding dimension are equal for intersection complete codes.Thus nddim(S d ) = odim(S d ) = d, proving the result.□ Constructing the Codes C (2,d,d) with d < ∞

Figure 4 .
Figure 4.The codewords arising at the i-th "joint" where L i and L i+1 meet.Note that this open realization is degenerate: the disjoint sets U γ i and U γ i+1 share the boundary point p i+1 = L i ∩ L i+1 .

Proposition 3 . 4 .
The code C (2,d,d) has a non-degenerate realization in R d .Proof.For i ∈ [d], we start by defining

Figure 5 .
Figure 5.An open realization of C (2,4,4) in R 2 as constructed in the proof of Proposition 3.2.

Figure 6 .
Figure 6.A non-degenerate open realization of C (2,3,3) in R 3 , with the regions that give rise to each codeword labeled.

Proposition 3 . 7 .
The code C (2,d,d) has closed embedding dimension equal to d. Proof.In Proposition 3.4 we showed that C (2,d,d) has a non-degenerate realization in R d .Thus it will suffice to show that C (2,d,d) does not have a closed realization in any dimension d ′ < d.Suppose for contradiction that we have a closed convex realization 2, . . ., d}}, where A d is the code of [7, Definition 3.6].However, [7, Theorem 3.7] states that the closed embedding dimension of A d ∪ {{1, 2, . . ., d}} is exactly d.Since the realization X ′ lies in R d ′ where d ′ < d, we have reached a contradiction.Thus C (2,d,d) has closed embedding dimension equal to d. □

Theorem 3 . 8 . 4 .
The code C (2,d,d) of Definition 3.1 has embedding dimension vector equal to (2, d, d).Proof.In Proposition 3.2 we established that odim(C (2,d,d) ) ≤ 2, and in Proposition 3.4 we showed that nddim(C (2,d,d) ) ≤ d.Proposition 3.7 showed that cdim(C (2,d,d) ) = d, which implies that the non-degenerate embedding dimension is also equal to d.We cannot have odim(C (2,d,d) ) < 2 since Theorem 1.8 would imply that the closed embedding dimension is less than d.Thus the open embedding dimension is exactly 2, and the result follows.□ Constructing the Codes C (2,2,d) with d < ∞ The code C (2,2,d) is closely related to the code C (2,d,d) which we defined and analyzed in the previous section.In fact, C (2,2,d) is simply the result of deleting the base set elements δ [d] from C (2,d,d) .It turns out this is enough to lower the closed embedding dimension from d to 2, without changing the other embedding dimensions.Definition 4.1.Let 2 ≤ d < ∞, and define C (2,2,d) to be the code on the base set α [d] ∪β [d] ∪γ [d] which has following nonempty codewords:

Proposition 4 . 2 .Proposition 4 . 3 .
The code C (2,2,d) has an open realization in R 2 and a non-degenerate realization in R d .Proof.Since C (2,2,d) is the result of deleting the base set elements {δ 1 , . . ., δ d } from C (2,d,d) , any realization of C (2,d,d) yields a realization of C (2,2,d) by deleting the various U δ i .In Proposition 3.2 we constructed an open realization of C (2,d,d) in R 2 , and in Proposition 3.4 we constructed a non-degenerate realization of C (2,d,d) in R d .Since deleting sets in a realization preserves openness and non-degeneracy of the realization, these constructions give us an open realization of C (2,2,d) in R 2 and a non-degenerate realization of C (2,2,d) in R d as desired.□ It remains to argue that C (2,2,d) has a closed realization in R 2 , but no non-degenerate realization in a dimension less than d.We start by constructing a closed realization.Example 4.4 illustrates this construction in the case d = 4.The code C (2,2,d) has a closed realization in R 2 .

Proposition 4 . 5 .
The code C (2,2,d) has non-degenerate embedding dimension equal to d. Proof.In Proposition 4.2 we argued that nddim(C (2,2,d) ≤ d, so it will suffice to argue that there is no non-degenerate (open or closed) realization of C (2,2,d) in R d ′ with d ′ < d.Suppose for contradiction that we have a closed non-degenerate realization

Figure 8 .
Figure 8. Left: a closed realization of C (∞,2,∞) .Right: an open realization of C (2,∞,∞) .In the open realization we have labeled the regions that give rise to each codeword-the various U i are open halves of the hexagon, rotated consecutively by 60 degrees.

Question 6 . 3 .
Among all codes C with open (respectively, closed or non-degenerate) embedding dimension equal to d, what is the minimum base set size that arises?Which codes achieve this minimum?
It will suffice to show that any open or closed realization of C by intervals in R 1 can be made non-degenerate.In any realization by (open or closed) intervals, we may assume without loss of generality that every point in R 1 is either a left endpoint of some intervals in our realization, or a right endpoint of some intervals in our realization, but not both simultaneously.To guarantee this, simply insert a closed unit interval [a, b] at any point p ∈ R 1 that is simultaneously a left and right endpoint.If our realization is open, we modify it so that a is a right endpoint of all intervals that p was a right endpoint of, and b is a left endpoint of all intervals that p was a left endpoint of.If our realization is closed, we do the opposite: intervals whose left endpoints were equal to p now have left endpoint a, while those with right endpoint p now have right endpoint b.
to the structure of the code A d from [7, Theorem 3.7], and is key to forcing the closed embedding dimension of C (2,d,d) to be large.Let us start our analysis of C (2,d,d) concretely, by forming an open realization in R 2 .
states that this code does not have an open convex realization in any dimension, and so its open and non-degenerate embedding dimensions are both ∞.On the other hand, [3, Figure 2.2(a)] provides a closed realization of this code in R 2 .□ Proof.[3, Lemma 2.9] states that this code does not have a closed convex realization in any dimension, and so its closed and non-degenerate embedding dimensions are both ∞.However, [3, Figure 2.1(a)] provides an open realization of this code in R 2 .□ Figure 8 duplicates [14, Figure 1.7], illustrating a closed realization of C (∞,2,∞) and an open realization of C (2,∞,∞) in R 2 .Note that both realizations are degenerate.For example, on the left X 2 and X 3 only intersect in a 1-dimensional segment, and on the right U 1 and U 4 are disjoint but share boundary points.In Theorem 5.3, we conclude by constructing and analyzing the code C (2,2,∞) .