AFTD Auto-Formalizing Theoretical Domains

graph_hom_density

def

The homomorphism density q(F, G) of a graph F in a graph G is the number of graph homomorphisms from F to G divided by |V(G)|^{|V(F)|}.

Statement

open Classical in
noncomputable def graph_hom_density {α β : Type*} [Fintype α] [Fintype β]
    (F : SimpleGraph α) (G : SimpleGraph β) : ℝ
Defined in
arXiv:2610.13820, Section 1
Verified
26 Oct 2026
Axioms
none listed
Used by 1
  • is_knrsA graph F has the KNRS property if for every d in (0, 1] and every ε > 0, there exists ρ > 0 and n₀ such that every (ρ, d)-dense graph G…

Read back from the Lean

graph_hom_density is a definition that takes two types α and β equipped with Fintype instances, a simple graph F on α, and a simple graph G on β, and returns the real number equal to the number of graph homomorphisms from F to G (Fintype.card (F →g G)) divided by the cardinality of β raised to the power of the cardinality of α ((Fintype.card β : ℝ) ^ Fintype.card α).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

open Classical in
/-- The homomorphism density q(F, G) of a graph F in a graph G. -/
noncomputable def graph_hom_density {α β : Type*} [Fintype α] [Fintype β]
    (F : SimpleGraph α) (G : SimpleGraph β) : ℝ := (Fintype.card (F →g G) : ℝ) / ((Fintype.card β : ℝ) ^ Fintype.card α)
See it in the graphDiscuss this resultChallenge it