The areas / V07. Linear algebra
Mathlib.LinearAlgebra.Matrix.Determinant.TotallyUnimodular
23 declarations. Mathlib docs · Source
Totally unimodular matrices
This file defines totally unimodular matrices and provides basic API for them.
Main definitions
Matrix.IsTotallyUnimodular: a matrix is totally unimodular iff every square submatrix (not necessarily contiguous) has determinant0or1or-1.
Main results
Matrix.isTotallyUnimodular_iff: a matrix is totally unimodular iff every square submatrix (possibly with repeated rows and/or repeated columns) has determinant0or1or-1.Matrix.IsTotallyUnimodular.apply: entry in a totally unimodular matrix is0or1or-1.
def Matrix.IsTotallyUnimodular E3 #
{m : Type u_1} → {n : Type u_3} → {R : Type u_5} → [CommRing R] → Matrix m n R → Prop
A.IsTotallyUnimodular means that every square submatrix of A (not necessarily contiguous)
has determinant 0 or 1 or -1; that is, the determinant is in the range of SignType.cast.
theorem Matrix.isTotallyUnimodular_iff E3 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R),
A.IsTotallyUnimodular ↔ ∀ (k : ℕ) (f : Fin k → m) (g : Fin k → n), (A.submatrix f g).det ∈ Set.range SignType.cast
theorem Matrix.isTotallyUnimodular_iff_fintype E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R),
A.IsTotallyUnimodular ↔
∀ (ι : Type w) [inst_1 : Fintype ι] [inst_2 : DecidableEq ι] (f : ι → m) (g : ι → n),
(A.submatrix f g).det ∈ Set.range SignType.cast
theorem Matrix.IsTotallyUnimodular.apply E3 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] {A : Matrix m n R},
A.IsTotallyUnimodular → ∀ (i : m) (j : n), A i j ∈ Set.range SignType.cast
theorem Matrix.IsTotallyUnimodular.submatrix E1 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {n' : Type u_4} {R : Type u_5} [inst : CommRing R] {A : Matrix m n R}
(f : m' → m) (g : n' → n), A.IsTotallyUnimodular → (A.submatrix f g).IsTotallyUnimodular
theorem Matrix.IsTotallyUnimodular.transpose E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] {A : Matrix m n R},
A.IsTotallyUnimodular → A.transpose.IsTotallyUnimodular
theorem Matrix.transpose_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R),
A.transpose.IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.IsTotallyUnimodular.reindex E1 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {n' : Type u_4} {R : Type u_5} [inst : CommRing R] {A : Matrix m n R}
(em : m ≃ m') (en : n ≃ n'), A.IsTotallyUnimodular → ((Matrix.reindex em en) A).IsTotallyUnimodular
theorem Matrix.reindex_isTotallyUnimodular E1 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {n' : Type u_4} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R)
(em : m ≃ m') (en : n ≃ n'), ((Matrix.reindex em en) A).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.emptyRows_isTotallyUnimodular E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [IsEmpty m] (A : Matrix m n R), A.IsTotallyUnimodular
If A has no rows, then it is totally unimodular.
theorem Matrix.emptyCols_isTotallyUnimodular E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [IsEmpty n] (A : Matrix m n R), A.IsTotallyUnimodular
If A has no columns, then it is totally unimodular.
theorem Matrix.IsTotallyUnimodular.fromRows_unitlike E1 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n]
{A : Matrix m n R} {B : Matrix m' n R},
A.IsTotallyUnimodular → (Nonempty n → ∀ (i : m'), ∃ j s, B i = Pi.single j ↑s) → (A.fromRows B).IsTotallyUnimodular
If A is totally unimodular and each row of B is all zeros except for at most a single 1 or
a single -1 then fromRows A B is totally unimodular.
theorem Matrix.fromRows_isTotallyUnimodular_iff_rows E1 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n]
{A : Matrix m n R} {B : Matrix m' n R},
(Nonempty n → ∀ (i : m'), ∃ j s, B i = Pi.single j ↑s) → ((A.fromRows B).IsTotallyUnimodular ↔ A.IsTotallyUnimodular)
If A is totally unimodular and each row of B is all zeros except for at most a single 1,
then fromRows A B is totally unimodular.
theorem Matrix.fromRows_one_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n] (A : Matrix m n R),
(A.fromRows 1).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.one_fromRows_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n] (A : Matrix m n R),
(Matrix.fromRows 1 A).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.fromCols_one_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq m] (A : Matrix m n R),
(A.fromCols 1).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.one_fromCols_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq m] (A : Matrix m n R),
(Matrix.fromCols 1 A).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.IsTotallyUnimodular.fromRows_one E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n] (A : Matrix m n R),
A.IsTotallyUnimodular → (A.fromRows 1).IsTotallyUnimodular
Alias of the reverse direction of Matrix.fromRows_one_isTotallyUnimodular_iff.
theorem Matrix.IsTotallyUnimodular.one_fromRows E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq n] (A : Matrix m n R),
A.IsTotallyUnimodular → (Matrix.fromRows 1 A).IsTotallyUnimodular
Alias of the reverse direction of Matrix.one_fromRows_isTotallyUnimodular_iff.
theorem Matrix.IsTotallyUnimodular.fromCols_one E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq m] (A : Matrix m n R),
A.IsTotallyUnimodular → (A.fromCols 1).IsTotallyUnimodular
Alias of the reverse direction of Matrix.fromCols_one_isTotallyUnimodular_iff.
theorem Matrix.IsTotallyUnimodular.one_fromCols E1 #
∀ {m : Type u_1} {n : Type u_3} {R : Type u_5} [inst : CommRing R] [inst_1 : DecidableEq m] (A : Matrix m n R),
A.IsTotallyUnimodular → (Matrix.fromCols 1 A).IsTotallyUnimodular
Alias of the reverse direction of Matrix.one_fromCols_isTotallyUnimodular_iff.
theorem Matrix.fromRows_replicateRow0_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {m' : Type u_2} {n : Type u_3} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R),
(A.fromRows (Matrix.replicateRow m' 0)).IsTotallyUnimodular ↔ A.IsTotallyUnimodular
theorem Matrix.fromCols_replicateCol0_isTotallyUnimodular_iff E0 #
∀ {m : Type u_1} {n : Type u_3} {n' : Type u_4} {R : Type u_5} [inst : CommRing R] (A : Matrix m n R),
(A.fromCols (Matrix.replicateCol n' 0)).IsTotallyUnimodular ↔ A.IsTotallyUnimodular