Documentation

Mathlib.Data.Matrix.Rank

Rank of matrices #

The rank of a matrix A is defined to be the rank of range of the linear map corresponding to A. This definition does not depend on the choice of basis, see Matrix.rank_eq_finrank_range_toLin.

Main declarations #

TODO #

noncomputable def Matrix.rank {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] (A : Matrix m n R) :

The rank of a matrix is the rank of its image.

Equations
Instances For
    @[simp]
    @[simp]
    theorem Matrix.rank_zero {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [Nontrivial R] :
    theorem Matrix.rank_le_card_width {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [StrongRankCondition R] (A : Matrix m n R) :
    theorem Matrix.rank_le_width {R : Type u_5} [CommRing R] [StrongRankCondition R] {m : } {n : } (A : Matrix (Fin m) (Fin n) R) :
    theorem Matrix.rank_mul_le_left {m : Type u_2} {n : Type u_3} {o : Type u_4} {R : Type u_5} [Fintype n] [Fintype o] [CommRing R] [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
    theorem Matrix.rank_mul_le_right {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_5} [m_fin : Fintype m] [Fintype n] [CommRing R] [StrongRankCondition R] (A : Matrix l m R) (B : Matrix m n R) :
    theorem Matrix.rank_mul_le {m : Type u_2} {n : Type u_3} {o : Type u_4} {R : Type u_5} [Fintype n] [Fintype o] [CommRing R] [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
    theorem Matrix.rank_unit {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [StrongRankCondition R] [DecidableEq n] (A : (Matrix n n R)ˣ) :
    theorem Matrix.rank_of_isUnit {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [StrongRankCondition R] [DecidableEq n] (A : Matrix n n R) (h : IsUnit A) :
    theorem Matrix.rank_mul_eq_left_of_isUnit_det {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [DecidableEq n] (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit (Matrix.det A)) :

    Right multiplying by an invertible matrix does not change the rank

    theorem Matrix.rank_mul_eq_right_of_isUnit_det {m : Type u_2} {n : Type u_3} {R : Type u_5} [m_fin : Fintype m] [Fintype n] [CommRing R] [DecidableEq m] (A : Matrix m m R) (B : Matrix m n R) (hA : IsUnit (Matrix.det A)) :

    Left multiplying by an invertible matrix does not change the rank

    theorem Matrix.rank_submatrix_le {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [StrongRankCondition R] [Fintype m] (f : nm) (e : n m) (A : Matrix m m R) :

    Taking a subset of the rows and permuting the columns reduces the rank.

    theorem Matrix.rank_reindex {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [Fintype m] (e₁ : m n) (e₂ : m n) (A : Matrix m m R) :
    @[simp]
    theorem Matrix.rank_submatrix {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [CommRing R] [Fintype m] (A : Matrix m m R) (e₁ : n m) (e₂ : n m) :
    theorem Matrix.rank_eq_finrank_range_toLin {m : Type u_2} {n : Type u_3} {R : Type u_5} [m_fin : Fintype m] [Fintype n] [CommRing R] [DecidableEq n] {M₁ : Type u_6} {M₂ : Type u_7} [AddCommGroup M₁] [AddCommGroup M₂] [Module R M₁] [Module R M₂] (A : Matrix m n R) (v₁ : Basis m R M₁) (v₂ : Basis n R M₂) :
    theorem Matrix.rank_le_card_height {m : Type u_2} {n : Type u_3} {R : Type u_5} [m_fin : Fintype m] [Fintype n] [CommRing R] [StrongRankCondition R] (A : Matrix m n R) :
    theorem Matrix.rank_le_height {R : Type u_5} [CommRing R] [StrongRankCondition R] {m : } {n : } (A : Matrix (Fin m) (Fin n) R) :

    The rank of a matrix is the rank of the space spanned by its columns.

    theorem Matrix.rank_diagonal {m : Type u_2} {R : Type u_5} [m_fin : Fintype m] [Field R] [DecidableEq m] [DecidableEq R] (w : mR) :

    The rank of a diagnonal matrix is the count of non-zero elements on its main diagonal

    Lemmas about transpose and conjugate transpose #

    This section contains lemmas about the rank of Matrix.transpose and Matrix.conjTranspose.

    Unfortunately the proofs are essentially duplicated between the two; is a linearly-ordered ring but can't be a star-ordered ring, while is star-ordered (with open ComplexOrder) but not linearly ordered. For now we don't prove the transpose case for .

    TODO: the lemmas Matrix.rank_transpose and Matrix.rank_conjTranspose current follow a short proof that is a simple consequence of Matrix.rank_transpose_mul_self and Matrix.rank_conjTranspose_mul_self. This proof pulls in unnecessary assumptions on R, and should be replaced with a proof that uses Gaussian reduction or argues via linear combinations.

    @[simp]
    theorem Matrix.rank_conjTranspose {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [Fintype m] [Field R] [PartialOrder R] [StarOrderedRing R] (A : Matrix m n R) :

    TODO: prove this in greater generality.

    @[simp]
    @[simp]
    theorem Matrix.rank_transpose {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [Fintype m] [LinearOrderedField R] (A : Matrix m n R) :

    TODO: prove this in greater generality.

    @[simp]
    theorem Matrix.rank_self_mul_transpose {m : Type u_2} {n : Type u_3} {R : Type u_5} [Fintype n] [Fintype m] [LinearOrderedField R] (A : Matrix m n R) :

    The rank of a matrix is the rank of the space spanned by its rows.

    TODO: prove this in a generality that works for too, not just and .