Documentation

Mathlib.LinearAlgebra.Matrix.Reindex

Changing the index type of a matrix #

This file concerns the map Matrix.reindex, mapping a m by n matrix to an m' by n' matrix, as long as m ≃ m' and n ≃ n'.

Main definitions #

Tags #

matrix, reindex

def Matrix.reindexAddEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) [Add R] (eₘ : m m') (eₙ : n n') :
Matrix m n R ≃+ Matrix m' n' R

Matrix.reindex as an AddEquiv between R-matrices.

Equations
Instances For
    @[simp]
    theorem Matrix.coe_reindexAddEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) [Add R] (eₘ : m m') (eₙ : n n') :
    (reindexAddEquiv R eₘ eₙ) = (reindex eₘ eₙ)
    @[simp]
    theorem Matrix.toEquiv_reindexAddEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) [Add R] (eₘ : m m') (eₙ : n n') :
    (reindexAddEquiv R eₘ eₙ) = reindex eₘ eₙ
    @[simp]
    theorem Matrix.symm_reindexAddEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) [Add R] (eₘ : m m') (eₙ : n n') :
    (reindexAddEquiv R eₘ eₙ).symm = reindexAddEquiv R eₘ.symm eₙ.symm
    @[simp]
    theorem Matrix.reindexAddEquiv_refl_refl {m : Type u_2} {n : Type u_3} (R : Type u_11) [Add R] :
    @[simp]
    theorem Matrix.reindexAddEquiv_trans_reindexAddEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} {m'' : Type u_9} {n'' : Type u_10} (R : Type u_11) [Add R] (e₁ : m m') (e₂ : n n') (e₁' : m' m'') (e₂' : n' n'') :
    (reindexAddEquiv R e₁ e₂).trans (reindexAddEquiv R e₁' e₂') = reindexAddEquiv R (e₁.trans e₁') (e₂.trans e₂')
    def Matrix.reindexRingEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) [Fintype m] [Fintype n] [Mul R] [AddCommMonoid R] (e : m n) :
    Matrix m m R ≃+* Matrix n n R

    Matrix.reindex as a RingEquiv between R-matrices.

    Equations
    Instances For
      @[simp]
      theorem Matrix.coe_reindexRingEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) [Fintype m] [Fintype n] [Mul R] [AddCommMonoid R] (e : m n) :
      (reindexRingEquiv R e) = (reindex e e)
      @[simp]
      theorem Matrix.toEquiv_reindexRingEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) [Fintype m] [Fintype n] [Mul R] [AddCommMonoid R] (e : m n) :
      @[simp]
      theorem Matrix.toAddEquiv_reindexRingEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) [Fintype m] [Fintype n] [Mul R] [AddCommMonoid R] (e : m n) :
      @[simp]
      theorem Matrix.symm_reindexRingEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) [Fintype m] [Fintype n] [Mul R] [AddCommMonoid R] (e : m n) :
      @[simp]
      theorem Matrix.reindexRingEquiv_trans_reindexRingEquiv {m : Type u_2} {n : Type u_3} {o : Type u_4} (R : Type u_11) [Fintype m] [Fintype n] [Fintype o] [Mul R] [AddCommMonoid R] (e : m n) (e' : n o) :
      def Matrix.reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
      Matrix m n A ≃ₗ[R] Matrix m' n' A

      The natural map that reindexes a matrix's rows and columns with equivalent types, Matrix.reindex, is a linear equivalence.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem Matrix.coe_reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
        (reindexLinearEquiv R A eₘ eₙ) = (reindex eₘ eₙ)
        @[simp]
        theorem Matrix.toEquiv_reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
        (reindexLinearEquiv R A eₘ eₙ) = reindex eₘ eₙ
        @[simp]
        theorem Matrix.toAddEquiv_reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
        (reindexLinearEquiv R A eₘ eₙ) = reindexAddEquiv A eₘ eₙ
        @[deprecated Matrix.coe_reindexLinearEquiv (since := "2026-06-06")]
        theorem Matrix.reindexLinearEquiv_apply {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') (M : Matrix m n A) :
        (reindexLinearEquiv R A eₘ eₙ) M = (reindex eₘ eₙ) M
        @[simp]
        theorem Matrix.symm_reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
        (reindexLinearEquiv R A eₘ eₙ).symm = reindexLinearEquiv R A eₘ.symm eₙ.symm
        @[deprecated Matrix.symm_reindexLinearEquiv (since := "2026-06-06")]
        theorem Matrix.reindexLinearEquiv_symm {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (eₘ : m m') (eₙ : n n') :
        (reindexLinearEquiv R A eₘ eₙ).symm = reindexLinearEquiv R A eₘ.symm eₙ.symm

        Alias of Matrix.symm_reindexLinearEquiv.

        @[simp]
        theorem Matrix.reindexLinearEquiv_refl_refl {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] :
        @[simp]
        theorem Matrix.reindexLinearEquiv_trans_reindexLinearEquiv {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} {m'' : Type u_9} {n'' : Type u_10} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (e₁ : m m') (e₂ : n n') (e₁' : m' m'') (e₂' : n' n'') :
        reindexLinearEquiv R A e₁ e₂ ≪≫ₗ reindexLinearEquiv R A e₁' e₂' = reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')
        @[deprecated Matrix.reindexLinearEquiv_trans_reindexLinearEquiv (since := "2026-06-06")]
        theorem Matrix.reindexLinearEquiv_trans {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} {m'' : Type u_9} {n'' : Type u_10} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (e₁ : m m') (e₂ : n n') (e₁' : m' m'') (e₂' : n' n'') :
        reindexLinearEquiv R A e₁ e₂ ≪≫ₗ reindexLinearEquiv R A e₁' e₂' = reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')

        Alias of Matrix.reindexLinearEquiv_trans_reindexLinearEquiv.

        theorem Matrix.reindexLinearEquiv_comp {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} {m'' : Type u_9} {n'' : Type u_10} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (e₁ : m m') (e₂ : n n') (e₁' : m' m'') (e₂' : n' n'') :
        (reindexLinearEquiv R A e₁' e₂') (reindexLinearEquiv R A e₁ e₂) = (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂'))
        theorem Matrix.reindexLinearEquiv_comp_apply {m : Type u_2} {n : Type u_3} {m' : Type u_6} {n' : Type u_7} {m'' : Type u_9} {n'' : Type u_10} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] (e₁ : m m') (e₂ : n n') (e₁' : m' m'') (e₂' : n' n'') (M : Matrix m n A) :
        (reindexLinearEquiv R A e₁' e₂') ((reindexLinearEquiv R A e₁ e₂) M) = (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')) M
        theorem Matrix.reindexLinearEquiv_one {m : Type u_2} {m' : Type u_6} (R : Type u_11) (A : Type u_12) [Semiring R] [AddCommMonoid A] [Module R A] [DecidableEq m] [DecidableEq m'] [One A] (e : m m') :
        (reindexLinearEquiv R A e e) 1 = 1
        theorem Matrix.reindexLinearEquiv_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {m' : Type u_6} {n' : Type u_7} {o' : Type u_8} (R : Type u_11) (A : Type u_12) [Semiring R] [Semiring A] [Module R A] [Fintype n] [Fintype n'] (eₘ : m m') (eₙ : n n') (eₒ : o o') (M : Matrix m n A) (N : Matrix n o A) :
        (reindexLinearEquiv R A eₘ eₙ) M * (reindexLinearEquiv R A eₙ eₒ) N = (reindexLinearEquiv R A eₘ eₒ) (M * N)
        theorem Matrix.mul_reindexLinearEquiv_one {m : Type u_2} {n : Type u_3} {o : Type u_4} {n' : Type u_7} (R : Type u_11) (A : Type u_12) [Semiring R] [Semiring A] [Module R A] [Fintype n] [DecidableEq o] (e₁ : o n) (e₂ : o n') (M : Matrix m n A) :
        M * (reindexLinearEquiv R A e₁ e₂) 1 = (reindexLinearEquiv R A (Equiv.refl m) (e₁.symm.trans e₂)) M
        def Matrix.reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
        Matrix m m A ≃ₐ[R] Matrix n n A

        For square matrices with coefficients in an algebra over a commutative semiring, the natural map that reindexes a matrix's rows and columns with equivalent types, Matrix.reindex, is an equivalence of algebras.

        Equations
        Instances For
          @[simp]
          theorem Matrix.coe_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          (reindexAlgEquiv R A e) = (reindex e e)
          @[simp]
          theorem Matrix.toEquiv_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          (reindexAlgEquiv R A e) = reindex e e
          @[simp]
          theorem Matrix.toAddEquiv_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          @[simp]
          theorem Matrix.toRingEquiv_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          @[simp]
          theorem Matrix.toLinearEquiv_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          @[deprecated Matrix.coe_reindexAlgEquiv (since := "2026-06-06")]
          theorem Matrix.reindexAlgEquiv_apply {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) (M : Matrix m m A) :
          (reindexAlgEquiv R A e) M = (reindex e e) M
          @[simp]
          theorem Matrix.symm_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :
          @[deprecated Matrix.symm_reindexAlgEquiv (since := "2026-06-06")]
          theorem Matrix.reindexAlgEquiv_symm {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) :

          Alias of Matrix.symm_reindexAlgEquiv.

          @[simp]
          theorem Matrix.reindexAlgEquiv_refl {m : Type u_2} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype m] [DecidableEq m] [Semiring A] [Algebra R A] :
          @[simp]
          theorem Matrix.reindexAlgEquiv_trans_reindexAlgEquiv {m : Type u_2} {n : Type u_3} {o : Type u_4} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [Fintype o] [DecidableEq m] [DecidableEq n] [DecidableEq o] [Semiring A] [Algebra R A] (e : m n) (e' : n o) :
          @[deprecated map_mul (since := "2026-06-06")]
          theorem Matrix.reindexAlgEquiv_mul {m : Type u_2} {n : Type u_3} (R : Type u_11) (A : Type u_12) [CommSemiring R] [Fintype n] [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring A] [Algebra R A] (e : m n) (M N : Matrix m m A) :
          (reindexAlgEquiv R A e) (M * N) = (reindexAlgEquiv R A e) M * (reindexAlgEquiv R A e) N
          theorem Matrix.det_reindexLinearEquiv_self {m : Type u_2} {n : Type u_3} (R : Type u_11) [CommRing R] [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] (e : m n) (M : Matrix m m R) :
          ((reindexLinearEquiv R R e e) M).det = M.det

          Reindexing both indices along the same equivalence preserves the determinant.

          For the simp version of this lemma, see det_submatrix_equiv_self.

          theorem Matrix.det_reindexAlgEquiv {m : Type u_2} {n : Type u_3} (R : Type u_11) (B : Type u_13) [CommSemiring R] [CommRing B] [Algebra R B] [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] (e : m n) (A : Matrix m m B) :
          ((reindexAlgEquiv R B e) A).det = A.det

          Reindexing both indices along the same equivalence preserves the determinant.

          For the simp version of this lemma, see det_submatrix_equiv_self.