Skip to content

Commit d292472

Browse files
committed
feat: expand API for StarAlgEquiv (leanprover-community#40517)
This PR adds API for `StarAlgEquiv`. It provides: + `StarAlgEquiv.toNonUnitalStarAlgHom` + `StarAlgEquiv.toStarAlgHom` + `StarAlgEquiv.arrowCongr'` (non-unital morphisms) + `StarAlgEquiv.arrowCongr` (unital morphisms) + `StarAlgEquiv.ofNonUnitalStarAlgHom` (non-unital morphisms) + `StarAlgEquiv.ofStarAlgHom` (unital morphisms); this was pre-existing, but used morphism classes instead of actual morphisms. This PR fixes that. It also generalizes the type class hypothesis in `StarAlgEquiv.restrictScalars` so that it applies to non-unital algebras. In addition, `StarAlgEquiv.refl` is protected and its type arguments made explicit.
1 parent f469a45 commit d292472

3 files changed

Lines changed: 223 additions & 29 deletions

File tree

Mathlib/Algebra/Star/StarAlgHom.lean

Lines changed: 191 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -723,17 +723,18 @@ theorem toRingEquiv_eq_coe (e : A ≃⋆ₐ[R] B) : e.toRingEquiv = e :=
723723
theorem ext {f g : A ≃⋆ₐ[R] B} (h : ∀ a, f a = g a) : f = g :=
724724
DFunLike.ext f g h
725725

726+
variable (R A) in
726727
/-- The identity map is a star algebra isomorphism. -/
727728
@[refl]
728-
def refl : A ≃⋆ₐ[R] A :=
729+
protected def refl : A ≃⋆ₐ[R] A :=
729730
{ StarRingEquiv.refl (A := A) with
730731
map_smul' := fun _ _ => rfl }
731732

732733
instance : Inhabited (A ≃⋆ₐ[R] A) :=
733-
⟨refl⟩
734+
.refl R A
734735

735736
@[simp]
736-
theorem coe_refl : ⇑(refl : A ≃⋆ₐ[R] A) = id :=
737+
theorem coe_refl : ⇑(StarAlgEquiv.refl R A) = id :=
737738
rfl
738739

739740
/-- The inverse of a star algebra isomorphism is a star algebra isomorphism. -/
@@ -775,7 +776,7 @@ theorem symm_mk (e : A ≃⋆+* B) (h₁) : dsimp%
775776
rfl
776777

777778
@[simp]
778-
theorem refl_symm : (StarAlgEquiv.refl : A ≃⋆ₐ[R] A).symm = StarAlgEquiv.refl :=
779+
theorem refl_symm : (StarAlgEquiv.refl R A).symm = .refl R A :=
779780
rfl
780781

781782
@[simp]
@@ -845,7 +846,7 @@ theorem toAlgEquiv_injective : Function.Injective (toAlgEquiv (R := R) (A := A)
845846
fun _ _ h => ext <| AlgEquiv.congr_fun h
846847

847848
@[simp]
848-
theorem toAlgEquiv_refl : (refl : A ≃⋆ₐ[R] A).toAlgEquiv = AlgEquiv.refl := rfl
849+
theorem toAlgEquiv_refl : (StarAlgEquiv.refl R A).toAlgEquiv = AlgEquiv.refl := rfl
849850

850851
/-- Upgrade an algebra equivalence to a ⋆-algebra equivalence given that it preserves the
851852
`star` operation. -/
@@ -876,6 +877,190 @@ end AlgEquiv
876877

877878
end Basic
878879

880+
section NonUnitalArrowCongr
881+
882+
variable {R A₁ A₂ A₃ A₁' A₂' A₃' : Type*} [Monoid R]
883+
[NonUnitalNonAssocSemiring A₁] [DistribMulAction R A₁] [Star A₁]
884+
[NonUnitalNonAssocSemiring A₂] [DistribMulAction R A₂] [Star A₂]
885+
[NonUnitalNonAssocSemiring A₃] [DistribMulAction R A₃] [Star A₃]
886+
[NonUnitalNonAssocSemiring A₁'] [DistribMulAction R A₁'] [Star A₁']
887+
[NonUnitalNonAssocSemiring A₂'] [DistribMulAction R A₂'] [Star A₂']
888+
[NonUnitalNonAssocSemiring A₃'] [DistribMulAction R A₃'] [Star A₃']
889+
(e : A₁ ≃⋆ₐ[R] A₂)
890+
891+
/-- Reintrepret a star algebra equivalence as a non-unital star algebra homomorphism. -/
892+
@[simps]
893+
def toNonUnitalStarAlgHom : A₁ →⋆ₙₐ[R] A₂ :=
894+
{ e with
895+
toFun := e
896+
map_zero' := map_zero e }
897+
898+
@[simp]
899+
lemma toNonUnitalStarAlgHom_refl : (StarAlgEquiv.refl R A₁).toNonUnitalStarAlgHom = .id R A₁ :=
900+
rfl
901+
902+
@[simp]
903+
lemma toNonUnitalStarAlgHom_comp (e₁ : A₁ ≃⋆ₐ[R] A₂) (e₂ : A₂ ≃⋆ₐ[R] A₃) :
904+
e₂.toNonUnitalStarAlgHom.comp e₁.toNonUnitalStarAlgHom =
905+
(e₁.trans e₂).toNonUnitalStarAlgHom := rfl
906+
907+
/-- If `A₁` is equivalent to `A₁'` and `A₂` is equivalent to `A₂'` as star algebras, then the type
908+
of maps `A₁ →⋆ₙₐ[R] A₂` is equivalent to the type of maps `A₁' →⋆ₙₐ[R] A₂'`.
909+
910+
For unital star algebra homomorphisms, see `StarAlgEquiv.arrowCongr`. -/
911+
@[simps apply]
912+
def arrowCongr' (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂') :
913+
(A₁ →⋆ₙₐ[R] A₂) ≃ (A₁' →⋆ₙₐ[R] A₂') where
914+
toFun f := (e₂.toNonUnitalStarAlgHom.comp f).comp e₁.symm.toNonUnitalStarAlgHom
915+
invFun f := (e₂.symm.toNonUnitalStarAlgHom.comp f).comp e₁.toNonUnitalStarAlgHom
916+
left_inv f := by ext; simp
917+
right_inv f := by ext; simp
918+
919+
theorem arrowCongr'_comp (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂')
920+
(e₃ : A₃ ≃⋆ₐ[R] A₃') (f : A₁ →⋆ₙₐ[R] A₂) (g : A₂ →⋆ₙₐ[R] A₃) :
921+
arrowCongr' e₁ e₃ (g.comp f) = (arrowCongr' e₂ e₃ g).comp (arrowCongr' e₁ e₂ f) := by
922+
ext
923+
simp
924+
925+
@[simp]
926+
theorem arrowCongr'_refl : arrowCongr' (.refl _ _) (.refl _ _) = Equiv.refl (A₁ →⋆ₙₐ[R] A₂) :=
927+
rfl
928+
929+
@[simp]
930+
theorem arrowCongr'_trans (e₁ : A₁ ≃⋆ₐ[R] A₂) (e₁' : A₁' ≃⋆ₐ[R] A₂')
931+
(e₂ : A₂ ≃⋆ₐ[R] A₃) (e₂' : A₂' ≃⋆ₐ[R] A₃') :
932+
arrowCongr' (e₁.trans e₂) (e₁'.trans e₂') = (arrowCongr' e₁ e₁').trans (arrowCongr' e₂ e₂') :=
933+
rfl
934+
935+
@[simp]
936+
theorem symm_arrowCongr' (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂') :
937+
(arrowCongr' e₁ e₂).symm = arrowCongr' e₁.symm e₂.symm :=
938+
rfl
939+
940+
/-- Construct a star algebra equivalence from a pair of non-unital star algebra homomorphisms. -/
941+
@[simps]
942+
def ofNonUnitalStarAlgHom (f : A₁ →⋆ₙₐ[R] A₂) (g : A₂ →⋆ₙₐ[R] A₁) (h₁ : g.comp f = .id R A₁)
943+
(h₂ : f.comp g = .id R A₂) : A₁ ≃⋆ₐ[R] A₂ :=
944+
{ f with
945+
toFun := f
946+
invFun := g
947+
left_inv x := congr($h₁ x)
948+
right_inv x := congr($h₂ x) }
949+
950+
@[simp]
951+
lemma toNonUnitalStarAlgHom_ofNonUnitalStarAlgHom (f : A₁ →⋆ₙₐ[R] A₂) (g : A₂ →⋆ₙₐ[R] A₁)
952+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
953+
(ofNonUnitalStarAlgHom f g h₁ h₂).toNonUnitalStarAlgHom = f :=
954+
rfl
955+
956+
lemma symm_ofNonUnitalStarAlgHom (f : A₁ →⋆ₙₐ[R] A₂) (g : A₂ →⋆ₙₐ[R] A₁)
957+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
958+
(ofNonUnitalStarAlgHom f g h₁ h₂).symm = ofNonUnitalStarAlgHom g f h₂ h₁ :=
959+
rfl
960+
961+
@[simp]
962+
lemma toNonUnitalStarAlgHom_symm_ofNonUnitalStarAlgHom (f : A₁ →⋆ₙₐ[R] A₂) (g : A₂ →⋆ₙₐ[R] A₁)
963+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
964+
(ofNonUnitalStarAlgHom f g h₁ h₂).symm.toNonUnitalStarAlgHom = g :=
965+
rfl
966+
967+
end NonUnitalArrowCongr
968+
969+
section Unital
970+
971+
variable {R A₁ A₂ A₃ A₁' A₂' A₃' : Type*}
972+
[CommSemiring R] [Semiring A₁] [Semiring A₂] [Semiring A₃]
973+
[Semiring A₁'] [Semiring A₂'] [Semiring A₃']
974+
[Algebra R A₁] [Algebra R A₂] [Algebra R A₃]
975+
[Algebra R A₁'] [Algebra R A₂'] [Algebra R A₃']
976+
[Star A₁] [Star A₂] [Star A₃]
977+
[Star A₁'] [Star A₂'] [Star A₃']
978+
(e : A₁ ≃⋆ₐ[R] A₂)
979+
980+
/-- Reintrepret a star algebra equivalence as a star algebra homomorphism. -/
981+
@[simps]
982+
def toStarAlgHom : A₁ →⋆ₐ[R] A₂ :=
983+
{ e with
984+
toFun := e
985+
__ := e.toAlgEquiv.toAlgHom }
986+
987+
@[simp]
988+
lemma toNonUnitalStarAlgHom_toStarAlgHom (e : A₁ ≃⋆ₐ[R] A₂) :
989+
e.toStarAlgHom.toNonUnitalStarAlgHom = e.toNonUnitalStarAlgHom :=
990+
rfl
991+
992+
@[simp]
993+
lemma toStarAlgHom_refl : (StarAlgEquiv.refl R A₁).toStarAlgHom = .id R A₁ :=
994+
rfl
995+
996+
@[simp]
997+
lemma toStarAlgHom_comp (e₁ : A₁ ≃⋆ₐ[R] A₂) (e₂ : A₂ ≃⋆ₐ[R] A₃) :
998+
e₂.toStarAlgHom.comp e₁.toStarAlgHom = (e₁.trans e₂).toStarAlgHom := rfl
999+
1000+
/-- If `A₁` is equivalent to `A₁'` and `A₂` is equivalent to `A₂'` as star algebras, then the type
1001+
of maps `A₁ →⋆ₐ[R] A₂` is equivalent to the type of maps `A₁' →⋆ₐ[R] A₂'`.
1002+
1003+
For non-unital star algebra homomorphisms, see `StarAlgEquiv.arrowCongr'`. -/
1004+
@[simps apply]
1005+
def arrowCongr (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂') : (A₁ →⋆ₐ[R] A₂) ≃ (A₁' →⋆ₐ[R] A₂') where
1006+
toFun f := (e₂.toStarAlgHom.comp f).comp e₁.symm.toStarAlgHom
1007+
invFun f := (e₂.symm.toStarAlgHom.comp f).comp e₁.toStarAlgHom
1008+
left_inv f := by ext; simp
1009+
right_inv f := by ext; simp
1010+
1011+
theorem arrowCongr_comp (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂')
1012+
(e₃ : A₃ ≃⋆ₐ[R] A₃') (f : A₁ →⋆ₐ[R] A₂) (g : A₂ →⋆ₐ[R] A₃) :
1013+
arrowCongr e₁ e₃ (g.comp f) = (arrowCongr e₂ e₃ g).comp (arrowCongr e₁ e₂ f) := by
1014+
ext
1015+
simp
1016+
1017+
@[simp]
1018+
theorem arrowCongr_refl : arrowCongr (.refl _ _) (.refl _ _) = Equiv.refl (A₁ →⋆ₐ[R] A₂) :=
1019+
rfl
1020+
1021+
@[simp]
1022+
theorem arrowCongr_trans (e₁ : A₁ ≃⋆ₐ[R] A₂) (e₁' : A₁' ≃⋆ₐ[R] A₂')
1023+
(e₂ : A₂ ≃⋆ₐ[R] A₃) (e₂' : A₂' ≃⋆ₐ[R] A₃') :
1024+
arrowCongr (e₁.trans e₂) (e₁'.trans e₂') = (arrowCongr e₁ e₁').trans (arrowCongr e₂ e₂') :=
1025+
rfl
1026+
1027+
@[simp]
1028+
theorem symm_arrowCongr (e₁ : A₁ ≃⋆ₐ[R] A₁') (e₂ : A₂ ≃⋆ₐ[R] A₂') :
1029+
(arrowCongr e₁ e₂).symm = arrowCongr e₁.symm e₂.symm :=
1030+
rfl
1031+
1032+
/-- Construct a star algebra equivalence from a pair of star algebra homomorphisms. -/
1033+
@[simps]
1034+
def ofStarAlgHom {R A B : Type*} [CommSemiring R]
1035+
[Semiring A] [Algebra R A] [Star A] [Semiring B] [Algebra R B] [Star B]
1036+
(f : A →⋆ₐ[R] B) (g : B →⋆ₐ[R] A) (h₁ : g.comp f = .id R A) (h₂ : f.comp g = .id R B) :
1037+
A ≃⋆ₐ[R] B :=
1038+
{ f with
1039+
toFun := f
1040+
invFun := g
1041+
left_inv x := congr($h₁ x)
1042+
right_inv x := congr($h₂ x)
1043+
map_smul' := map_smul f }
1044+
1045+
@[simp]
1046+
lemma toStarAlgHom_ofStarAlgHom (f : A₁ →⋆ₐ[R] A₂) (g : A₂ →⋆ₐ[R] A₁)
1047+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
1048+
(ofStarAlgHom f g h₁ h₂).toStarAlgHom = f :=
1049+
rfl
1050+
1051+
lemma symm_ofStarAlgHom (f : A₁ →⋆ₐ[R] A₂) (g : A₂ →⋆ₐ[R] A₁)
1052+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
1053+
(ofStarAlgHom f g h₁ h₂).symm = ofStarAlgHom g f h₂ h₁ :=
1054+
rfl
1055+
1056+
@[simp]
1057+
lemma toStarAlgHom_symm_ofStarAlgHom (f : A₁ →⋆ₐ[R] A₂) (g : A₂ →⋆ₐ[R] A₁)
1058+
(h₁ : g.comp f = .id R A₁) (h₂ : f.comp g = .id R A₂) :
1059+
(ofStarAlgHom f g h₁ h₂).symm.toStarAlgHom = g :=
1060+
rfl
1061+
1062+
end Unital
1063+
8791064
section Bijective
8801065

8811066
variable {F G R A B : Type*} [Monoid R]
@@ -884,19 +1069,6 @@ variable [NonUnitalNonAssocSemiring B] [DistribMulAction R B] [Star B]
8841069
variable [FunLike F A B] [NonUnitalAlgHomClass F R A B] [StarHomClass F A B]
8851070
variable [FunLike G B A] [NonUnitalAlgHomClass G R B A] [StarHomClass G B A]
8861071

887-
/-- If a (unital or non-unital) star algebra morphism has an inverse, it is an isomorphism of
888-
star algebras. -/
889-
@[simps]
890-
def ofStarAlgHom (f : F) (g : G) (h₁ : ∀ x, g (f x) = x) (h₂ : ∀ x, f (g x) = x) : A ≃⋆ₐ[R] B where
891-
toFun := f
892-
invFun := g
893-
left_inv := h₁
894-
right_inv := h₂
895-
map_add' := map_add f
896-
map_mul' := map_mul f
897-
map_smul' := map_smul f
898-
map_star' := map_star f
899-
9001072
/-- Promote a bijective star algebra homomorphism to a star algebra equivalence. -/
9011073
noncomputable def ofBijective (f : F) (hf : Function.Bijective f) : A ≃⋆ₐ[R] B :=
9021074
{
@@ -922,7 +1094,7 @@ variable {S R : Type*} [Mul R] [Add R] [Star R] [SMul S R]
9221094

9231095
@[simps -isSimp one mul]
9241096
instance aut : Group (R ≃⋆ₐ[S] R) where
925-
one := refl
1097+
one := .refl _ _
9261098
mul a b := b.trans a
9271099
one_mul _ := rfl
9281100
mul_one _ := rfl

Mathlib/Algebra/Star/Subalgebra.lean

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,32 @@ end StarAlgHom
869869

870870
section RestrictScalars
871871

872+
section Equiv
873+
874+
variable (R : Type*) {S A B : Type*} [CommSemiring R] [CommSemiring S]
875+
[NonUnitalNonAssocSemiring A] [NonUnitalNonAssocSemiring B] [MulAction R S] [Module S A]
876+
[Module S B] [Module R A] [Module R B] [IsScalarTower R S A] [IsScalarTower R S B]
877+
[Star A] [Star B]
878+
879+
/-- Restrict the scalar ring of a star algebra equivalence. -/
880+
@[simps]
881+
def StarAlgEquiv.restrictScalars (f : A ≃⋆ₐ[S] B) : A ≃⋆ₐ[R] B :=
882+
{ (f : A →ₗ[S] B).restrictScalars R, f with
883+
toFun := f }
884+
885+
theorem StarAlgEquiv.restrictScalars_injective :
886+
Function.Injective (StarAlgEquiv.restrictScalars R : (A ≃⋆ₐ[S] B) → A ≃⋆ₐ[R] B) :=
887+
fun _ _ h => ext (DFunLike.congr_fun h ·)
888+
889+
@[simp]
890+
theorem StarAlgEquiv.toNonUnitalStarAlgHom_restrictScalars (e : A ≃⋆ₐ[S] B) :
891+
(e.restrictScalars R).toNonUnitalStarAlgHom = e.toNonUnitalStarAlgHom.restrictScalars R :=
892+
rfl
893+
894+
end Equiv
895+
896+
section Unital
897+
872898
variable (R : Type*) {S A B : Type*} [CommSemiring R]
873899
[CommSemiring S] [Semiring A] [Semiring B] [Algebra R S] [Algebra S A] [Algebra S B]
874900
[Algebra R A] [Algebra R B] [IsScalarTower R S A] [IsScalarTower R S B] [Star A] [Star B]
@@ -883,16 +909,12 @@ theorem StarAlgHom.restrictScalars_injective :
883909
fun f g h => StarAlgHom.ext fun x =>
884910
show f.restrictScalars R x = g.restrictScalars R x from DFunLike.congr_fun h x
885911

886-
@[simps]
887-
def StarAlgEquiv.restrictScalars (f : A ≃⋆ₐ[S] B) : A ≃⋆ₐ[R] B :=
888-
{ (f : A →⋆ₐ[S] B).restrictScalars R, f with
889-
toFun := f
890-
map_smul' := map_smul ((f : A →⋆ₐ[S] B).restrictScalars R) }
912+
@[simp]
913+
theorem StarAlgEquiv.toStarAlgHom_restrictScalars (e : A ≃⋆ₐ[S] B) :
914+
(e.restrictScalars R).toStarAlgHom = e.toStarAlgHom.restrictScalars R :=
915+
rfl
891916

892-
theorem StarAlgEquiv.restrictScalars_injective :
893-
Function.Injective (StarAlgEquiv.restrictScalars R : (A ≃⋆ₐ[S] B) → A ≃⋆ₐ[R] B) :=
894-
fun f g h => StarAlgEquiv.ext fun x =>
895-
show f.restrictScalars R x = g.restrictScalars R x from DFunLike.congr_fun h x
917+
end Unital
896918

897919
end RestrictScalars
898920

Mathlib/Analysis/InnerProductSpace/Adjoint.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ lemma conjStarAlgEquiv_apply (e : H ≃ₗᵢ[𝕜] K) (x : H →L[𝕜] H) :
894894
@[simp] lemma symm_conjStarAlgEquiv (e : H ≃ₗᵢ[𝕜] K) :
895895
e.conjStarAlgEquiv.symm = e.symm.conjStarAlgEquiv := rfl
896896

897-
@[simp] theorem conjStarAlgEquiv_refl : conjStarAlgEquiv (.refl 𝕜 H) = .refl := rfl
897+
@[simp] theorem conjStarAlgEquiv_refl : conjStarAlgEquiv (.refl 𝕜 H) = .refl _ _ := rfl
898898

899899
theorem conjStarAlgEquiv_trans {G : Type*} [NormedAddCommGroup G] [InnerProductSpace 𝕜 G]
900900
[CompleteSpace G] (e : H ≃ₗᵢ[𝕜] K) (f : K ≃ₗᵢ[𝕜] G) :

0 commit comments

Comments
 (0)