Simplicial Complexes

The module supports creation of simplicial complexes from lists of faces, as well as a few preprogrammed complex types. Furthermore, several standard techniques for modifying and recombining simplicial complexes are available.

Contents

SimplicialComplex(f) : SeqEnum[SetEnum] -> SmpCpx
Constructs an abstract simplicial complex with the faces in the list f. The argument should be a sequence of sets. There is no requirement on the type of the elements in the face sets, however several of the constructions require the sets to have integer entries. See Normalization for automated renumbering of the face set elements.

Example SmpCpx_construct (H149E1)

We give a simplicial complex by listing the facets, or also redundant faces if we want to.
> sc := SimplicialComplex([{1,2,3},{1,2,4},{1,3,4},{2,3,4},{1,5},{2,5}]);
We can view the facets (faces not included in any other faces) of the complex, or by giving the :Maximal output flag, we can view all faces.
> sc;
Simplicial complex
[
    { 2, 3, 4 },
    { 1, 2, 3 },
    { 1, 2, 4 },
    { 2, 5 },
    { 1, 5 },
    { 1, 3, 4 }
]
> sc:Maximal;
Simplicial complex
{
    ,
    { 4 },
    { 2, 3, 4 },
    { 2, 3 },
    { 3, 4 },
    { 1, 3 },
    { 3 },
    { 1 },
    { 1, 4 },
    { 1, 2, 3 },
    { 2 },
    { 1, 2 },
    { 1, 2, 4 },
    { 2, 5 },
    { 1, 5 },
    { 5 },
    { 2, 4 },
    { 1, 3, 4 }
}
SimplicialComplex(G) : Grph -> SmpCpx
Constructs a 1-dimensional simplicial complex isomorphic to the graph G.
FlagComplex(G) : Grph -> SmpCpx
CliqueComplex(G) : Grph -> SmpCpx
Constructs a simplicial complex with an n-simplex for each n-clique in the graph G.
Dimension(X) : SmpCpx -> RngIntElt
Returns the dimension of the highest dimensional face of the simplicial complex X. Note that there is a difference between degrees and dimensions of faces. A face is said to have degree n if there are n elements in the face as a set, and it is said to have dimension n if there are n + 1 elements in the face as a set.

Example SmpCpx_dimension (H149E2)

The recently defined simplicial complex has top dimension 2.
> Dimension(sc);
2
Faces(X, d) : SmpCpx, RngIntElt -> SeqEnum[SetEnum]
Returns the faces of one degree d of the simplicial complex X. Recall that the degree of a face is the number of elements in the face as a set, and one more than the dimension of the face.

The order of faces returned for each degree is also the correspondence between faces and the basis of the corresponding module in a chain complex constructed from the simplicial complex.

If the complex does not possess any faces of the requested degree, an empty sequence is returned.

Example SmpCpx_faces (H149E3)

We can list faces of any degree in the defined simplicial complex.
> Faces(sc,2);
[
    { 2, 3 },
    { 3, 4 },
    { 1, 3 },
    { 1, 4 },
    { 1, 2 },
    { 2, 5 },
    { 1, 5 },
    { 2, 4 }
]
> Faces(sc,5);
[]
Facets(X) : SmpCpx -> SeqEnum[SetEnum]
Returns the facets of the simplicial complex X. The facets of a simplicial complex are the faces that are not themselves subsets of another face. This is what the normal printing mode for a simplicial complex outputs.

Example SmpCpx_facets (H149E4)

We can read the facets both by fetching the sequence of facets and by printing the complex as such.
> Facets(sc);
[
    { 2, 3, 4 },
    { 1, 2, 3 },
    { 1, 2, 4 },
    { 2, 5 },
    { 1, 5 },
    { 1, 3, 4 }
]
> sc;
Simplicial complex
[
    { 2, 3, 4 },
    { 1, 2, 3 },
    { 1, 2, 4 },
    { 2, 5 },
    { 1, 5 },
    { 1, 3, 4 }
]
Normalization(X) : SmpCpx -> SmpCpx
Normalization(~X) : SmpCpx ->
Relabels the points (elements of the face sets) of the simplicial complex X using 1, 2, 3, ... . This ensures that the simplicial complex is built on subsets of the integers, which is a prerequisite for several functions handling simplicial complexes. We call a simplicial complex on subsets of the integers normalized in this handbook.

Note the two calling signatures of this function. The first signature copies the simplicial complex and returns a new complex with the desired modification, whereas the second signature modifies the complex in place.

Shift(X, n) : SmpCpx, RngIntElt -> SmpCpx
Shift(~X, n) : SmpCpx, RngIntElt ->

Shifts all integer points in the normalized simplicial complex X by an offset given by n.

Note the two calling signatures of this function. The first signature copies the simplicial complex and returns a new complex with the desired modification, whereas the second signature modifies the complex in place.

Example SmpCpx_normalize-shift (H149E5)

We define a simplicial complex using string labels, normalize it and then shift the labels.
> cpx := Boundary(SimplicialComplex([{"a","b","c"}]));
> cpx;
Simplicial complex
[
    { c, a },
    { c, b },
    { b, a }
]
> Normalization(~cpx);
> cpx;
Simplicial complex
[
    { 1, 3 },
    { 2, 3 },
    { 1, 2 }
]
> Shift(~cpx,-2);
> cpx;
Simplicial complex
[
    { -1, 1 },
    { 0, 1 },
    { -1, 0 }
]
Boundary(X) : SmpCpx -> SmpCpx
Returns the simplicial complex generated by all simplexes that lie in the boundary of the simplicial complex X. This can be used to easily acquire a simplicial complex representing the n-sphere.

Example SmpCpx_boundary (H149E6)

We can determine the boundary of our previously defined simplicial complex, or construct a 4-sphere.
> Boundary(sc);
Simplicial complex
[
    { 2, 3 },
    { 3, 4 },
    { 1, 3 },
    { 1, 4 },
    { 1, 2 },
    { 5 },
    { 2, 4 }
]
> sph4 := Boundary(SimplicialComplex([{1,2,3,4,5,6}]));
> sph4;
Simplicial complex
[
    { 1, 2, 3, 5, 6 },
    { 2, 3, 4, 5, 6 },
    { 1, 3, 4, 5, 6 },
    { 1, 2, 3, 4, 5 },
    { 1, 2, 4, 5, 6 },
    { 1, 2, 3, 4, 6 }
]
S + T : SmpCpx, SmpCpx -> SmpCpx
Returns the topological sum, or disjoint union, of two simplicial complexes. Requires both complexes to be normalized using Normalization.

Example SmpCpx_sum (H149E7)

We can construct a disjoint union of two circles.
> sph2 := Boundary(SimplicialComplex([{1,2,3}]));
> sph2 + sph2;
Simplicial complex
[
    { 4, 6 },
    { 2, 3 },
    { 4, 5 },
    { 5, 6 },
    { 1, 3 },
    { 1, 2 }
]
S eq T : SmpCpx, SmpCpx -> BoolElt
Compares two simplicial complexes. Will not try to find an isomorphism, rather does the comparison by ensuring that the points are in the same universe and then doing a set comparison on the set of faces.

Example SmpCpx_eq (H149E8)

Shifting a complex, for instance, will break equality, since the labels differ.
> sc eq Shift(sc,2);
false
> sc eq Shift(Shift(sc,2),-2);
true
Furthermore, isomorphic complexes with different labels will not be equal.
> circ1 := Boundary(SimplicialComplex([{1,2,3}]));
> circ2 := Boundary(SimplicialComplex([{"a","b","c"}]));
> circ1 eq circ2;
false
Product(S,T) : SmpCpx, SmpCpx -> SmpCpx
Returns the cartesian product of two simplicial complexes. This will work on any complexes, since the new points will be pairs of points from the component complexes.

Example SmpCpx_product (H149E9)

Using the two different circles from the last example, we can now construct a torus.
> Product(circ1,circ2);
Simplicial complex
[
    { <3, b>, <1, b>, <3, c> },
    { <1, c>, <3, c>, <1, a> },
    { <2, a>, <3, b>, <3, a> },
    { <3, b>, <1, b>, <1, a> },
    { <1, b>, <2, b>, <2, c> },
    { <2, a>, <3, c>, <3, a> },
    { <1, c>, <1, b>, <3, c> },
    { <3, c>, <2, b>, <2, c> },
    { <1, c>, <1, b>, <2, c> },
    { <3, c>, <3, a>, <1, a> },
    { <2, a>, <3, c>, <2, c> },
    { <3, b>, <3, a>, <1, a> },
    { <2, a>, <1, a>, <2, b> },
    { <2, a>, <1, a>, <2, c> },
    { <1, c>, <1, a>, <2, c> },
    { <3, b>, <3, c>, <2, b> },
    { <1, b>, <1, a>, <2, b> },
    { <2, a>, <3, b>, <2, b> }
]
If we want something less unwieldy -- especially after repeated cartesian products -- we can always normalize the resulting complexes.
> line := SimplicialComplex([{1,2}]);
> square := Product(line,line);
> cube1 := Product(square,line);
> cube2 := Product(line,square);
> cube1 eq cube2;
false
> Normalization(cube1) eq Normalization(cube2);
false
> cube1;
Simplicial complex
[
    { <<1, 2>, 1>, <<1, 2>, 2>, <<1, 1>, 1>, <<2, 2>, 2> },
    { <<2, 1>, 1>, <<2, 2>, 1>, <<1, 1>, 1>, <<2, 2>, 2> },
    { <<1, 2>, 2>, <<1, 1>, 1>, <<1, 1>, 2>, <<2, 2>, 2> },
    { <<1, 2>, 1>, <<2, 2>, 1>, <<1, 1>, 1>, <<2, 2>, 2> },
    { <<1, 1>, 1>, <<1, 1>, 2>, <<2, 1>, 2>, <<2, 2>, 2> },
    { <<2, 1>, 1>, <<1, 1>, 1>, <<2, 1>, 2>, <<2, 2>, 2> }
]
> Normalization(cube1);
Simplicial complex
[
    { 3, 4, 5, 8 },
    { 4, 5, 6, 8 },
    { 1, 3, 4, 5 },
    { 2, 4, 5, 7 },
    { 1, 2, 4, 5 },
    { 4, 5, 6, 7 }
]
Join(S,T) : SmpCpx, SmpCpx -> SmpCpx
S * T : SmpCpx, SmpCpx -> SmpCpx
Constructs the join of two simplicial complexes. The join of two simplicial complexes is defined as the complex generated by faces on the form {x1, ..., xr, y1, ..., ys} for {x1, ..., xr}∈S and {y1, ..., ys}∈T. Requires both simplicial complexes to be normalized.

Example SmpCpx_join (H149E10)

The join of two edges is a 3-simplex.
> SimplicialComplex([{1,2}]) * SimplicialComplex([{1,2}]);
Simplicial complex
[
    { 1, 2, 3, 4 }
]
AddSimplex(X, s) : SmpCpx, SetEnum -> SmpCpx
AddSimplex(~X, s) : SmpCpx, SetEnum ->
AddSimplex(X, s) : SmpCpx, SeqEnum -> SmpCpx
Addsimplex(~X, s) : SmpCpx, SeqEnum ->
Adds either a single simplex s expressed as a set or a sequence of simplexes to a simplicial complex. The functional versions of the function call return a new complex with the added simplices included, and the procedural change the complex in place.
Prune(X, f) : SmpCpx, SetEnum -> SmpCpx
Prune(~X, f) : SmpCpx, SetEnum ->
Removes a face f and all faces containing f from a simplicial complex X. If f is not a face of X, then X is returned unchanged.

Note the two calling signatures of this function. The first signature copies the simplicial complex and returns a new complex with the desired modification, whereas the second signature modifies the complex in place.

Glue(X, e) : SmpCpx, SeqEnum -> SmpCpx
Glue(~X, e) : SmpCpx, SeqEnum ->
In the simplicial complex X, identify all points identified by pairs in the sequence e.

The sequence e should be a sequence of pairs of elements of the face sets of X. The identification will eliminate the first component of each pair, replacing it with the second component wherever it occurs in X.

Note the two calling signatures of this function. The first signature copies the simplicial complex and returns a new complex with the desired modification, whereas the second signature modifies the complex in place.

Example SmpCpx_prune-glue (H149E11)

We can, for instance, construct the connected sum of two tori using Product, Prune, the topological sum and Glue.
> circ := SimplicialComplex([{1,2},{2,3},{3,1}]);
> torus := Product(circ,circ);
> Normalization(~torus);
> torus;
Simplicial complex
[
    { 2, 3, 6 },
    { 1, 2, 9 },
    { 2, 6, 8 },
    { 4, 7, 8 },
    { 3, 5, 9 },
    { 4, 6, 7 },
    { 1, 8, 9 },
    { 1, 4, 8 },
    { 6, 8, 9 },
    { 2, 7, 8 },
    { 2, 3, 9 },
    { 5, 6, 9 },
    { 1, 3, 5 },
    { 1, 4, 6 },
    { 3, 6, 7 },
    { 1, 5, 6 },
    { 1, 2, 7 },
    { 1, 3, 7 }
]
> oneholetorus := Prune(torus,{1,2,7});
> twoholetorus := Prune(Prune(torus,{1,2,7}),{6,8,9});
> threetori := oneholetorus + twoholetorus + oneholetorus;
> threetorus := Glue(threetori,[<1,10>,<2,11>,<7,16>,<15,19>,<17,20>,<18,25>]);

Note that we find the glue data by considering that the maximal point in the original torus had number 9, so for the second added torus, all points will be shifted by 9 and in the third all points will be shifted by 18. Thus, the excised facets {1, 2, 7} and {6, 8, 9} turn into {10, 11, 16} and {15, 17, 18}, and the excised facet {1, 2, 7} in the third torus turns into {19, 20, 25}.

BarycentricSubdivision(X) : SmpCpx -> SmpCpx
Constructs the barycentric subdivision of the simplicial complex X. Abstractly, this is a simplicial complex whose faces are chains X1 ⊂ ... ⊂Xn of faces from X. The new complex has more faces but the same homotopy type as the old complex.
Skeleton(X, q) : SmpCpx, RngIntElt -> SmpCpx
Returns the q-skeleton of the simplicial complex X. This is the complex consisting of all faces of X of dimension at most q.
UnderlyingGraph(X) : SmpCpx -> GrphUnd, GrphVertSet, GrphEdgeSet
Constructs a graph isomorphic, as a graph, to the 1-skeleton of the simplicial complex X.
Cone(X) : SmpCpx -> SmpCpx
Constructs a cone over the simplicial complex X. The cone is generated by all faces of the complex, with an additional vertex included into each face. Any cone is acyclic, in other words all homology groups vanish. Requires a normalized simplicial complex.
Suspension(X) : SmpCpx -> SmpCpx
Constructs the suspension, or double cone, over the normalized simplicial complex X. The suspension has the added property that all the homology groups occur in it, shifted up by one dimension.

Example SmpCpx_cone-suspension (H149E12)

For computation of the relevant homology, and a demonstration of the stated facts about the cone and suspension operations, please refer to examples in the Section on homology computation.
> circ := Boundary(SimplicialComplex([{1,2,3}]));
> Cone(circ);
Simplicial complex
[
    { 1, 3, 4 },
    { 2, 3, 4 },
    { 1, 2, 4 }
]
> Suspension(circ);
Simplicial complex
[
    { 1, 3, 5 },
    { 1, 3, 4 },
    { 1, 2, 5 },
    { 2, 3, 4 },
    { 1, 2, 4 },
    { 2, 3, 5 }
]

Standard Topological Objects

Simplex(n) : RngIntElt -> SmpCpx
Returns the n-dimensional simplex as a simplicial complex.
Sphere(n) : RngIntElt -> SmpCpx
Returns a simplicial complex triangulating the n-sphere.
KleinBottle() : -> SmpCpx
Returns a triangulation of the Klein bottle as an abstract simplicial complex.
Torus() : -> SmpCpx
Returns a triangulation of a torus as an abstract simplicial complex.
Cylinder() : -> SmpCpx
Returns a triangulation of a cylinder as an abstract simplicial complex.
MoebiusStrip() : -> SmpCpx
Returns a triangulation of the Moebius strip as an abstract simplicial complex.
LensSpace(p) : RngIntElt -> SmpCpx
Constructs the lens space L(p, 1). This has a 1-dimensional homology generator of order p.
SimplicialProjectivePlane() : -> SmpCpx
Constructs a triangulation of the projective plane.

Examples for the usage of LensSpace and SimplicialProjectivePlane will be given in Section Homology Computation on homology computation.

V2.28, 13 July 2023