Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Mathlib/Algebra/Algebra/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,8 @@ theorem coe_linearMap : ⇑(Algebra.linearMap R A) = algebraMap R A :=

/-- The identity map inducing an `Algebra` structure. -/
instance (priority := 1100) id : Algebra R R where
-- We override `toFun` and `toSMul` because `RingHom.id` is not reducible and cannot
-- be made so without a significant performance hit.
-- see library note [reducible non-instances].
toSMul := instSMulOfMul
__ := ({ RingHom.id R with toFun x := x }).toAlgebra
__ := (RingHom.id R).toAlgebra

@[simp] lemma linearMap_self : Algebra.linearMap R R = .id := rfl

Expand Down
1 change: 1 addition & 0 deletions Mathlib/Algebra/Ring/Hom/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ def mk' [NonAssocSemiring α] [NonAssocRing β] (f : α →* β)
variable {_ : NonAssocSemiring α} {_ : NonAssocSemiring β}

/-- The identity ring homomorphism from a semiring to itself. -/
@[implicit_reducible]
def id (α : Type*) [NonAssocSemiring α] : α →+* α where
toFun := _root_.id
map_zero' := rfl
Expand Down
Loading