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 #
Matrix.reindexLinearEquiv R A
:Matrix.reindex
is anR
-linear equivalence betweenA
-matrices.Matrix.reindexAlgEquiv R
:Matrix.reindex
is anR
-algebra equivalence betweenR
-matrices.
Tags #
matrix, reindex
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')
:
The natural map that reindexes a matrix's rows and columns with equivalent types,
Matrix.reindex
, is a linear equivalence.
Equations
- Matrix.reindexLinearEquiv R A eₘ eₙ = let __src := Matrix.reindex eₘ eₙ; { toFun := __src.toFun, map_add' := ⋯, map_smul' := ⋯, invFun := __src.invFun, left_inv := ⋯, right_inv := ⋯ }
Instances For
@[simp]
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)
:
(Matrix.reindexLinearEquiv R A eₘ eₙ) M = (Matrix.reindex eₘ eₙ) M
@[simp]
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')
:
(Matrix.reindexLinearEquiv R A eₘ eₙ).symm = Matrix.reindexLinearEquiv R A eₘ.symm eₙ.symm
@[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]
:
Matrix.reindexLinearEquiv R A (Equiv.refl m) (Equiv.refl n) = LinearEquiv.refl R (Matrix m n A)
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'')
:
Matrix.reindexLinearEquiv R A e₁ e₂ ≪≫ₗ Matrix.reindexLinearEquiv R A e₁' e₂' = Matrix.reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')
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'')
:
⇑(Matrix.reindexLinearEquiv R A e₁' e₂') ∘ ⇑(Matrix.reindexLinearEquiv R A e₁ e₂) = ⇑(Matrix.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)
:
(Matrix.reindexLinearEquiv R A e₁' e₂') ((Matrix.reindexLinearEquiv R A e₁ e₂) M) = (Matrix.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')
:
(Matrix.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)
:
(Matrix.reindexLinearEquiv R A eₘ eₙ) M * (Matrix.reindexLinearEquiv R A eₙ eₒ) N = (Matrix.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 * (Matrix.reindexLinearEquiv R A e₁ e₂) 1 = (Matrix.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)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
(e : m ≃ n)
:
For square matrices with coefficients in commutative semirings, the natural map that reindexes
a matrix's rows and columns with equivalent types, Matrix.reindex
, is an equivalence of algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
Matrix.reindexAlgEquiv_apply
{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
(e : m ≃ n)
(M : Matrix m m R)
:
(Matrix.reindexAlgEquiv R e) M = (Matrix.reindex e e) M
@[simp]
theorem
Matrix.reindexAlgEquiv_symm
{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
(e : m ≃ n)
:
(Matrix.reindexAlgEquiv R e).symm = Matrix.reindexAlgEquiv R e.symm
@[simp]
theorem
Matrix.reindexAlgEquiv_refl
{m : Type u_2}
(R : Type u_11)
[CommSemiring R]
[Fintype m]
[DecidableEq m]
:
Matrix.reindexAlgEquiv R (Equiv.refl m) = AlgEquiv.refl
theorem
Matrix.reindexAlgEquiv_mul
{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
(e : m ≃ n)
(M : Matrix m m R)
(N : Matrix m m R)
:
(Matrix.reindexAlgEquiv R e) (M * N) = (Matrix.reindexAlgEquiv R e) M * (Matrix.reindexAlgEquiv R 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)
:
((Matrix.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)
[CommRing R]
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
(e : m ≃ n)
(A : Matrix m m R)
:
((Matrix.reindexAlgEquiv R 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
.