Betti Numbers of Simplicial Complexes

First, here is a version of our module that draws a 2-dimensional simplicial complex.

drawGeometricRealization[complex_,points_]:=Module[
{verts={}, edges={}, faces={}},

(* make lists of simplices of each dimension *) 
Do[
If[Length[simplex]==1,AppendTo[verts,points[[simplex[[1]]]]]];
If[Length[simplex]==2,AppendTo[edges,points[[simplex]]]];
If[Length[simplex]==3,AppendTo[faces,points[[simplex]]]]
,{simplex,complex}];

(* return the drawing *) 
Show[
ListPlot[points->Range[Length[points]],AspectRatio->1,PlotStyle->{PointSize[Medium],Black},Axes->False],
Graphics[{Blue,Opacity[0.4],Triangle[faces],Black,Opacity[1],Line[edges]}] 
]
]

Example 1

We discussed this in the last class.

Here is a simplicial complex (Subscript[K, 1]):

points1={{0,1},{1,1},{1,0},{0,0}};
complex1={{1},{2},{3},{4},{1,2},{2,3},{3,4},{4,1},{2,4}};
drawGeometricRealization[complex1,points1]

Here is the boundary matrix of the 1-dimensional simplices in (Subscript[K, 1]):

d1={{1,0,0,1,0},{1,1,0,0,1},{0,1,1,0,0},{0,0,1,1,1}};
MatrixForm[d1]

Here is the boundary matrix of the 2-dimensional simplices in (Subscript[K, 1]):

d2={{1},{0},{0},{1},{1}};
MatrixForm[d2]
MatrixRank[d2,Modulus->2]

Example 2

We discussed this in the last class.

Here is a simplicial complex (Subscript[K, 2]):

points2={{0,1},{1,1},{1,0},{0,0},{2,1},{2,0}};
complex2={{1},{2},{3},{4},{1,2},{2,3},{3,4},{4,1},{2,4},{2,5},{5,6},{3,6},{3,5},{1,2,4},{3,5,6}};
drawGeometricRealization[complex2,points2]

Here is the boundary matrix of the 1-dimensional simplices in (Subscript[K, 2]):

d1={{1,0,0,1,0,0,0,0,0},{1,1,0,0,1,1,0,0,0},{0,1,1,0,0,0,0,1,1},{0,0,1,1,1,0,0,0,0},{0,0,0,0,0,1,1,0,1},{0,0,0,0,0,0,1,1,0}};
MatrixForm[d1]

Now create the boundary matrix of the 2-dimensional simplices in (Subscript[K, 2]):

d2={{1,0},{0,0},{0,0},{1,0},{1,0},{0,1},{0,0},{0,1},{0,1},{0,1}}
MatrixForm[d2]
MatrixRank[d2,Modulus->2]

Use your boundary matrices to compute the betti numbers (Subscript[β, 0]) and (Subscript[β, 1]) of complex (Subscript[K, 2]).

β0=6-MatrixRank[d1,Modulus->2]

β1=(9-MatrixRank[d1,Modulus->2])-MatrixRank[d2,Modulus->2]

Computing boundary matrices

Complete the following module that computes a boundary matrix of an abstract simplicial complex.
Input: An abstract simplicial complex K and a dimension j.
Output: A boundary matrix (Subscript[d, j]). Each column of (Subscript[d, j]) represents a j-dimensional simplex of K. Each row of (Subscript[d, j]) represents a (j-1)-dimensional simplex of K. The entry in row r, column c is 1 if the simplex represented by row r is in the boundary of the simplex represented by column c; otherwise, this entry is 0.

computeBoundaryMx[complex_,dim_]:=Module[
{},




]

Note that you can select all of the simplices of a certain dimension in a given complex using the Select function, like this:

Select[complex,Length[#]==2&]

When you have completed your boundary matrix module, test it on the simplicial complexes below. Then use boundary matrices to compute the Betti numbers of the simplicial complexes.

Example 3

points3={{-0.352083,0.510417},{-0.589583,0.520833},{0.0236111,0.536806},{-0.640278,0.198611},{0.00416667,0.208333},{0.391667,0.202083},{0.475694,0.486806},{0.395833,-0.433333},{-0.318056,-0.102778},{-0.286111,0.209028},{0.291667,-0.09375},{-0.414583,-0.4},{0.0590278,-0.104861},{0.0263889,-0.422222}};
complex3={{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{2,4},{1,10},{3,5},{6,7},{9,12},{13,14},{8,11}};
drawGeometricRealization[complex3,points3]

Example 4

points4={{-0.352083,0.510417},{0.0631944,0.511806},{-0.659028,0.198611},{0.416667,0.195833},{-0.661111,-0.205556},{0.39375,-0.233333},{-0.364583,-0.502083},{0.0805556,-0.515972}};
complex4={{1},{2},{3},{4},{5},{6},{7},{8},{1,2},{1,3},{1,4},{1,8},{2,4},{3,5},{3,7},{3,8},{4,6},{4,8},{5,7},{7,8},{6,8},{1,2,4},{1,3,8},{3,5,7},{3,7,8},{1,4,8},{4,6,8}};
drawGeometricRealization[complex4,points4]

Example 5

points5=points4;
complex5={{1},{2},{3},{4},{5},{6},{7},{8},{1,2},{1,3},{1,4},{1,8},{2,4},{3,5},{3,7},{3,8},{4,6},{4,8},{5,7},{7,8},{6,8},{1,2,4},{3,5,7},{1,3,8},{4,6,8}};
drawGeometricRealization[complex5,points5]

Example 6

points6={{0.202083,0.504167},{-0.475,0.514583},{-0.640278,0.198611},{0.00416667,0.208333},{0.391667,0.202083},{0.254167,-0.41875},{-0.561806,-0.0944444},{-0.286111,0.209028},{0.427083,-0.0979167},{-0.516667,-0.435417},{0.119444,-0.102778},{-0.198611,-0.278472}};
complex6={{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{1,4},{1,5},{2,3},{2,8},{3,8},{4,5},{6,9},{6,11},{7,10},{7,12},{10,12},{9,11}};
drawGeometricRealization[complex6,points6]

Example 7

points7={{-0.589583,0.520833},{0.114583,0.235417},{0.475694,0.486806},{0.4375,-0.460417},{-0.318056,-0.102778},{-0.298611,0.229861},{-0.589583,-0.433333},{0.106944,-0.136111}};
complex7={{1},{2},{3},{4},{5},{6},{7},{8},{1,2},{1,3},{1,5},{1,6},{1,7},{2,3},{2,4},{2,6},{2,8},{3,4},{4,5},{4,7},{1,7},{4,8},{5,7},{5,8},{5,6},{1,2,3},{1,2,6},{1,5,6},{1,5,7},{2,3,4},{2,4,8},{4,5,8},{4,5,7}};
drawGeometricRealization[complex7,points7]

Example 8

points8={{-0.589583,0.520833},{0.114583,0.235417},{0.475694,0.486806},{0.4375,-0.460417},{-0.318056,-0.102778},{-0.298611,0.229861},{-0.589583,-0.433333},{0.106944,-0.136111}};
complex8={{1},{2},{3},{4},{5},{6},{7},{8},{1,2},{1,3},{1,5},{1,6},{1,7},{2,3},{2,4},{2,6},{2,8},{3,4},{4,5},{4,7},{1,7},{4,8},{5,7},{5,8},{5,6}};
drawGeometricRealization[complex8,points8]

Example 9

This is a 3D example, so we need our 3D geometric realization code.

drawGeometricRealization3D[complex_,points_]:=Module[
{verts={}, edges={}, faces={},tetrahedra={},graphics},

(* make lists of simplices of each dimension *) 
Do[
If[Length[simplex]==1,AppendTo[verts,points[[simplex[[1]]]]]];
If[Length[simplex]==2,AppendTo[edges,points[[simplex]]]];
If[Length[simplex]==3,AppendTo[faces,points[[simplex]]]];
If[Length[simplex]==4,AppendTo[tetrahedra,points[[simplex]]]]
,{simplex,complex}];

(* return the drawing *) 
graphics=Join[
If[Length[tetrahedra]>0,{Purple,Opacity[0.85],Tetrahedron[tetrahedra]},{}],
{Cyan,Opacity[0.4],Triangle[faces],Black,Opacity[1],Thick, Line[edges],PointSize[Large],Point[verts]}
];
Graphics3D[graphics] 
]

points9={{0,0,0},{0,0,1},{-0.4,-0.4,0.5},{1,0,0},{1,0,1},{1.5,-0.2,0.5},{0,1,0},{0,1,1},{-0.2,1.5,0.5}};
complex9={{1},{2},{3},{4},{5},{6},{7},{8},{9},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{2,3},{2,5},{2,7},{2,8},{2,9},{3,6},{3,5},{3,7},{3,9},{4,5},{4,6},{4,7},{4,8},{4,9},{5,6},{5,8},{6,8},{6,9},{7,8},{7,9},{8,9},{1,2,5},{1,2,7},{1,3,6},{1,3,7},{1,4,5},{1,4,6},{2,3,5},{2,3,9},{2,7,8},{2,8,9},{3,5,6},{3,7,9},{4,5,8},{4,6,9},{4,7,8},{4,7,9},{5,6,8},{6,8,9}};
drawGeometricRealization3D[torus,pointsTorus]

Betti numbers of Vietoris-Rips complexes

Use your code from previous class session to compute Vietoris-Rips complexes from some sets of points. Then compute the Betti numbers of these simplicial complexes. What do you observe? What questions does this prompt you to ask?

Here is an interesting experiment: Generate a set S of n points uniformly at random from the unit square [0,1]×[0,1]. Choose a value ϵ>0 that close to zero, compute the complex (Subscript[VR, ϵ])(S), and then compute its Betti numbers. Now increase ϵ a bit and compute (Subscript[VR, ϵ])(S) and its Betti numbers again. Continue increasing ϵ and computing (Subscript[VR, ϵ])(S) and the Betti numbers. How do the Betti numbers change as ϵ increases?