Homomorphism density for finite simple graphs #
Mathlib does not (as of 2026-04) provide SimpleGraph.homDensity. We define a lightweight
version here, specialised to finite vertex types on the host G, and prove the basic
homDensity H G ≤ 1 upper bound used as a sanity check in Sidorenko-style arguments.
The extension to infinite hosts uses the same formula with Fintype.card replaced by
measure-theoretic integrals; we do not need that generality here.
The number of graph homomorphisms H → G, as a natural number. For finite vertex
types this is just the cardinality of the Hom type.
Equations
- H.homCount G = Fintype.card (H →g G)
Instances For
The homomorphism density t(H, G) of a simple graph H in a simple graph G with
finite vertex sets is #Hom(H, G) / |V(G)|^{|V(H)|}.
Equations
- H.homDensity G = ↑(H.homCount G) / ↑(Fintype.card W) ^ Fintype.card V
Instances For
The homomorphism density t(H, G) is at most 1.
Proof outline: the underlying function of a H →g G-homomorphism is an element of
V → W, which has |W|^|V| elements, so homCount H G ≤ |W|^|V|. Divide.