  We prove a Gauss-Bonnet formula X(G) = sum_x K(x), where K(x)=(-1)^dim(x)
(1-X(S(x))) is a curvature of a vertex x with unit sphere S(x) in the
Barycentric refinement G1 of a simplicial complex G. K(x) is dual to
(-1)^dim(x) for which Gauss-Bonnet is the definition of Euler characteristic X.
Because the connection Laplacian L'=1+A' of G is unimodular, where A' is the
adjacency matrix of of the connection graph G', the Green function values
g(x,y) = (1+A')^-1_xy are integers and 1-X(S(x))=g(x,x). Gauss-Bonnet for K^+
reads therefore as str(g)=X(G), where str is the super trace. As g is a
time-discrete heat kernel, this is a cousin to McKean-Singer str(exp(-Lt)) =
X(G) for the Hodge Laplacian L=dd^* +d^*d which lives on the same Hilbert space
than L'. Both formulas hold for an arbitrary finite abstract simplicial complex
G. Writing V_x(y)= g(x,y) for the Newtonian potential of the connection
Laplacian, we prove sum_y V_x(y) = K(x), so that by the new Gauss-Bonnet
formula, the Euler characteristic of G agrees with the total potential
theoretic energy sum_x,y g(x,y)=X(G) of G. The curvature K now relates to the
probability measure p minimizing the internal energy U(p)=sum_x,y g(x,y) p(x)
p(y) of the complex. Since both the internal energy (here linked to topology)
and Shannon entropy are natural and unique in classes of functionals, we then
look at critical points p the Helmholtz free energy F(p)=(1-T) U(p)-T S(p)
which combines the energy functional U and the entropy functional S(p)=-sum_x
p(x) log(p(x)). As the temperature T changes, we observe bifurcation phenomena.
Already for G=K_3 both a saddle node bifurcation and a pitchfork bifurcation
occurs. The saddle node bifurcation leads to a catastrophe: the function T ->
F(p(T),T) is discontinuous if p(T) is a free energy minimizer.
