Resistance distance
The effective resistance distance on a hypergraph is the oldest and best-behaved of the four candidates: it has a closed-form spectral expression, satisfies the metric axioms unconditionally, and is monotone under hyperedge addition. It is the only metric currently sorry-free.
Definition
Pick a conductance schedule (see below). The associated weighted Laplacian is where is the total conductance between and and is its row-sum diagonal. Write for the Moore–Penrose pseudoinverse.
The resistance distance between is
Here is the standard basis vector at .
Why this is a distance
Three properties drop out of the spectral formula directly:
- : the vector kills the quadratic form.
- Symmetry: is symmetric (it's a pseudoinverse of a symmetric matrix).
- Non-negativity: is positive semidefinite (it's a weighted Laplacian), and so is its pseudoinverse, so the quadratic form is .
Triangle inequality is harder; the proof routes through the
Klein–Randić formulation — see Metric/Resistance/Algebraic.lean.
Intuition: how hard is it to cut the connection?
Treat each hyperedge as a resistor network with conductance between every incident pair. Then is literally the electrical resistance of the resulting circuit between terminals and .
That makes the inequality
obvious. It also explains why two vertices in a densely-connected hyperedge cluster are close (many parallel resistors) while two vertices joined by a long thin chain are far (resistors in series).
Conductance from hyperedges
The conductance comes from the harmonic schedule
when is the -th input of and is an output of ; symmetrised by adding . The factor weights edges by colour, the factor enforces input monotonicity (the first input carries more weight than the last), and dividing by spreads the weight uniformly across outputs.
Rayleigh monotonicity
Adding a hyperedge can only decrease every pairwise distance:
Operationally: adding an inference rule can only make two propositions closer together. This is the discrete analogue of the classical electrical fact that adding a resistor in parallel reduces total resistance.
The corollary that drives the headline pitch: hypergraph resistance distance is a non-increasing function of mathematical knowledge.
In the compute layer
Pipeline/Linalg.lean implements the resistance matrix end-to-end in
Float:
def IncidenceData.resistanceMatrix (H : IncidenceData) : Array (Array Float)
The pseudoinverse is computed via Gauss–Jordan on
with — the
regularisation cancels in the final difference up to floating-point noise. This is the
formula evaluated when you run
#atlas.resistance.
Try it
→ #atlas.resistance Nat.add_zero Nat.add_comm
glues both proofs via const-sharing and reports
.
References
[BDF26] §5.1 — resistance distance on hypergraphs.
[KR93] Klein, Randić, Resistance distance, J. Math. Chem. 12, 1993.