Index of theproofnetwork/open-problems@860a535/Prove2Me/Definitions/Def_Polyhedron.lean
qedmarket’s copy of theproofnetwork/open-problems@860a535, 30 Nov 2026original source ↗
/-From Prove2Me, definition `Polyhedron` (https://prove2.me/definitions/d3bc1c62-c930-489a-ac94-8c60c04604ce). Apache-2.0 per Prove2Me's terms.-/import Mathlib.Data.Matrix.Mulimport Mathlib.Data.EReal.Basicimport Mathlib.Order.ConditionallyCompleteLattice.Indexed /-!Core polyhedron / linear-program definitions. Source: Bertsimas & Tsitsiklis, *Introduction to Linear Optimization*,Athena Scientific 1997 — Definition 2.1 (polyhedron, p. 42), §1.1/§2.1(standard-form polyhedron), Definition 2.2 (bounded, p. 43), and theinfeasible / finite / unbounded optimal-cost trichotomy (p. 67, Table 4.2). Design (see CLAUDE.md): vectors are `Fin n → ℝ`, constraints via`Matrix.mulVec`; the optimal cost lives in `EReal` so that `⊤` = infeasibleand `⊥` = unbounded — never an ℝ-valued `sInf` (whose `sInf ∅ = 0` junkfalsifies the book's statements).-/ open Matrix namespace LinearOptimization /-- **B&T Definition 2.1 (p. 42).** The polyhedron in general form determined by aconstraint matrix `A` and right-hand side `b`: the set `{x | Ax ≥ b}`. -/def polyhedron {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) (b : Fin m → ℝ) : Set (Fin n → ℝ) := {x | b ≤ A.mulVec x} /-- **B&T §2.1 (p. 42).** The polyhedron in standard form: `{x | Ax = b, x ≥ 0}`. -/def stdPolyhedron {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) (b : Fin m → ℝ) : Set (Fin n → ℝ) := {x | A.mulVec x = b ∧ 0 ≤ x} /-- **B&T Definition 2.2 (p. 43).** A set is bounded if it is contained in abox `[-K, K]^n` for some `K`. (Equivalent to Mathlib's `Bornology.IsBounded`;stated in the book's elementary form.) -/def IsBoundedSet {n : ℕ} (S : Set (Fin n → ℝ)) : Prop := ∃ K : ℝ, ∀ x ∈ S, ∀ i, |x i| ≤ K /-- The optimal cost of the linear program `minimize c'x subject to x ∈ S`,valued in `EReal`: `⊤` iff `S = ∅` (infeasible), `⊥` iff the cost isunbounded below. This total function encodes the book's trichotomy(B&T p. 67 and Table 4.2, p. 151). -/noncomputable def lpValue {n : ℕ} (c : Fin n → ℝ) (S : Set (Fin n → ℝ)) : EReal := ⨅ x ∈ S, ((c ⬝ᵥ x : ℝ) : EReal) /-- `x` is an optimal solution of `minimize c'x over S`. -/def IsLpOptimal {n : ℕ} (c : Fin n → ℝ) (S : Set (Fin n → ℝ)) (x : Fin n → ℝ) : Prop := x ∈ S ∧ ∀ y ∈ S, c ⬝ᵥ x ≤ c ⬝ᵥ y end LinearOptimization