Skip to content

Commit 9c91a38

Browse files
committed
refactor: change unitary.map to take an explicit morphism as an argument, rather than a morphism class (#28122)
This also defines `unitary.mapEquiv` as the induced equivalence on unitary groups, and provides various functoriality lemmas for both definitions.
1 parent 50a8834 commit 9c91a38

File tree

2 files changed

+70
-8
lines changed

2 files changed

+70
-8
lines changed

Mathlib/Algebra/Star/MonoidHom.lean

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ end Comp
160160

161161
end StarMonoidHom
162162

163-
164163
/-! ### Star monoid equivalences -/
165164

166165
/-- A *star monoid equivalence* is an equivalence preserving multiplication and the star
@@ -258,6 +257,10 @@ def ofClass [EquivLike F A B] [MulEquivClass F A B] [StarHomClass F A B] (f : F)
258257
theorem coe_toMulEquiv (f : A ≃⋆* B) : ⇑f.toMulEquiv = f :=
259258
rfl
260259

260+
@[simp]
261+
theorem toMulEquiv_symm (f : A ≃⋆* B) : f.symm.toMulEquiv = f.toMulEquiv.symm :=
262+
rfl
263+
261264
@[simp]
262265
theorem refl_symm : (.refl A : A ≃⋆* A).symm = .refl A :=
263266
rfl
@@ -291,6 +294,11 @@ theorem coe_trans (e₁ : A ≃⋆* B) (e₂ : B ≃⋆* C) : ⇑(e₁.trans e
291294
theorem trans_apply (e₁ : A ≃⋆* B) (e₂ : B ≃⋆* C) (x : A) : (e₁.trans e₂) x = e₂ (e₁ x) :=
292295
rfl
293296

297+
@[simp]
298+
theorem toMulEquiv_trans (e₁ : A ≃⋆* B) (e₂ : B ≃⋆* C) :
299+
(e₁.trans e₂).toMulEquiv = e₁.toMulEquiv.trans e₂.toMulEquiv :=
300+
rfl
301+
294302
theorem leftInverse_symm (e : A ≃⋆* B) : Function.LeftInverse e.symm e :=
295303
e.left_inv
296304

@@ -303,6 +311,14 @@ section Bijective
303311

304312
variable [Monoid A] [Monoid B] [Star A] [Star B]
305313

314+
/-- Reinterpret a `StarMulEquiv` as a `StarMonoidHom`. -/
315+
@[simps]
316+
def toStarMonoidHom (f : A ≃⋆* B) : A →⋆* B where
317+
toFun := f
318+
map_one' := map_one f
319+
map_mul' := map_mul f
320+
map_star' := map_star f
321+
306322
/-- If a star monoid morphism has an inverse, it is an isomorphism of star monoids. -/
307323
@[simps]
308324
def ofStarMonoidHom (f : A →⋆* B) (g : B →⋆* A) (h₁ : g.comp f = .id _) (h₂ : f.comp g = .id _) :

Mathlib/Algebra/Star/Unitary.lean

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Mathlib.Algebra.Group.Submonoid.Operations
77
import Mathlib.Algebra.Star.SelfAdjoint
88
import Mathlib.Algebra.Algebra.Spectrum.Basic
99
import Mathlib.Tactic.ContinuousFunctionalCalculus
10+
import Mathlib.Algebra.Star.MonoidHom
1011
import Mathlib.Algebra.Star.StarProjection
1112

1213
/-!
@@ -237,22 +238,67 @@ end SMul
237238

238239
section Map
239240

240-
variable {F R S : Type*} [Monoid R] [StarMul R] [Monoid S] [StarMul S]
241-
variable [FunLike F R S] [StarHomClass F R S] [MonoidHomClass F R S] (f : F)
241+
variable {R S T : Type*} [Monoid R] [StarMul R] [Monoid S] [StarMul S] [Monoid T] [StarMul T]
242242

243-
lemma map_mem {r : R} (hr : r ∈ unitary R) : f r ∈ unitary S := by
243+
lemma map_mem {F : Type*} [FunLike F R S] [StarHomClass F R S] [MonoidHomClass F R S]
244+
(f : F) {r : R} (hr : r ∈ unitary R) : f r ∈ unitary S := by
244245
rw [unitary.mem_iff] at hr
245246
simpa [map_star, map_mul] using And.intro congr(f $(hr.1)) congr(f $(hr.2))
246247

247-
/-- The group homomorphism between unitary subgroups of star monoids induced by a star
248-
homomorphism -/
248+
/-- The star monoid homomorphism between unitary subgroups induced by a star monoid homomorphism of
249+
the underlying star monoids. -/
249250
@[simps]
250-
def map : unitary R →* unitary S where
251+
def map (f : R →⋆* S) : unitary R →* unitary S where
251252
toFun := Subtype.map f (fun _ ↦ map_mem f)
252253
map_one' := Subtype.ext <| map_one f
253254
map_mul' _ _ := Subtype.ext <| map_mul f _ _
255+
map_star' _ := Subtype.ext <| map_star f _
254256

255-
lemma toUnits_comp_map : toUnits.comp (map f) = (Units.map f).comp toUnits := by ext; rfl
257+
@[simp]
258+
lemma coe_map (f : R →⋆* S) (x : unitary R) : map f x = f x := rfl
259+
260+
@[simp]
261+
lemma coe_map_star (f : R →⋆* S) (x : unitary R) : map f (star x) = f (star x) := rfl
262+
263+
@[simp]
264+
lemma map_id : map (.id R) = .id (unitary R) := rfl
265+
266+
lemma map_comp (g : S →⋆* T) (f : R →⋆* S) : map (g.comp f) = (map g).comp (map f) := rfl
267+
268+
@[simp]
269+
lemma map_injective {f : R →⋆* S} (hf : Function.Injective f) :
270+
Function.Injective (map f : unitary R → unitary S) :=
271+
Subtype.map_injective (fun _ ↦ map_mem f) hf
272+
273+
lemma toUnits_comp_map (f : R →⋆* S) :
274+
toUnits.comp (map f).toMonoidHom = (Units.map f.toMonoidHom).comp toUnits := by
275+
ext; rfl
276+
277+
/-- The star monoid isomorphism between unitary subgroups induced by a star monoid isomorphism of
278+
the underlying star monoids. -/
279+
@[simps]
280+
def mapEquiv (f : R ≃⋆* S) : unitary R ≃⋆* unitary S :=
281+
{ map f.toStarMonoidHom with
282+
toFun := map f.toStarMonoidHom
283+
invFun := map f.symm.toStarMonoidHom
284+
left_inv := fun _ ↦ Subtype.ext <| f.left_inv _
285+
right_inv := fun _ ↦ Subtype.ext <| f.right_inv _ }
286+
287+
@[simp]
288+
lemma mapEquiv_refl : mapEquiv (.refl R) = .refl (unitary R) := rfl
289+
290+
@[simp]
291+
lemma mapEquiv_symm (f : R ≃⋆* S) : mapEquiv f.symm = (mapEquiv f).symm := rfl
292+
293+
@[simp]
294+
lemma mapEquiv_trans (f : R ≃⋆* S) (g : S ≃⋆* T) :
295+
mapEquiv (f.trans g) = (mapEquiv f).trans (mapEquiv g) :=
296+
rfl
297+
298+
@[simp]
299+
lemma toMonoidHom_mapEquiv (f : R ≃⋆* S) :
300+
(mapEquiv f).toStarMonoidHom = map f.toStarMonoidHom :=
301+
rfl
256302

257303
end Map
258304

0 commit comments

Comments
 (0)