@@ -6,7 +6,9 @@ Authors: Stuart Presnell, Eric Wieser, Yaël Dillies, Patrick Massot, Kim Morris
66module
77
88public import Mathlib.Algebra.GroupWithZero.InjSurj
9+ public import Mathlib.Algebra.GroupWithZero.Hom
910public import Mathlib.Algebra.Order.Ring.Defs
11+ public import Mathlib.Algebra.Group.Hom.Defs
1012public import Mathlib.Algebra.Ring.Regular
1113public import Mathlib.Order.Interval.Set.Basic
1214public import Mathlib.Tactic.FastInstance
@@ -143,6 +145,14 @@ instance instIsCancelMulZero {R : Type*} [Ring R] [PartialOrder R] [IsOrderedRin
143145 @Function.Injective.isCancelMulZero _ R _ _ _ _ _ Subtype.coe_injective coe_zero coe_mul
144146 NoZeroDivisors.toIsCancelMulZero
145147
148+ /-- The coercion from `Set.Icc 0 1` as a `MonoidWithZeroHom`. -/
149+ @[simps]
150+ def coeMonoidWithZeroHom : (Icc (0 : R) 1 ) →*₀ R where
151+ toFun := (↑)
152+ map_mul' := coe_mul
153+ map_one' := rfl
154+ map_zero' := rfl
155+
146156variable {β : Type *} [Ring β] [PartialOrder β] [IsOrderedRing β]
147157
148158theorem one_sub_mem {t : β} (ht : t ∈ Icc (0 : β) 1 ) : 1 - t ∈ Icc (0 : β) 1 := by
@@ -208,6 +218,12 @@ instance instCommSemigroup {R : Type*} [CommSemiring R] [PartialOrder R] [IsOrde
208218 CommSemigroup (Ico (0 : R) 1 ) := fast_instance%
209219 Subtype.coe_injective.commSemigroup _ coe_mul
210220
221+ /-- The coercion from `Set.Ico 0 1` as a `MulHom`. -/
222+ @[simps]
223+ def coeMulHom : (Ico (0 : R) 1 ) →ₙ* R where
224+ toFun := (↑)
225+ map_mul' := coe_mul
226+
211227end Set.Ico
212228
213229end OrderedSemiring
@@ -290,6 +306,13 @@ instance instCancelCommMonoid {R : Type*} [CommRing R] [PartialOrder R] [IsStric
290306 CancelCommMonoid (Ioc (0 : R) 1 ) :=
291307 { Set.Ioc.instCommMonoid, Set.Ioc.instCancelMonoid with }
292308
309+ /-- The coercion from `Set.Ioc 0 1` as a `MonoidHom`. -/
310+ @[simps]
311+ def coeMonoidHom : (Ioc (0 : R) 1 ) →* R where
312+ toFun := (↑)
313+ map_mul' := coe_mul
314+ map_one' := rfl
315+
293316end Set.Ioc
294317
295318/-! ### Instances for `↥(Set.Ioo 0 1)` -/
@@ -320,6 +343,12 @@ instance instCommSemigroup {R : Type*} [CommSemiring R] [PartialOrder R] [IsStri
320343 CommSemigroup (Ioo (0 : R) 1 ) := fast_instance%
321344 Subtype.coe_injective.commSemigroup _ coe_mul
322345
346+ /-- The coercion from `Set.Ioo 0 1` as a `MulHom`. -/
347+ @[simps]
348+ def coeMulHom : (Ioo (0 : R) 1 ) →ₙ* R where
349+ toFun := (↑)
350+ map_mul' := coe_mul
351+
323352variable {β : Type *} [Ring β] [PartialOrder β] [IsOrderedRing β]
324353
325354theorem one_sub_mem {t : β} (ht : t ∈ Ioo (0 : β) 1 ) : 1 - t ∈ Ioo (0 : β) 1 := by
0 commit comments