AFTD Auto-Formalizing Theoretical Domains

graph_interval

def

The interval between two vertices u and v in a finite graph G is the finset (Finset V) of all vertices w such that d(u,w) + d(w,v) = d(u,v).

Statement

open scoped Classical in
noncomputable def graph_interval {V : Type*} [Fintype V] (G : SimpleGraph V) (u v : V) : Finset V
Defined in
arXiv:2610.39966 Section 1
Verified
30 Oct 2026
Axioms
none listed

Read back from the Lean

Given a finite type V, a simple graph G on V, and vertices u, v : V, graph_interval G u v is defined as the Finset V of all vertices w : V such that the graph distance from u to w plus the graph distance from w to v equals the graph distance from u to v: {w : V | G.dist u w + G.dist w v = G.dist u v}.

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

open scoped Classical in
/-- The interval between two vertices u and v in a finite graph G as a finset. -/
noncomputable def graph_interval {V : Type*} [Fintype V] (G : SimpleGraph V) (u v : V) : Finset V := Finset.univ.filter (fun w => G.dist u w + G.dist w v = G.dist u v)
See it in the graphDiscuss this resultChallenge it