Skip to content

Commit 28c4f6c

Browse files
committed
chore(Data/Matrix/Basic): mention mopMatrix in transpose{Ring/Alg}Equivs docstring and vice versa (#39123)
- `RingEquiv.mopMatrix` and `transposeRingEquiv` differ by a `ᵐᵒᵖ` since the latter assumes `CommMagma α` instead of `Mul α` - `AlgEquiv.mopMatrix` and `transposeAlgEquiv` differ by a `ᵐᵒᵖ` since the latter assumes `CommSemiring α` instead of `Semiring α`
1 parent 9dcbf32 commit 28c4f6c

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

Mathlib/Data/Matrix/Basic.lean

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -639,17 +639,16 @@ theorem mapMatrix_trans (f : α ≃+* β) (g : β ≃+* γ) :
639639
rfl
640640

641641
open MulOpposite in
642-
/--
643-
For any ring `R`, we have ring isomorphism `Matₙₓₙ(Rᵒᵖ) ≅ (Matₙₓₙ(R))ᵒᵖ` given by transpose.
644-
-/
642+
/-- For any ring `α`, we have ring isomorphism `Matₙₓₙ(αᵒᵖ) ≅ (Matₙₓₙ(α))ᵒᵖ` given by transpose.
643+
644+
See also `Matrix.transposeRingEquiv` for a version that doesn't take the opposite of `α`,
645+
given that its multiplication is commutative. -/
645646
@[simps apply symm_apply]
646647
def mopMatrix {α} [Mul α] [AddCommMonoid α] : Matrix m m αᵐᵒᵖ ≃+* (Matrix m m α)ᵐᵒᵖ where
647648
toFun M := op (M.transpose.map unop)
648649
invFun M := M.unop.transpose.map op
649-
left_inv _ := by aesop
650-
right_inv _ := by aesop
651-
map_mul' _ _ := unop_injective <| by ext; simp [transpose, mul_apply]
652-
map_add' _ _ := by aesop
650+
map_mul' _ _ := unop_injective <| by ext; simp [mul_apply]
651+
map_add' _ _ := rfl
653652

654653
end RingEquiv
655654

@@ -721,8 +720,10 @@ theorem mapMatrix_trans (f : α ≃ₐ[R] β) (g : β ≃ₐ[R] γ) :
721720
rfl
722721

723722
/-- For any algebra `α` over a ring `R`, we have an `R`-algebra isomorphism
724-
`Matₙₓₙ(αᵒᵖ) ≅ (Matₙₓₙ(R))ᵒᵖ` given by transpose. If `α` is commutative,
725-
we can get rid of the `ᵒᵖ` in the left-hand side, see `Matrix.transposeAlgEquiv`. -/
723+
`Matₙₓₙ(αᵒᵖ) ≅ (Matₙₓₙ(R))ᵒᵖ` given by transpose.
724+
725+
See also `Matrix.transposeAlgEquiv` for a version that doesn't take the opposite of `α`,
726+
given that its multiplication is commutative. -/
726727
@[simps!] def mopMatrix : Matrix m m αᵐᵒᵖ ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ where
727728
__ := RingEquiv.mopMatrix
728729
commutes' _ := MulOpposite.unop_injective <| by
@@ -894,7 +895,10 @@ theorem transposeLinearEquiv_symm [Semiring R] [AddCommMonoid α] [Module R α]
894895
variable {m n R α}
895896
variable (m α)
896897

897-
/-- `Matrix.transpose` as a `RingEquiv` to the opposite ring -/
898+
/-- `Matrix.transpose` as a `RingEquiv` to the opposite ring.
899+
900+
See also `RingEquiv.mopMatrix` for a version that doesn't require `α` to have commutative
901+
multiplication, by taking its opposite. -/
898902
@[simps!]
899903
def transposeRingEquiv [AddCommMonoid α] [CommMagma α] [Fintype m] :
900904
Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ where
@@ -914,7 +918,10 @@ theorem transpose_list_prod [CommSemiring α] [Fintype m] [DecidableEq m] (l : L
914918

915919
variable (R m α)
916920

917-
/-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring -/
921+
/-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring.
922+
923+
See also `AlgEquiv.mopMatrix` for a version that doesn't require `α` to have commutative
924+
multiplication, by taking its opposite. -/
918925
@[simps!]
919926
def transposeAlgEquiv [CommSemiring R] [CommSemiring α] [Fintype m] [DecidableEq m] [Algebra R α] :
920927
Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ where

Mathlib/LinearAlgebra/Matrix/Defs.lean

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,16 @@ theorem map_injective {f : α → β} (hf : Function.Injective f) :
135135
theorem map_involutive {f : α → α} (hf : Function.Involutive f) :
136136
Function.Involutive fun M : Matrix m n α ↦ M.map f := by intro; simp [hf]
137137

138-
/-- The transpose of a matrix. -/
138+
/-- The transpose of a matrix.
139+
140+
This is available in bundled forms as:
141+
* `Matrix.transposeAddEquiv`
142+
* `Matrix.transposeLinearEquiv`
143+
* `Matrix.transposeRingEquiv`
144+
* `Matrix.transposeAlgEquiv`
145+
* `RingEquiv.mopMatrix`
146+
* `AlgEquiv.mopMatrix`
147+
-/
139148
def transpose (M : Matrix m n α) : Matrix n m α :=
140149
of fun x y => M y x
141150

0 commit comments

Comments
 (0)