Oracle, Case I: local improvement directions from and global optimality (corrected objective)
ProvedMegiddoLP.FixedDim.oracle_caseIConsider the linear program minimize subject to in the variables , and the hyperplane . Let be an optimal solution relative to the hyperplane: is feasible, , and for every feasible with . Let be the set of constraints tight at . Consider the two auxiliary systems
and say that has a solution with negative value if some solution has . Then:
- there is a feasible with and if and only if has a solution with negative value;
- there is a feasible with and if and only if has a solution with negative value;
- and do not both have solutions with negative value;
- if neither has, then is an optimal solution of the original program.
This tells the oracle on which side of the optimum lies, or that is already optimal, by solving problems in free variables.
Formalization Note (corrected) The page writes the auxiliary objective as . The direction has , so its cost is , and with the printed objective parts 1 and 2 fail whenever . The Lean uses , which includes the term. The paper's is the last coordinate Fin.last d of Fin (d + 1), so Lean's is the paper's . The hypothesis on is optimality among feasible points of the hyperplane, not global optimality.
import Mathlib import Definitions.Def_Polyhedron
/-!
Megiddo, J. ACM 31 (1984), §4 p. 124, Case I 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}`. The auxiliary
objective is `c ⬝ᵥ z` with `z_d = ±1`, i.e. the page's `Σ_{j<d} c_j z_j` corrected by the term
`± c_d`.
-/
open Matrix LinearOptimization
namespace MegiddoLP.FixedDim
/-- **Oracle, Case I.** Let `x*` be optimal for `minimize cᵀx` over the feasible points of
`Ax ≥ b` lying on `{x_d = 0}`, and let `I = {i | Aᵢ ⬝ᵥ x* = bᵢ}`. Then
1. some feasible `y` with `y_d > 0` has `cᵀy < cᵀx*` iff some `z` with `z_d = 1`,
`Aᵢ ⬝ᵥ z ≥ 0` for `i ∈ I` has `cᵀz < 0`;
2. the same with `y_d < 0` and `z_d = -1`;
3. the two auxiliary systems of 1 and 2 do not both have a solution of negative value;
4. if neither does, `x*` is optimal for the original program. -/
theorem oracle_caseI {n d : ℕ} (A : Matrix (Fin n) (Fin (d + 1)) ℝ) (b : Fin n → ℝ)
(c xs : Fin (d + 1) → ℝ)
(hxs : IsLpOptimal c (polyhedron A b ∩ {x | x (Fin.last d) = 0}) xs) :
((∃ y ∈ polyhedron A b, 0 < y (Fin.last d) ∧ c ⬝ᵥ y < c ⬝ᵥ xs) ↔
∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = 1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0) ∧
((∃ y ∈ polyhedron A b, y (Fin.last d) < 0 ∧ c ⬝ᵥ y < c ⬝ᵥ xs) ↔
∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = -1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0) ∧
¬ ((∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = 1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0) ∧
(∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = -1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0)) ∧
((¬ ∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = 1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0) →
(¬ ∃ z : Fin (d + 1) → ℝ, z (Fin.last d) = -1 ∧
(∀ i, A i ⬝ᵥ xs = b i → 0 ≤ A i ⬝ᵥ z) ∧ c ⬝ᵥ z < 0) →
IsLpOptimal c (polyhedron A b) xs) := by sorry
end MegiddoLP.FixedDim
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let , let be a real matrix with rows , and let . Let . Write for the last coordinate of a vector in .
Imported notions. and "LP-optimal for over a set " come from an imported file whose text is not included here. Their names suggest and optimality of on .
Hypothesis. is LP-optimal for over .
Auxiliary sets. Let . Define the two statements
Claim. All four of the following hold:
- There is with and if and only if holds.
- There is with and if and only if holds.
- and do not both hold.
- If neither nor holds, then is LP-optimal for over all of .
Degenerate cases.
- No such . If no satisfies the hypothesis under the unseen definition, the statement is vacuous for all data.
- . is empty, so reduce to the existence of with and . The meaning of when is fixed by the unseen definition.
- . The space is and the slice is the single point .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.