Skip to content

Commit 98d019b

Browse files
committed
feat(Algebra/Group/Equiv): MulEquiv.funUnique (leanprover-community#33453)
This already exists for a bunch of other kinds of equivs.
1 parent d3acd13 commit 98d019b

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

Mathlib/Algebra/Group/Equiv/Basic.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ namespace MulEquiv
5353
section Mul
5454
variable [Mul M] [Mul N] [Mul P]
5555

56-
section unique
57-
5856
/-- The `MulEquiv` between two monoids with a unique element. -/
5957
@[to_additive /-- The `AddEquiv` between two `AddMonoid`s with a unique element. -/]
6058
def ofUnique {M N} [Unique M] [Unique N] [Mul M] [Mul N] : M ≃* N :=
@@ -67,7 +65,13 @@ instance {M N} [Unique M] [Unique N] [Mul M] [Mul N] : Unique (M ≃* N) where
6765
default := ofUnique
6866
uniq _ := ext fun _ => Subsingleton.elim _ _
6967

70-
end unique
68+
variable (α M) in
69+
/-- If `α` has a unique term, then the product of magmas `α → M` is isomorphic to `M`. -/
70+
@[to_additive (attr := simps!)
71+
/-- If `α` has a unique term, then the product of magmas `α → M` is isomorphic to `M`. -/]
72+
def funUnique [Unique α] : (α → M) ≃* M where
73+
toEquiv := .funUnique ..
74+
map_mul' := by simp
7175

7276
end Mul
7377

Mathlib/LinearAlgebra/Pi.lean

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,9 @@ theorem sumArrowLequivProdArrow_symm_apply_inr {α β} (f : α → M) (g : β
578578
/-- If `ι` has a unique element, then `ι → M` is linearly equivalent to `M`. -/
579579
@[simps +simpRhs -fullyApplied symm_apply]
580580
def funUnique (ι R M : Type*) [Unique ι] [Semiring R] [AddCommMonoid M] [Module R M] :
581-
(ι → M) ≃ₗ[R] M :=
582-
{ Equiv.funUnique ι M with
583-
map_add' := fun _ _ => rfl
584-
map_smul' := fun _ _ => rfl }
581+
(ι → M) ≃ₗ[R] M where
582+
toAddEquiv := .funUnique ι M
583+
map_smul' _ _ := rfl
585584

586585
@[simp]
587586
theorem funUnique_apply (ι R M : Type*) [Unique ι] [Semiring R] [AddCommMonoid M] [Module R M] :

0 commit comments

Comments
 (0)