AFTD Auto-Formalizing Theoretical Domains

weighted_graph_dist

def

Given a graph H on vertex type W and edge weights w : Sym2 W → ℝ, the shortest-path distance between u and v is the infimum of edge weight sums over all walks from u to v.

Statement

noncomputable def weighted_graph_dist {W : Type*} (H : SimpleGraph W) (w : Sym2 W → ℝ) (u v : W) : ℝ
Defined in
folklore
Verified
30 Oct 2026
Axioms
none listed

Read back from the Lean

For a type W, a simple graph H on W, an edge-weight function w : Sym2 W → ℝ assigning a real number to each unordered pair of vertices, and vertices u, v : W, weighted_graph_dist H w u v is defined as the infimum (in ℝ) over all walks p from u to v in H of the sum of the weights w e of the edges e traversed by p.

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 H with edge weight function w. -/
noncomputable def weighted_graph_dist {W : Type*} (H : SimpleGraph W) (w : Sym2 W → ℝ) (u v : W) : ℝ := ⨅ p : H.Walk u v, (p.edges.map w).sum
See it in the graphDiscuss this resultChallenge it