Hypergraph metric (the spec)
IsHypergraphMetric is the specification a candidate distance must satisfy
to count as a metric on hypergraphs in the sense of ProofAtlas.
It lives in ProofAtlas/Metric/Axioms.lean. A distance that registers
against this spec — and that registration is checked at CI time — is
automatically usable in the geometric profile pipeline, the
hyperbolicity machinery, and every downstream theorem.
This page describes the seven fields of IsHypergraphMetric, the
registration mechanism, and how each concrete metric in the next
layer fills them in.
Signature
A candidate distance has type
— a function of a hypergraph , a colour-weighting parameter , and two vertices .
The seven fields
The structure
IsHypergraphMetric (d : Hypergraph V C → WalkParams C → V → V → ℝ)
bundles four metric-space axioms and three sensitivity witnesses.
Pulled live from Metric/Axioms.lean ? error:
Metric-space axioms
1. Identity.
2. Symmetry.
3. Triangle inequality.
4. Non-negativity.
These four together force to be a pseudometric (a true metric if separation also holds, but ProofAtlas does not require separation in the spec).
Sensitivity witnesses
A distance that ignored which side an edge points, what order its inputs are in, or which inference rule it represents, would be geometry on the wrong object. The spec demands non-trivial sensitivity to each of the four structural dimensions (D, O, C, plus A holds structurally).
5. Direction-sensitive. There exist hypergraphs differing only by swapping one hyperedge's inputs and outputs, together with params and vertices , such that .
6. Ordering-sensitive. There exist differing only by permuting one hyperedge's input positions, together with params and , such that .
7. Colour-sensitive. There exist , two colour weightings on the same combinatorial , and , such that .
The three witnesses are existential: a candidate metric proves it can tell two such hypergraphs apart on at least one example. This is intentionally weak — it lets us register a metric without quantifying how sensitive it is everywhere.
Registration
A metric is registered by:
- Defining it as
noncomputable def myDist ... : ℝsomewhere inProofAtlas/Metric/. - Proving the instance theorem
theorem myDist_isHypergraphMetric : IsHypergraphMetric (fun H π u v => myDist H π u v)inProofAtlas/Metric/<MyDist>/Instance.lean. - Adding
<myDist, ProofAtlas/Metric/<MyDist>/Instance.lean>to the registry inscripts/check_bdf_metric_instances.sh.
The CI check refuses to ship if the instance theorem still contains
sorry. Every metric in the next layer of these docs is registered
this way.
What lives in the next layer
The four registered metrics:
Each page describes the metric's mathematical definition, intuition,
Lean signature, and the current state of its seven IsHypergraphMetric
fields (proved, parameterised over a hypothesis, or still sorry).