AFTD Auto-Formalizing Theoretical Domains

weighted_dist

def

The shortest-path distance between vertices u and v in an edge-weighted simple graph (G, w) is the infimum over all walks from u to v of the sum of weights of the edges traversed by the walk.

Statement

noncomputable def weighted_dist {V : Type*} (G : SimpleGraph V) (w : Sym2 V → ℝ) (u v : V) : ℝ
Defined in
arXiv:2611.14755, Section 2
Verified
15 Nov 2026
Axioms
none listed

Read back from the Lean

Given a type V, a simple graph G on V, an edge-weight function w : Sym2 V → ℝ, and two vertices u, v : V, weighted_dist G w u v is defined as the real infimum (sInf) of the set of total weights (p.edges.map w).sum over all walks p from u to v in G.

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

/-- The shortest-path distance between vertices u and v in a graph G with edge weights w, defined as the infimum of walk lengths between u and v. -/
noncomputable def weighted_dist {V : Type*} (G : SimpleGraph V) (w : Sym2 V → ℝ) (u v : V) : ℝ :=
  sInf (Set.range fun (p : G.Walk u v) => (p.edges.map w).sum)
See it in the graphDiscuss this resultChallenge it