Skip to content

Commit 28df819

Browse files
committed
refactor(Algebra/Algebra/Equiv): align AlgEquiv.ofLinearEquiv with AlgHom.ofLinearMap (#7537)
The former previously took a hypothesis about `f (algebraMap R A r) = algebraMap R B r`, but now needs only `f 1 = 1`, matching the latter. This doesn't make much difference at the two callers.
1 parent 1d33c1b commit 28df819

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

Mathlib/Algebra/Algebra/Equiv.lean

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -628,38 +628,37 @@ theorem trans_toLinearMap (f : A₁ ≃ₐ[R] A₂) (g : A₂ ≃ₐ[R] A₃) :
628628

629629
section OfLinearEquiv
630630

631-
variable (l : A₁ ≃ₗ[R] A₂) (map_mul : ∀ x y : A₁, l (x * y) = l x * l y)
632-
(commutes : ∀ r : R, l (algebraMap R A₁ r) = algebraMap R A₂ r)
631+
variable (l : A₁ ≃ₗ[R] A₂) (map_one : l 1 = 1) (map_mul : ∀ x y : A₁, l (x * y) = l x * l y)
633632

634633
/-- Upgrade a linear equivalence to an algebra equivalence,
635-
given that it distributes over multiplication and action of scalars.
634+
given that it distributes over multiplication and the identity
636635
-/
637636
@[simps apply]
638637
def ofLinearEquiv : A₁ ≃ₐ[R] A₂ :=
639638
{ l with
640639
toFun := l
641640
invFun := l.symm
642641
map_mul' := map_mul
643-
commutes' := commutes }
644-
#align alg_equiv.of_linear_equiv AlgEquiv.ofLinearEquiv
642+
commutes' := (AlgHom.ofLinearMap l map_one map_mul : A₁ →ₐ[R] A₂).commutes }
643+
#align alg_equiv.of_linear_equiv AlgEquiv.ofLinearEquivₓ
645644

646645
@[simp]
647646
theorem ofLinearEquiv_symm :
648-
(ofLinearEquiv l map_mul commutes).symm =
649-
ofLinearEquiv l.symm (ofLinearEquiv l map_mul commutes).symm.map_mul
650-
(ofLinearEquiv l map_mul commutes).symm.commutes :=
647+
(ofLinearEquiv l map_one map_mul).symm =
648+
ofLinearEquiv l.symm (ofLinearEquiv l map_one map_mul).symm.map_one
649+
(ofLinearEquiv l map_one map_mul).symm.map_mul :=
651650
rfl
652651
#align alg_equiv.of_linear_equiv_symm AlgEquiv.ofLinearEquiv_symm
653652

654653
@[simp]
655-
theorem ofLinearEquiv_toLinearEquiv (map_mul) (commutes) :
656-
ofLinearEquiv e.toLinearEquiv map_mul commutes = e := by
654+
theorem ofLinearEquiv_toLinearEquiv (map_mul) (map_one) :
655+
ofLinearEquiv e.toLinearEquiv map_mul map_one = e := by
657656
ext
658657
rfl
659658
#align alg_equiv.of_linear_equiv_to_linear_equiv AlgEquiv.ofLinearEquiv_toLinearEquiv
660659

661660
@[simp]
662-
theorem toLinearEquiv_ofLinearEquiv : toLinearEquiv (ofLinearEquiv l map_mul commutes) = l := by
661+
theorem toLinearEquiv_ofLinearEquiv : toLinearEquiv (ofLinearEquiv l map_one map_mul) = l := by
663662
ext
664663
rfl
665664
#align alg_equiv.to_linear_equiv_of_linear_equiv AlgEquiv.toLinearEquiv_ofLinearEquiv

Mathlib/Algebra/MonoidAlgebra/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,9 @@ variable (k A)
958958
def domCongr (e : G ≃* H) : MonoidAlgebra A G ≃ₐ[k] MonoidAlgebra A H :=
959959
AlgEquiv.ofLinearEquiv
960960
(Finsupp.domLCongr e : (G →₀ A) ≃ₗ[k] (H →₀ A))
961+
((equivMapDomain_eq_mapDomain _ _).trans <| mapDomain_one e)
961962
(fun f g => (equivMapDomain_eq_mapDomain _ _).trans <| (mapDomain_mul e f g).trans <|
962963
congr_arg₂ _ (equivMapDomain_eq_mapDomain _ _).symm (equivMapDomain_eq_mapDomain _ _).symm)
963-
(fun r => (equivMapDomain_eq_mapDomain _ _).trans <| mapDomain_algebraMap A e r)
964964

965965
theorem domCongr_toAlgHom (e : G ≃* H) : (domCongr k A e).toAlgHom = mapDomainAlgHom k A e :=
966966
AlgHom.ext <| fun _ => equivMapDomain_eq_mapDomain _ _
@@ -2073,9 +2073,9 @@ variable [CommSemiring k] [AddMonoid G] [AddMonoid H] [Semiring A] [Algebra k A]
20732073
def domCongr (e : G ≃+ H) : A[G] ≃ₐ[k] A[H] :=
20742074
AlgEquiv.ofLinearEquiv
20752075
(Finsupp.domLCongr e : (G →₀ A) ≃ₗ[k] (H →₀ A))
2076+
((equivMapDomain_eq_mapDomain _ _).trans <| mapDomain_one e)
20762077
(fun f g => (equivMapDomain_eq_mapDomain _ _).trans <| (mapDomain_mul e f g).trans <|
20772078
congr_arg₂ _ (equivMapDomain_eq_mapDomain _ _).symm (equivMapDomain_eq_mapDomain _ _).symm)
2078-
(fun r => (equivMapDomain_eq_mapDomain _ _).trans <| mapDomain_algebraMap A e r)
20792079

20802080
theorem domCongr_toAlgHom (e : G ≃+ H) : (domCongr k A e).toAlgHom = mapDomainAlgHom k A e :=
20812081
AlgHom.ext <| fun _ => equivMapDomain_eq_mapDomain _ _

Mathlib/LinearAlgebra/Matrix/ToLin.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ theorem LinearMap.toMatrix'_id : LinearMap.toMatrix' (LinearMap.id : (n → R)
361361
rw [Matrix.one_apply, LinearMap.toMatrix'_apply, id_apply]
362362
#align linear_map.to_matrix'_id LinearMap.toMatrix'_id
363363

364+
@[simp]
365+
theorem LinearMap.toMatrix'_one : LinearMap.toMatrix' (1 : (n → R) →ₗ[R] n → R) = 1 :=
366+
LinearMap.toMatrix'_id
367+
364368
@[simp]
365369
theorem Matrix.toLin'_mul [Fintype m] [DecidableEq m] (M : Matrix l m R) (N : Matrix m n R) :
366370
Matrix.toLin' (M * N) = (Matrix.toLin' M).comp (Matrix.toLin' N) :=
@@ -435,7 +439,7 @@ def Matrix.toLin'OfInv [Fintype m] [DecidableEq m] {M : Matrix m n R} {M' : Matr
435439

436440
/-- Linear maps `(n → R) →ₗ[R] (n → R)` are algebra equivalent to `Matrix n n R`. -/
437441
def LinearMap.toMatrixAlgEquiv' : ((n → R) →ₗ[R] n → R) ≃ₐ[R] Matrix n n R :=
438-
AlgEquiv.ofLinearEquiv LinearMap.toMatrix' LinearMap.toMatrix'_mul LinearMap.toMatrix'_algebraMap
442+
AlgEquiv.ofLinearEquiv LinearMap.toMatrix' LinearMap.toMatrix'_one LinearMap.toMatrix'_mul
439443
#align linear_map.to_matrix_alg_equiv' LinearMap.toMatrixAlgEquiv'
440444

441445
/-- A `Matrix n n R` is algebra equivalent to a linear map `(n → R) →ₗ[R] (n → R)`. -/
@@ -708,8 +712,8 @@ def Matrix.toLinOfInv [DecidableEq m] {M : Matrix m n R} {M' : Matrix n m R} (hM
708712
/-- Given a basis of a module `M₁` over a commutative ring `R`, we get an algebra
709713
equivalence between linear maps `M₁ →ₗ M₁` and square matrices over `R` indexed by the basis. -/
710714
def LinearMap.toMatrixAlgEquiv : (M₁ →ₗ[R] M₁) ≃ₐ[R] Matrix n n R :=
711-
AlgEquiv.ofLinearEquiv (LinearMap.toMatrix v₁ v₁) (LinearMap.toMatrix_mul v₁)
712-
(LinearMap.toMatrix_algebraMap v₁)
715+
AlgEquiv.ofLinearEquiv
716+
(LinearMap.toMatrix v₁ v₁) (LinearMap.toMatrix_one v₁) (LinearMap.toMatrix_mul v₁)
713717
#align linear_map.to_matrix_alg_equiv LinearMap.toMatrixAlgEquiv
714718

715719
/-- Given a basis of a module `M₁` over a commutative ring `R`, we get an algebra

0 commit comments

Comments
 (0)