Skip to content

Commit 4c2af12

Browse files
gasparattilaReemMelamed
authored andcommitted
chore(Algebra/Star): clean up simp lemmas about bundled star equivalences (leanprover-community#39757)
This PR adds `.symm` lemmas for these equivalences, allowing `simp` to reduce applications of their inverses to applications of `star`.
1 parent 6a92c4d commit 4c2af12

4 files changed

Lines changed: 88 additions & 21 deletions

File tree

Mathlib/Algebra/Star/Basic.lean

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,15 @@ theorem star_inj [InvolutiveStar R] {x y : R} : star x = star y ↔ x = y :=
9393
star_injective.eq_iff
9494

9595
/-- `star` as an equivalence when it is involutive. -/
96+
@[simps! apply]
9697
protected def Equiv.Perm.star [InvolutiveStar R] : Equiv.Perm R :=
9798
star_involutive.toPerm _
9899

100+
@[simp]
101+
theorem Equiv.Perm.symm_star [InvolutiveStar R] :
102+
(Equiv.Perm.star : R ≃ R).symm = Equiv.Perm.star :=
103+
rfl
104+
99105
theorem eq_star_of_eq_star [InvolutiveStar R] {r s : R} (h : r = star s) : s = star r := by
100106
simp [h]
101107

@@ -232,11 +238,20 @@ export StarAddMonoid (star_add)
232238
attribute [simp] star_add
233239

234240
/-- `star` as an `AddEquiv` -/
235-
@[simps apply]
236-
def starAddEquiv [AddMonoid R] [StarAddMonoid R] : R ≃+ R :=
237-
{ InvolutiveStar.star_involutive.toPerm star with
238-
toFun := star
239-
map_add' := star_add }
241+
@[simps! apply]
242+
def starAddEquiv [AddMonoid R] [StarAddMonoid R] : R ≃+ R where
243+
toEquiv := Equiv.Perm.star
244+
map_add' := star_add
245+
246+
@[simp]
247+
theorem toEquiv_starAddEquiv [AddMonoid R] [StarAddMonoid R] :
248+
(starAddEquiv : R ≃+ R) = (Equiv.Perm.star : R ≃ R) :=
249+
rfl
250+
251+
@[simp]
252+
theorem symm_starAddEquiv [AddMonoid R] [StarAddMonoid R] :
253+
(starAddEquiv : R ≃+ R).symm = starAddEquiv :=
254+
rfl
240255

241256
variable (R) in
242257
@[simp]

Mathlib/Algebra/Star/Module.lean

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,34 @@ instance StarAddMonoid.toStarModuleRat [AddCommGroup R] [Module ℚ R] [StarAddM
103103

104104
end SMulLemmas
105105

106+
section starLinearEquiv
107+
108+
variable (R : Type*) {A : Type*}
109+
[CommSemiring R] [StarRing R] [AddCommMonoid A] [StarAddMonoid A] [Module R A] [StarModule R A]
110+
106111
/-- If `A` is a module over a commutative `R` with compatible actions,
107112
then `star` is a semilinear equivalence. -/
108-
@[simps]
109-
def starLinearEquiv (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid A]
110-
[StarAddMonoid A] [Module R A] [StarModule R A] : A ≃ₗ⋆[R] A :=
111-
{ starAddEquiv with
112-
toFun := star
113-
map_smul' := star_smul }
113+
@[simps! apply]
114+
def starLinearEquiv : A ≃ₗ⋆[R] A where
115+
__ := starAddEquiv
116+
map_smul' := star_smul
117+
118+
@[simp]
119+
theorem toAddEquiv_starLinearEquiv :
120+
(starLinearEquiv R : A ≃ₗ⋆[R] A).toAddEquiv = starAddEquiv :=
121+
rfl
122+
123+
@[simp]
124+
theorem symm_starLinearEquiv : (starLinearEquiv R : A ≃ₗ⋆[R] A).symm = starLinearEquiv R :=
125+
rfl
126+
127+
@[deprecated "Use `symm_starLinearEquiv` and `starLinearEquiv_apply` instead"
128+
(since := "2026-06-03")]
129+
theorem starLinearEquiv_symm_apply (x : A) :
130+
(starLinearEquiv R).symm x = starAddEquiv.invFun x := by
131+
simp
132+
133+
end starLinearEquiv
114134

115135
section SelfSkewAdjoint
116136

Mathlib/Analysis/CStarAlgebra/Basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,19 @@ theorem coe_starₗᵢ : (starₗᵢ 𝕜 : E → E) = star :=
287287
theorem starₗᵢ_apply {x : E} : starₗᵢ 𝕜 x = star x :=
288288
rfl
289289

290+
@[simp]
291+
theorem symm_starₗᵢ : (starₗᵢ 𝕜 : E ≃ₗᵢ⋆[𝕜] E).symm = starₗᵢ 𝕜 :=
292+
rfl
293+
290294
@[simp]
291295
theorem starₗᵢ_toContinuousLinearEquiv :
292296
(starₗᵢ 𝕜 : E ≃ₗᵢ⋆[𝕜] E).toContinuousLinearEquiv = (starL 𝕜 : E ≃L⋆[𝕜] E) :=
293297
ContinuousLinearEquiv.ext rfl
294298

299+
@[simp]
300+
theorem toLinearEquiv_starₗᵢ : (starₗᵢ 𝕜 : E ≃ₗᵢ⋆[𝕜] E).toLinearEquiv = starLinearEquiv 𝕜 :=
301+
rfl
302+
295303
end starₗᵢ
296304

297305
namespace StarSubalgebra

Mathlib/Topology/Algebra/Module/Star.lean

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,56 @@ notation:25 M " →L⋆[" R "] " M₂ => ContinuousLinearMap (starRingEnd R) M M
2323
@[inherit_doc]
2424
notation:50 M " ≃L⋆[" R "] " M₂ => ContinuousLinearEquiv (starRingEnd R) M M₂
2525

26+
section starL
27+
28+
variable (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid A]
29+
[StarAddMonoid A] [Module R A] [StarModule R A] [TopologicalSpace A] [ContinuousStar A]
30+
31+
set_option backward.defeqAttrib.useBackward true in
2632
/-- If `A` is a topological module over a commutative `R` with compatible actions,
2733
then `star` is a continuous semilinear equivalence. -/
28-
@[simps!]
29-
def starL (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid A]
30-
[StarAddMonoid A] [Module R A] [StarModule R A] [TopologicalSpace A] [ContinuousStar A] :
31-
A ≃L⋆[R] A where
34+
@[simps! apply]
35+
def starL : A ≃L⋆[R] A where
3236
toLinearEquiv := starLinearEquiv R
33-
continuous_toFun := continuous_star
34-
continuous_invFun := continuous_star
37+
38+
@[simp]
39+
theorem toLinearEquiv_starL : (starL R : A ≃L⋆[R] A).toLinearEquiv = starLinearEquiv R :=
40+
rfl
41+
42+
@[simp]
43+
theorem symm_starL : (starL R : A ≃L⋆[R] A).symm = starL R :=
44+
rfl
45+
46+
@[deprecated "Use `symm_starL` and `starL_apply` instead" (since := "2026-06-03")]
47+
theorem starL_symm_apply (x : A) : (starL R).symm x = starAddEquiv.symm x := by
48+
simp
49+
50+
variable [TrivialStar R]
3551

3652
-- TODO: this could be replaced with something like `(starL R).restrict_scalarsₛₗ h` if we
3753
-- implemented the idea in
3854
-- https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Star-semilinear.20maps.20are.20semilinear.20when.20star.20is.20trivial/near/359557835
3955
/-- If `A` is a topological module over a commutative `R` with trivial star and compatible actions,
4056
then `star` is a continuous linear equivalence. -/
41-
@[simps!]
42-
def starL' (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [TrivialStar R] [AddCommMonoid A]
43-
[StarAddMonoid A] [Module R A] [StarModule R A] [TopologicalSpace A] [ContinuousStar A] :
44-
A ≃L[R] A :=
57+
@[simps! apply]
58+
def starL' : A ≃L[R] A :=
4559
(starL R : A ≃L⋆[R] A).trans
4660
({ AddEquiv.refl A with
4761
map_smul' := fun r a => by simp
4862
continuous_toFun := continuous_id
4963
continuous_invFun := continuous_id } :
5064
A ≃L⋆[R] A)
5165

66+
@[simp]
67+
theorem symm_starL' : (starL' R : A ≃L[R] A).symm = starL' R :=
68+
rfl
69+
70+
@[deprecated "Use `symm_starL'` and `starL'_apply` instead" (since := "2026-06-03")]
71+
theorem starL'_symm_apply (x : A) : (starL' R).symm x = starAddEquiv.symm x := by
72+
simp
73+
74+
end starL
75+
5276
variable (R : Type*) (A : Type*) [Semiring R] [StarMul R] [TrivialStar R] [AddCommGroup A]
5377
[Module R A] [StarAddMonoid A] [StarModule R A] [Invertible (2 : R)] [TopologicalSpace A]
5478

0 commit comments

Comments
 (0)