Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Oracle, Case II: systems (1) and (2) decide the side of {xd=0}\{x_d=0\}{xd​=0} or prove infeasibility (corrected direction)

Proved
MegiddoLP.FixedDim.oracle_caseII

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

convexityinfeasibilitylinear-programmingp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Consider the system Ax≥bAx\ge bAx≥b with at least one row, in variables x1,…,xdx_1,\dots,x_dx1​,…,xd​, and suppose it has no solution with xd=0x_d=0xd​=0. Let f(x)=max⁡i(bi−aiTx)f(x)=\max_i(b_i-a_i^Tx)f(x)=maxi​(bi​−aiT​x) be its infeasibility function. Let x′x'x′ with xd′=0x'_d=0xd′​=0 minimize fff over the hyperplane {xd=0}\{x_d=0\}{xd​=0}, and let I′={i:f(x′)=bi−aiTx′}I'=\{i: f(x')=b_i-a_i^Tx'\}I′={i:f(x′)=bi​−aiT​x′}. Consider the systems of the page,

(1)yd=1,  aiTy≥0 (i∈I′),(2)zd=−1,  aiTz≥0 (i∈I′).(1)\quad y_d=1,\ \ a_i^Ty\ge0\ (i\in I'),\qquad\qquad (2)\quad z_d=-1,\ \ a_i^Tz\ge0\ (i\in I').(1)yd​=1,  aiT​y≥0 (i∈I′),(2)zd​=−1,  aiT​z≥0 (i∈I′).

These are ∑j<daijyj≥−aid\sum_{j<d}a_{ij}y_j\ge-a_{id}∑j<d​aij​yj​≥−aid​ and ∑j<daijzj≥aid\sum_{j<d}a_{ij}z_j\ge a_{id}∑j<d​aij​zj​≥aid​. Then:

  1. if (1) is feasible, every www with f(w)<f(x′)f(w)<f(x')f(w)<f(x′) has wd>0w_d>0wd​>0;
  2. if (2) is feasible, every www with f(w)<f(x′)f(w)<f(x')f(w)<f(x′) has wd<0w_d<0wd​<0;
  3. if (1) and (2) are both feasible or both infeasible, then x′x'x′ is a global minimum of fff and the system Ax≥bAx\ge bAx≥b is infeasible.

So when precisely one of (1), (2) is feasible, the points of smaller infeasibility, and hence any feasible point, lie in one determined open half-space, and the recursion continues there.

Formalization Note (corrected) The page's last sentence reads "if (1) is the feasible one, we proceed into {xd<0}\{x_d<0\}{xd​<0}". The paragraph before it shows the opposite: if (1) is feasible, the answer to Q2 (improvement in {xd<0}\{x_d<0\}{xd​<0}) is negative. Parts 1 and 2 state the direction that argument proves. The rows are indexed by Fin (n + 1), so fff is a maximum over a nonempty set. The paper's xdx_dxd​ is Fin.last d of Fin (d + 1).

Preamble
import Mathlib
import Definitions.Def_Polyhedron
import Definitions.Def_MegiddoLP_FixedDim_Infeasibility
Formal statement
/-!
Megiddo, J. ACM 31 (1984), §4 p. 125, Case II of the oracle. The paper's `x_d` is the last
coordinate `Fin.last d` of `Fin (d + 1)`; the tested hyperplane is `{x_d = 0}`. Systems (1)
and (2) of the page are `∃ y, y_d = 1 ∧ Aᵢ ⬝ᵥ y ≥ 0 (i ∈ I')` and
`∃ z, z_d = -1 ∧ Aᵢ ⬝ᵥ z ≥ 0 (i ∈ I')`. The side is stated in the corrected direction:
(1) feasible puts every point of smaller infeasibility in `{x_d > 0}`.
-/

open Matrix LinearOptimization

namespace MegiddoLP.FixedDim

/-- **Oracle, Case II.** Let the system `Ax ≥ b` (at least one row) have no solution on
`{x_d = 0}`, let `x'` with `x'_d = 0` minimize `f = infeas A b` on `{x_d = 0}`, and let
`I' = {i | f(x') = bᵢ - Aᵢ ⬝ᵥ x'}`. Then
1. if (1) is feasible, every `w` with `f(w) < f(x')` has `w_d > 0`;
2. if (2) is feasible, every `w` with `f(w) < f(x')` has `w_d < 0`;
3. if (1) and (2) are both feasible or both infeasible, `x'` minimizes `f` on all of `ℝ^d`
   and `Ax ≥ b` is infeasible. -/
theorem oracle_caseII {n d : ℕ} (A : Matrix (Fin (n + 1)) (Fin (d + 1)) ℝ)
    (b : Fin (n + 1) → ℝ) (x' : Fin (d + 1) → ℝ)
    (hinf : polyhedron A b ∩ {x | x (Fin.last d) = 0} = ∅)
    (hx' : x' (Fin.last d) = 0)
    (hmin : ∀ w : Fin (d + 1) → ℝ, w (Fin.last d) = 0 → infeas A b x' ≤ infeas A b w) :
    ((∃ y : Fin (d + 1) → ℝ, y (Fin.last d) = 1 ∧
        ∀ i, infeas A b x' = b i - A i ⬝ᵥ x' → 0 ≤ A i ⬝ᵥ y) →
      ∀ w, infeas A b w < infeas A b x' → 0 < w (Fin.last d)) ∧
    ((∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = -1 ∧
        ∀ i, infeas A b x' = b i - A i ⬝ᵥ x' → 0 ≤ A i ⬝ᵥ z) →
      ∀ w, infeas A b w < infeas A b x' → w (Fin.last d) < 0) ∧
    (((∃ y : Fin (d + 1) → ℝ, y (Fin.last d) = 1 ∧
        ∀ i, infeas A b x' = b i - A i ⬝ᵥ x' → 0 ≤ A i ⬝ᵥ y) ↔
      (∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = -1 ∧
        ∀ i, infeas A b x' = b i - A i ⬝ᵥ x' → 0 ≤ A i ⬝ᵥ z)) →
      (∀ w, infeas A b x' ≤ infeas A b w) ∧ polyhedron A b = ∅) := by sorry

end MegiddoLP.FixedDim
Source
Megiddo, Linear Programming in Linear Time When the Dimension Is Fixed, J. ACM 31(1) (1984) 114–127, §4, p. 125 (Case II, systems (1) and (2))
Read-back

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

Setting. Let n,d∈Nn, d \in \mathbb{N}n,d∈N, let AAA be a real (n+1)×(d+1)(n+1)\times(d+1)(n+1)×(d+1) matrix with rows A0,…,AnA_0,\dots,A_nA0​,…,An​, and let b∈Rn+1b \in \mathbb{R}^{n+1}b∈Rn+1. Let x′∈Rd+1x' \in \mathbb{R}^{d+1}x′∈Rd+1, and write xd+1x_{d+1}xd+1​ for the last coordinate of a vector.

Notation.

  • f(x)=max⁡0≤i≤n(bi−Ai⋅x)f(x) = \max_{0\le i\le n}(b_i - A_i\cdot x)f(x)=max0≤i≤n​(bi​−Ai​⋅x) is the infeasibility function defined earlier.
  • P=polyhedron(A,b)P = \mathrm{polyhedron}(A,b)P=polyhedron(A,b) comes from an imported file whose text is not included here. Its name suggests {x:Ax≥b}\{x : Ax \ge b\}{x:Ax≥b}.

Hypotheses.

  1. P∩{x:xd+1=0}=∅P \cap \{x : x_{d+1} = 0\} = \emptysetP∩{x:xd+1​=0}=∅.
  2. xd+1′=0x'_{d+1} = 0xd+1′​=0.
  3. f(x′)≤f(w)f(x') \le f(w)f(x′)≤f(w) for every www with wd+1=0w_{d+1} = 0wd+1​=0.

Auxiliary sets. Let I′={i:f(x′)=bi−Ai⋅x′}I' = \{i : f(x') = b_i - A_i\cdot x'\}I′={i:f(x′)=bi​−Ai​⋅x′}, the rows attaining the maximum at x′x'x′. Define

Y: ∃y: yd+1=1,  Ai⋅y≥0  ∀i∈I′,Z: ∃z: zd+1=−1,  Ai⋅z≥0  ∀i∈I′.Y :\ \exists y:\ y_{d+1} = 1,\ \ A_i\cdot y \ge 0\ \ \forall i \in I', \qquad Z :\ \exists z:\ z_{d+1} = -1,\ \ A_i\cdot z \ge 0\ \ \forall i \in I'.Y: ∃y: yd+1​=1,  Ai​⋅y≥0  ∀i∈I′,Z: ∃z: zd+1​=−1,  Ai​⋅z≥0  ∀i∈I′.

Claim. All three of the following hold:

  1. If YYY holds, then every w∈Rd+1w \in \mathbb{R}^{d+1}w∈Rd+1 with f(w)<f(x′)f(w) < f(x')f(w)<f(x′) has wd+1>0w_{d+1} > 0wd+1​>0.
  2. If ZZZ holds, then every www with f(w)<f(x′)f(w) < f(x')f(w)<f(x′) has wd+1<0w_{d+1} < 0wd+1​<0.
  3. If YYY and ZZZ are either both true or both false, then:
    • f(x′)≤f(w)f(x') \le f(w)f(x′)≤f(w) for every w∈Rd+1w \in \mathbb{R}^{d+1}w∈Rd+1, and
    • P=∅P = \emptysetP=∅.

No objective vector appears in this statement.

Degenerate cases.

  • The matrix has at least one row, so fff is a genuine maximum and I′I'I′ is non-empty.
  • n=0n = 0n=0. There is one row, and I′={0}I' = \{0\}I′={0}.
  • d=0d = 0d=0. The slice {xd+1=0}\{x_{d+1} = 0\}{xd+1​=0} is the single point 0∈R10 \in \mathbb{R}^10∈R1. Hypotheses 2 and 3 then force x′=0x' = 0x′=0, with hypothesis 3 holding trivially.
  • Hypothesis 1. It relates PPP to the slice through the unseen definition of PPP only. If the three hypotheses cannot be met together for given AAA and bbb, the statement is vacuous for those data.
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