Documentation

CslibFrontier.Foundations.LinearAlgebra.Matrix.Vertex

Vertices of polyhedra given by inequality systems #

For a matrix A : Matrix κ ι K and a vector b : κ → K over a linearly ordered field, consider the polyhedron {x | A *ᵥ x ≤ b}. The rows that hold with equality at x are its tight rows (Matrix.tightRows), and x is a vertex (Matrix.IsVertex) if it is feasible and the normals of its tight rows span the dual space, that is, only v = 0 satisfies (A *ᵥ v) k = 0 on every tight row k. This is the algebraic description of a vertex (a basic feasible solution): a feasible point is the unique point of a 0-dimensional face exactly when its tight rows have full rank ([Sch86], Section 8.5; [Zie95], Lecture 2).

The system is nondegenerate (Matrix.IsNondegenerateSystem) if no feasible point has more than card ι tight rows; then every vertex has exactly card ι tight rows. A bounded nondegenerate polyhedron is simple, and its graph has a purely combinatorial description, which is what the Lemke–Howson algorithm walks on. Under nondegeneracy and the boundedness hypothesis ∀ v, A *ᵥ v ≤ 0 → v = 0 (the recession cone is trivial):

Vertices are determined by their tight rows (Matrix.IsVertex.eq_of_tightRows_subset), so a polyhedron has finitely many vertices (Matrix.setOf_isVertex_finite).

Main definitions #

Main results #

References #

def Matrix.tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] (A : Matrix κ ι K) (b : κ → K) (x : ι → K) :

The rows of the system A *ᵥ x ≤ b that are tight (hold with equality) at x.

def Matrix.IsVertex {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] (A : Matrix κ ι K) (b : κ → K) (x : ι → K) :

x is a vertex (basic feasible solution) of the polyhedron {x | A *ᵥ x ≤ b}: it is feasible, and the only vector orthogonal to the normals of all its tight rows is 0.

def Matrix.IsNondegenerateSystem {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] (A : Matrix κ ι K) (b : κ → K) :

The system A *ᵥ x ≤ b is nondegenerate if no feasible point has more than card ι tight rows.

def Matrix.VertexAdj {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] [DecidableEq κ] (A : Matrix κ ι K) (b : κ → K) (x y : ι → K) :

Two vertices of A *ᵥ x ≤ b are adjacent if they are distinct and share at least card ι - 1 tight rows. For a bounded nondegenerate system adjacent pairs correspond to the edges of the polyhedron ([Sch86], Section 8.5); that geometric statement is not formalized here. What is proved is the pivot characterization Matrix.vertexAdj_iff_exists_pivotVertex.

@[simp]
theorem Matrix.mem_tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} {k : κ} :
k ∈ A.tightRows b x ↔ A.mulVec x k = b k
theorem Matrix.isVertex_iff {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} :
A.IsVertex b x ↔ A.mulVec x ≤ b ∧ ∀ (v : ι → K), (∀ k ∈ A.tightRows b x, A.mulVec v k = 0) → v = 0
theorem Matrix.isNondegenerateSystem_iff {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} :
A.IsNondegenerateSystem b ↔ ∀ (x : ι → K), A.mulVec x ≤ b → (A.tightRows b x).card ≤ Fintype.card ι
theorem Matrix.IsVertex.mulVec_le {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} (h : A.IsVertex b x) :
A.mulVec x ≤ b

A vertex is feasible.

theorem Matrix.vertexAdj_iff {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [DecidableEq κ] :
A.VertexAdj b x y ↔ A.IsVertex b x ∧ A.IsVertex b y ∧ x ≠ y ∧ Fintype.card ι ≤ (A.tightRows b x ∩ A.tightRows b y).card + 1
theorem Matrix.VertexAdj.symm {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [DecidableEq κ] (h : A.VertexAdj b x y) :
A.VertexAdj b y x
theorem Matrix.VertexAdj.ne {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [DecidableEq κ] (h : A.VertexAdj b x y) :
x ≠ y
theorem Matrix.IsVertex.card_le_card_tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} (h : A.IsVertex b x) :

A vertex has at least card ι tight rows.

theorem Matrix.IsVertex.eq_of_tightRows_subset {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} (hx : A.IsVertex b x) (h : A.tightRows b x ⊆ A.tightRows b y) :
y = x

A vertex is the only point of the polyhedron's affine space on which its tight rows are tight: if they are all tight at y, then y = x.

theorem Matrix.IsVertex.eq_of_tightRows_eq {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} (hx : A.IsVertex b x) (h : A.tightRows b x = A.tightRows b y) :
x = y

A vertex is determined by its set of tight rows.

theorem Matrix.setOf_isVertex_finite {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} :
{x : ι → K | A.IsVertex b x}.Finite

A polyhedron has finitely many vertices.

theorem Matrix.IsVertex.card_tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} (hnd : A.IsNondegenerateSystem b) (hx : A.IsVertex b x) :

In a nondegenerate system, every vertex has exactly card ι tight rows.

theorem Matrix.tightRows_submatrix_equiv {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {κ' : Type u_4} [Fintype κ'] (e : κ' ≃ κ) (A : Matrix κ ι K) (b : κ → K) (x : ι → K) :
(A.submatrix (⇑e) id).tightRows (b ∘ ⇑e) x = Finset.map e.symm.toEmbedding (A.tightRows b x)

Permuting the rows of A *ᵥ x ≤ b by e : κ' ≃ κ permutes the tight rows by e.symm.

theorem Matrix.isVertex_submatrix_equiv {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} {κ' : Type u_4} [Fintype κ'] (e : κ' ≃ κ) :
(A.submatrix (⇑e) id).IsVertex (b ∘ ⇑e) x ↔ A.IsVertex b x

Permuting the rows of A *ᵥ x ≤ b by an equivalence preserves vertices.

theorem Matrix.isNondegenerateSystem_submatrix_equiv {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {κ' : Type u_4} [Fintype κ'] (e : κ' ≃ κ) :

Permuting the rows of A *ᵥ x ≤ b by an equivalence preserves nondegeneracy.

theorem Matrix.IsVertex.notMem_tightRows_of_erase_subset {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [DecidableEq κ] (hx : A.IsVertex b x) {l : κ} (hyx : y ≠ x) (hyT : (A.tightRows b x).erase l ⊆ A.tightRows b y) :
l ∉ A.tightRows b y

If a point y ≠ x keeps all tight rows of the vertex x except l tight, then l is not tight at y.

theorem Matrix.exists_tight_add_smul {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] [Finite κ] (hx : A.mulVec x ≤ b) {v : ι → K} {c : κ} (hc : 0 < A.mulVec v c) :
∃ (t : K) (c : κ), 0 < A.mulVec v c ∧ A.mulVec (x + t • v) ≤ b ∧ A.mulVec (x + t • v) c = b c

Ray shooting, the minimum ratio test: from a feasible x, moving in a direction v that increases some row, the largest feasible step t makes some row c with 0 < (A *ᵥ v) c tight.

theorem Matrix.isVertex_of_card_tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.mulVec x ≤ b) (hcard : Fintype.card ι ≤ (A.tightRows b x).card) :
A.IsVertex b x

In a bounded nondegenerate system, a feasible point with at least card ι tight rows is a vertex.

theorem Matrix.isVertex_iff_card_tightRows {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) :

The vertices of a bounded nondegenerate system are its feasible points with exactly card ι tight rows.

theorem Matrix.IsVertex.exists_pivot {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] [DecidableEq κ] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) {l : κ} (hl : l ∈ A.tightRows b x) :
∃ (y : ι → K), A.IsVertex b y ∧ y ≠ x ∧ (A.tightRows b x).erase l ⊆ A.tightRows b y

Pivoting, existence. In a bounded nondegenerate system, for every tight row l of a vertex x there is another vertex at which all other tight rows of x stay tight.

theorem Matrix.IsVertex.eq_of_erase_subset {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [IsStrictOrderedRing K] [DecidableEq κ] (hnd : A.IsNondegenerateSystem b) (hx : A.IsVertex b x) {l : κ} (hl : l ∈ A.tightRows b x) {z : ι → K} (hy : A.IsVertex b y) (hyx : y ≠ x) (hyT : (A.tightRows b x).erase l ⊆ A.tightRows b y) (hz : A.IsVertex b z) (hzx : z ≠ x) (hzT : (A.tightRows b x).erase l ⊆ A.tightRows b z) :
z = y

Pivoting, uniqueness. In a nondegenerate system, there is at most one vertex y ≠ x at which all tight rows of the vertex x other than l stay tight.

noncomputable def Matrix.pivotVertex {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] (A : Matrix κ ι K) (b : κ → K) (x : ι → K) (l : κ) :
ι → K

The vertex reached from the vertex x by dropping its tight row l: the other vertex at which all tight rows of x except l are tight. For a bounded nondegenerate system it exists and is unique (Matrix.IsVertex.pivotVertex_spec, Matrix.IsVertex.eq_pivotVertex); otherwise the value is unspecified.

theorem Matrix.IsVertex.pivotVertex_spec {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] [DecidableEq κ] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) {l : κ} (hl : l ∈ A.tightRows b x) :
A.IsVertex b (A.pivotVertex b x l) ∧ A.pivotVertex b x l ≠ x ∧ (A.tightRows b x).erase l ⊆ A.tightRows b (A.pivotVertex b x l)

The pivot is a vertex different from x that keeps all tight rows of x except l.

theorem Matrix.IsVertex.eq_pivotVertex {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [IsStrictOrderedRing K] [DecidableEq κ] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) {l : κ} (hl : l ∈ A.tightRows b x) (hy : A.IsVertex b y) (hyx : y ≠ x) (hyT : (A.tightRows b x).erase l ⊆ A.tightRows b y) :
y = A.pivotVertex b x l

Every vertex y ≠ x keeping all tight rows of x except l is the pivot.

theorem Matrix.IsVertex.notMem_tightRows_pivotVertex {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) {l : κ} (hl : l ∈ A.tightRows b x) :
l ∉ A.tightRows b (A.pivotVertex b x l)

The dropped row is not tight at the pivot.

theorem Matrix.vertexAdj_iff_exists_pivotVertex {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x y : ι → K} [IsStrictOrderedRing K] [DecidableEq κ] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) :
A.VertexAdj b x y ↔ ∃ l ∈ A.tightRows b x, y = A.pivotVertex b x l

In a bounded nondegenerate system, the neighbours of a vertex x are exactly its pivots.

theorem Matrix.IsVertex.pivotVertex_injOn {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] {A : Matrix κ ι K} {b : κ → K} {x : ι → K} [IsStrictOrderedRing K] (hnd : A.IsNondegenerateSystem b) (hrec : ∀ (v : ι → K), A.mulVec v ≤ 0 → v = 0) (hx : A.IsVertex b x) :
Set.InjOn (A.pivotVertex b x) ↑(A.tightRows b x)

Dropping different tight rows of a vertex leads to different pivots.