Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Positive edge weights, geodesic cycles, and peripheral cycles

Definition
opg500_weighted_cycle_models

by hao jia · Sep 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricsformalizationgeodesicsgraph-theory

This definition bundle fixes the finite weighted-graph semantics used by the OPG-500 mission.

For a finite simple graph GGG, an edge weight is a real-valued function on the actual edge subtype E(G)E(G)E(G), and positivity means 0<ℓ(e)0<\ell(e)0<ℓ(e) for every edge. A cycle is a nontrivial simple closed walk. Its weighted length counts every traversed edge, and a shortest path is required to be simple and no longer than every other simple path with the same endpoints.

A cycle is vertex-geodesic when every pair of its vertices can be joined by a globally shortest simple path using only edges of the cycle. A cycle is peripheral when it is chordless and deleting its vertices leaves a connected induced graph or no vertices. Three-connectivity means that the graph has at least four vertices and remains connected after deleting any set of fewer than three vertices.

The bundle also defines binary edge-indicator vectors over Z/2Z\mathbb Z/2\mathbb ZZ/2Z and the tight-edge predicate needed by supporting targets.

Definition code
import Mathlib.Combinatorics.SimpleGraph.Connectivity.Finite
import Mathlib.Combinatorics.SimpleGraph.Walk.Chord
import Mathlib.Data.Real.Basic

open Set
open scoped Sym2

namespace OPG500Counterexample

universe u

abbrev Edge {V : Type u} (G : SimpleGraph V) := G.edgeSet

abbrev EdgeWeight {V : Type u} (G : SimpleGraph V) := Edge G → ℝ

def IsPositive {V : Type u} {G : SimpleGraph V} (ℓ : EdgeWeight G) : Prop :=
  ∀ e, 0 < ℓ e

structure Cycle {V : Type u} (G : SimpleGraph V) where
  base : V
  walk : G.Walk base base
  isCycle : walk.IsCycle

def Walk.edgeList {V : Type u} {G : SimpleGraph V} {u v : V}
    (p : G.Walk u v) : List (Edge G) :=
  p.edges.attach.map fun e => ⟨e.1, p.edges_subset_edgeSet e.2⟩

def Walk.weightedLength {V : Type u} {G : SimpleGraph V} {u v : V}
    (ℓ : EdgeWeight G) (p : G.Walk u v) : ℝ :=
  ((Walk.edgeList p).map ℓ).sum

def Walk.IsShortest {V : Type u} {G : SimpleGraph V} {u v : V}
    (ℓ : EdgeWeight G) (p : G.Walk u v) : Prop :=
  p.IsPath ∧ ∀ q : G.Walk u v, q.IsPath →
    Walk.weightedLength ℓ p ≤ Walk.weightedLength ℓ q

def Cycle.vertexSet {V : Type u} {G : SimpleGraph V} (C : Cycle G) : Set V :=
  {v | v ∈ C.walk.support}

def Cycle.edgeSet {V : Type u} {G : SimpleGraph V} (C : Cycle G) : Set (Sym2 V) :=
  C.walk.edgeSet

def Cycle.edgeVector {V : Type u} [DecidableEq V] {G : SimpleGraph V}
    (C : Cycle G) (e : Sym2 V) : ZMod 2 :=
  if e ∈ C.walk.edges then 1 else 0

def CycleList.edgeVectorSum {V : Type u} [DecidableEq V] {G : SimpleGraph V}
    (cycles : List (Cycle G)) (e : Sym2 V) : ZMod 2 :=
  (cycles.map fun C => C.edgeVector e).sum

/-- A graph edge is tight when its one-edge walk is a globally shortest path
between its endpoints. The existential endpoints make this definition independent
of an orientation chosen for the unordered edge. -/
def Edge.IsTight {V : Type u} {G : SimpleGraph V}
    (ℓ : EdgeWeight G) (e : Edge G) : Prop :=
  ∃ x y : V, ∃ h : G.Adj x y,
    e.1 = s(x, y) ∧ Walk.IsShortest ℓ h.toWalk

/-- A vertex-based weighted geodesic cycle: between any two of its vertices,
there is a globally shortest simple path using only edges of the cycle. -/
def Cycle.IsGeodesic {V : Type u} {G : SimpleGraph V}
    (ℓ : EdgeWeight G) (C : Cycle G) : Prop :=
  ∀ ⦃x y : V⦄, x ∈ C.vertexSet → y ∈ C.vertexSet →
    ∃ p : G.Walk x y, Walk.IsShortest ℓ p ∧ p.edgeSet ⊆ C.edgeSet

/-- An induced cycle whose vertex deletion leaves a connected graph or no vertices. -/
def Cycle.IsPeripheral {V : Type u} {G : SimpleGraph V} (C : Cycle G) : Prop :=
  C.walk.IsChordless ∧
    (IsEmpty {v : V // v ∉ C.vertexSet} ∨
      (G.induce {v | v ∉ C.vertexSet}).Connected)

/-- Vertex 3-connectivity for a finite simple graph: at least four vertices,
and deletion of any set of fewer than three vertices leaves a connected graph. -/
def IsThreeConnected {V : Type u} [Fintype V] (G : SimpleGraph V) : Prop :=
  4 ≤ Fintype.card V ∧
    ∀ s : Finset V, s.card < 3 → (G.induce {v | v ∉ s}).Connected

end OPG500Counterexample
Source
Georgakopoulos--Sprüssel, Geodetic topological cycles in locally finite graphs, EJC 16 (2009), R144, https://arxiv.org/abs/0911.3999v1, Section 3.1 and Section 5, Problem 3; Open Problem Garden OPG-500, https://www.openproblemgarden.org/op/geodesic_cycles_and_tuttes_theorem
Read-back

What the Lean code literally says, in plain math · gpt-5.6-luna

For a simple graph GGG on a vertex type VVV, Edge G is the set of unordered vertex pairs that are edges of GGG.

EdgeWeight G is the type of all functions assigning a real number to each edge of GGG.

An edge-weight function ℓ\ellℓ is IsPositive exactly when 0<ℓ(e)0<\ell(e)0<ℓ(e) for every edge eee of GGG.

A Cycle G consists of a vertex bbb, a walk in GGG from bbb back to bbb, and a proof that this closed walk is a cycle, namely a simple nontrivial closed walk in the graph.

For a walk ppp in GGG, Walk.edgeList p is the ordered list of the edges traversed by ppp, with each edge recorded as an element of Edge G; repeated traversals remain repeated in the list.

For an edge-weight function ℓ\ellℓ and a walk ppp, Walk.weightedLength \ell p is the sum of ℓ(e)\ell(e)ℓ(e) over the ordered edge list of ppp, counting every traversal.

A walk ppp from uuu to vvv is Walk.IsShortest \ell p exactly when ppp is a simple path and, for every simple path qqq from uuu to vvv, the weighted length of ppp is at most the weighted length of qqq.

For a cycle CCC, Cycle.vertexSet C is the set of vertices occurring in its walk.

For a cycle CCC, Cycle.edgeSet C is the set of unordered vertex pairs occurring as edges in its walk.

Given a cycle CCC, a finite vertex type VVV with decidable equality, and an unordered pair eee of vertices, Cycle.edgeVector C e is the element of Z/2Z\mathbb Z/2\mathbb ZZ/2Z equal to 111 if eee occurs among the edges traversed by CCC, and equal to 000 otherwise.

For a finite list of cycles (C1,…,Cn)(C_1,\ldots,C_n)(C1​,…,Cn​) and an unordered pair eee, CycleList.edgeVectorSum is the sum in Z/2Z\mathbb Z/2\mathbb ZZ/2Z of the values `Cycle.edgeVector C_i e$ for all entries of the list, including repetitions.

An edge eee of GGG is Edge.IsTight \ell exactly when there exist vertices x,yx,yx,y and an adjacency proof that xxx and yyy are joined by an edge such that the unordered pair underlying eee is {x,y}\{x,y\}{x,y} and the one-edge walk from xxx to yyy is a globally shortest simple path under ℓ\ellℓ.

A cycle CCC is Cycle.IsGeodesic \ell exactly when, for every two vertices x,yx,yx,y occurring in CCC, there exists a walk ppp from xxx to yyy that is a globally shortest simple path under ℓ\ellℓ and whose set of traversed edges is contained in the edge set of CCC.

A cycle CCC is Cycle.IsPeripheral exactly when its walk is chordless and either there are no vertices outside C.vertexSet C, or the graph induced by all vertices outside C.vertexSet C is connected.

For a finite simple graph GGG on VVV, IsThreeConnected G means that VVV has at least four vertices and, for every finite set sss of vertices with fewer than three elements, the graph induced by the vertices not in sss is connected.

Human review
  • Endorsed by Shuze Chen · Sep 7, 2026

  • Endorsed by hao jia · Sep 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me