Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 2.4 — solvability of a system a(ij) ≤ yᵢ + yⱼ ≤ b(ij) via walks

Proved
LovaszSchrijver.OddHole.two_var_system_infeasible_iff

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

feasibilitygraph-theorylinear-inequalitiesp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let H=(W,F)H = (W, F)H=(W,F) be a finite graph, let two values 0≤a(ij)≤b(ij)0 \le a(ij) \le b(ij)0≤a(ij)≤b(ij) be associated with each edge ij∈Fij \in Fij∈F, and let U⊆WU \subseteq WU⊆W. Then the linear system

a(ij)≤yi+yj≤b(ij) (ij∈F),yi≥0 (i∈W),yi=0 (i∈U)a(ij) \le y_i + y_j \le b(ij)\ (ij \in F), \qquad y_i \ge 0\ (i \in W), \qquad y_i = 0\ (i \in U)a(ij)≤yi​+yj​≤b(ij) (ij∈F),yi​≥0 (i∈W),yi​=0 (i∈U)

has no solution y∈RWy \in \mathbb{R}^Wy∈RW if and only if there exists a walk v0,v1,…,vpv_0, v_1, \dots, v_pv0​,v1​,…,vp​ in HHH (vertices not necessarily distinct, vtvt+1∈Fv_t v_{t+1} \in Fvt​vt+1​∈F) such that one of the following holds:

  1. (a) ppp is odd and b(v0v1)−a(v1v2)+b(v2v3)−⋯+b(vp−1vp)<0b(v_0v_1) - a(v_1v_2) + b(v_2v_3) - \cdots + b(v_{p-1}v_p) < 0b(v0​v1​)−a(v1​v2​)+b(v2​v3​)−⋯+b(vp−1​vp​)<0;
  2. (b) ppp is even, v0=vpv_0 = v_pv0​=vp​, and b(v0v1)−a(v1v2)+b(v2v3)−⋯−a(vp−1vp)<0b(v_0v_1) - a(v_1v_2) + b(v_2v_3) - \cdots - a(v_{p-1}v_p) < 0b(v0​v1​)−a(v1​v2​)+b(v2​v3​)−⋯−a(vp−1​vp​)<0;
  3. (c) ppp is even, vp∈Uv_p \in Uvp​∈U, and b(v0v1)−a(v1v2)+b(v2v3)−⋯−a(vp−1vp)<0b(v_0v_1) - a(v_1v_2) + b(v_2v_3) - \cdots - a(v_{p-1}v_p) < 0b(v0​v1​)−a(v1​v2​)+b(v2​v3​)−⋯−a(vp−1​vp​)<0;
  4. (d) ppp is odd, v0,vp∈Uv_0, v_p \in Uv0​,vp​∈U, and −a(v0v1)+b(v1v2)−a(v2v3)−⋯−a(vp−1vp)<0-a(v_0v_1) + b(v_1v_2) - a(v_2v_3) - \cdots - a(v_{p-1}v_p) < 0−a(v0​v1​)+b(v1​v2​)−a(v2​v3​)−⋯−a(vp−1​vp​)<0.

The paper calls this a folklore lemma, "a criterion for the solvability of such a system, more combinatorial than the Farkas lemma". It is applied to the system on the entries of YYY in the proof of Theorem 2.3.

Formalization Note Edge values are functions on unordered pairs, so a(ij)=a(ji)a(ij) = a(ji)a(ij)=a(ji). In (a)–(c) the alternating sum starts with +b+b+b on the first edge and alternates; in (d) it starts with −a-a−a. The hypothesis 0≤a≤b0 \le a \le b0≤a≤b is stated as printed, although the application in the paper uses lower bounds xi+xj+xk−1x_i + x_j + x_k - 1xi​+xj​+xk​−1 that can be negative.

Preamble
import Mathlib
import Definitions.Def_LovaszSchrijver_OddHole_AlternatingWalk
Formal statement
namespace LovaszSchrijver.OddHole

/-- Lemma 2.4 (p. 178): for a finite graph `H = (W, F)` with values `0 ≤ a(ij) ≤ b(ij)` on its
edges and `U ⊆ W`, the system `a(ij) ≤ yᵢ + yⱼ ≤ b(ij)` (ij ∈ F), `yᵢ ≥ 0` (i ∈ W),
`yᵢ = 0` (i ∈ U) has no solution iff there is a walk `v₀, …, v_p` of one of the types
(a)–(d). -/
theorem two_var_system_infeasible_iff {W : Type} [Fintype W] (H : SimpleGraph W)
    (a b : Sym2 W → ℝ) (hab : ∀ e ∈ H.edgeSet, 0 ≤ a e ∧ a e ≤ b e) (U : Finset W) :
    (¬ ∃ y : W → ℝ,
        (∀ i j, H.Adj i j → a s(i, j) ≤ y i + y j ∧ y i + y j ≤ b s(i, j)) ∧
        (∀ i, 0 ≤ y i) ∧ (∀ i ∈ U, y i = 0)) ↔
      ∃ (p : ℕ) (v : Fin (p + 1) → W), IsWalkSeq H v ∧
        ((Odd p ∧ altB a b v < 0) ∨
         (Even p ∧ v 0 = v (Fin.last p) ∧ altB a b v < 0) ∨
         (Even p ∧ v (Fin.last p) ∈ U ∧ altB a b v < 0) ∨
         (Odd p ∧ v 0 ∈ U ∧ v (Fin.last p) ∈ U ∧ altA a b v < 0)) := by sorry

end LovaszSchrijver.OddHole
Source
Lovász and Schrijver, Cones of matrices and set-functions and 0–1 optimization, SIAM J. Optim. 1(2) (1991), p. 178, Lemma 2.4
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let HHH be a simple graph on a finite vertex type WWW. Let a,ba, ba,b be real-valued functions on unordered pairs of vertices, and assume 0≤a(e)≤b(e)0 \le a(e) \le b(e)0≤a(e)≤b(e) for every edge eee of HHH. The values of aaa and bbb on non-edges are arbitrary and unconstrained. Let U⊆WU \subseteq WU⊆W be a finite set of vertices.

The system. It asks for y∈RWy \in \mathbb{R}^Wy∈RW satisfying:

  • a({i,j})≤yi+yj≤b({i,j})a(\{i,j\}) \le y_i + y_j \le b(\{i,j\})a({i,j})≤yi​+yj​≤b({i,j}) for every edge i∼ji \sim ji∼j;
  • yi≥0y_i \ge 0yi​≥0 for all i∈Wi \in Wi∈W;
  • yi=0y_i = 0yi​=0 for all i∈Ui \in Ui∈U.

The alternating sums. For a vertex sequence v=(v0,…,vp)v = (v_0,\dots,v_p)v=(v0​,…,vp​):

  • altB(v)=b(v0v1)−a(v1v2)+b(v2v3)−⋯\mathrm{alt}_B(v) = b(v_0v_1) - a(v_1v_2) + b(v_2v_3) - \cdotsaltB​(v)=b(v0​v1​)−a(v1​v2​)+b(v2​v3​)−⋯, where edge number ttt (counting from 000) contributes bbb if ttt is even and −a-a−a if ttt is odd;
  • altA(v)=−a(v0v1)+b(v1v2)−⋯\mathrm{alt}_A(v) = -a(v_0v_1) + b(v_1v_2) - \cdotsaltA​(v)=−a(v0​v1​)+b(v1​v2​)−⋯, where even-numbered edges contribute −a-a−a and odd-numbered edges contribute bbb.

The statement. The system has no solution if and only if there exist p∈Np \in \mathbb{N}p∈N and a walk v0,v1,…,vpv_0, v_1, \dots, v_pv0​,v1​,…,vp​ in HHH (consecutive vertices adjacent, repetitions allowed) satisfying at least one of:

  • (a) ppp is odd and altB(v)<0\mathrm{alt}_B(v) < 0altB​(v)<0;
  • (b) ppp is even, v0=vpv_0 = v_pv0​=vp​, and altB(v)<0\mathrm{alt}_B(v) < 0altB​(v)<0;
  • (c) ppp is even, vp∈Uv_p \in Uvp​∈U, and altB(v)<0\mathrm{alt}_B(v) < 0altB​(v)<0;
  • (d) ppp is odd, v0∈Uv_0 \in Uv0​∈U, vp∈Uv_p \in Uvp​∈U, and altA(v)<0\mathrm{alt}_A(v) < 0altA​(v)<0.

Degenerate cases.

  • p=0p = 0p=0. Both sums are 000, so no single-vertex walk witnesses any of (a)–(d).
  • WWW empty. The system is trivially solvable and no walk exists, so both sides are false.
  • UUU empty. Types (c) and (d) cannot occur.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me