# simplicialComplex -- create a simplicial complex

## Synopsis

• Usage:
simplicialComplex I
simplicialComplex L
• Inputs:
• I, , the ideal of minimal nonfaces (Stanley-Reisner ideal)
• L, a list, a list of monomials representing the facets
• Outputs:
• , the simplicial complex determined by the nonfaces I or generated by the given faces L

## Description

A simplicial complex on a set of vertices is a collection of subsets D of these vertices, such that if F is in D, then every subset of F is also in D. In Macaulay2, the vertices are variables in a polynomial ring, and each subset is represented as a product of the corresponding variables.

A simplicial complex is determined either by its nonfaces or by its faces. The monomials corresponding to the nonfaces are a basis of an ideal, called the Stanley-Reisner ideal, and it suffices to specify the minimal nonfaces, which generate the ideal. The monomials corresponding to the faces do not form the basis of an ideal, but it suffices to specify the maximal faces, which are called facets. The function simplicialComplex accepts either the ideal of nonfaces or the list of facets as input.

In our first example we construct the octahedron by specifying its ideal of nonfaces.

 i1 : R = ZZ[a..f]; i2 : I = monomialIdeal(a*f, b*d, c*e); o2 : MonomialIdeal of R i3 : Octahedron = simplicialComplex I o3 = | def bef cdf bcf ade abe acd abc | o3 : SimplicialComplex
Note that is displayed by showing its facets. We see that there are eight facets to the octahedron. Alternatively, we could have defined the octahedron by this list of facets.
 i4 : L = {d*e*f, b*e*f, c*d*f, b*c*f, a*d*e, a*b*e, a*c*d, a*b*c} o4 = {d*e*f, b*e*f, c*d*f, b*c*f, a*d*e, a*b*e, a*c*d, a*b*c} o4 : List i5 : Octahedron' = simplicialComplex L o5 = | def bef cdf bcf ade abe acd abc | o5 : SimplicialComplex i6 : Octahedron == Octahedron' o6 = true i7 : fVector Octahedron o7 = HashTable{-1 => 1} 0 => 6 1 => 12 2 => 8 o7 : HashTable
There are two "trivial" simplicial complexes: the void complex and the irrelevant complex. The void complex has no faces. This complex cannot be constructed from its facets, since it has none.
 i8 : void = simplicialComplex monomialIdeal 1_R o8 = 0 o8 : SimplicialComplex i9 : fVector void o9 = HashTable{-1 => 0} o9 : HashTable i10 : dim void o10 = -infinity o10 : InfiniteNumber
The irrelevant complex, which should be distinguished from the void complex, has a unique face of dimension -1, the empty set.
 i11 : irrelevant = simplicialComplex monomialIdeal gens R o11 = | 1 | o11 : SimplicialComplex i12 : fVector irrelevant o12 = HashTable{-1 => 1} o12 : HashTable i13 : dim irrelevant o13 = -1 i14 : irrelevant' = simplicialComplex {1_R} o14 = | 1 | o14 : SimplicialComplex i15 : irrelevant' == irrelevant o15 = true
As in Miller-Sturmfels, Combinatorial Commutative Algebra, we would avoid making such a big deal about the difference between these complexes if it did not come up so much. Many formulas for betti numbers, dimensions of local cohomology, etc., depend on this distinction.

## Caveat

• The ring of I or L must be a polynomial ring.
• The coefficient ring matters: for instance, it is used when computing the corresponding chain complex.
• This construction routine does some computation, as it computes both the facets and the ideal of non-faces.