English
The diameter of G is the naturalized supremum of all pairwise extended distances: diam(G) = toNat(sup_{p ∈ α×α} edist(p.1,p.2)).
Русский
Диаметр графа G равен естественной части верхней грандины по всем парам вершин: diam(G) = toNat(sup_{p ∈ α×α} edist(p.1,p.2)).
LaTeX
$$$$ \\operatorname{diam}(G) = \\operatorname{toNat}\\left( \\sup_{p \\in \\alpha \\times \\alpha} G.edist(p.1,p.2) \\right) $$$$
Lean4
/-- The diameter is the greatest distance between any two vertices, with the value `0` in
case the distances are not bounded above, or the graph is not connected.
-/
noncomputable def diam (G : SimpleGraph α) :=
G.ediam.toNat