Skip to content

Commit ae9fca3

Browse files
committed
feat: add ContinuousMul instance on Icc 0 1 (#37786)
Co-authored-by: NoahW314 <noahwalker3.14@gmail.com>
1 parent ade87df commit ae9fca3

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

Mathlib/Algebra/Order/Interval/Set/Instances.lean

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Authors: Stuart Presnell, Eric Wieser, Yaël Dillies, Patrick Massot, Kim Morris
66
module
77

88
public import Mathlib.Algebra.GroupWithZero.InjSurj
9+
public import Mathlib.Algebra.GroupWithZero.Hom
910
public import Mathlib.Algebra.Order.Ring.Defs
11+
public import Mathlib.Algebra.Group.Hom.Defs
1012
public import Mathlib.Algebra.Ring.Regular
1113
public import Mathlib.Order.Interval.Set.Basic
1214
public 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+
146156
variable {β : Type*} [Ring β] [PartialOrder β] [IsOrderedRing β]
147157

148158
theorem 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+
211227
end Set.Ico
212228

213229
end 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+
293316
end 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+
323352
variable {β : Type*} [Ring β] [PartialOrder β] [IsOrderedRing β]
324353

325354
theorem one_sub_mem {t : β} (ht : t ∈ Ioo (0 : β) 1) : 1 - t ∈ Ioo (0 : β) 1 := by

Mathlib/Topology/Algebra/Algebra.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Algebra.Algebra.Subalgebra.Lattice
99
public import Mathlib.Algebra.Algebra.Tower
1010
public import Mathlib.Topology.Algebra.Module.LinearMap
11+
public import Mathlib.Algebra.Order.Interval.Set.Instances
1112

1213
/-!
1314
# Topological (sub)algebras
@@ -63,6 +64,22 @@ instance Subalgebra.continuousSMul (S : Subalgebra R A) (X) [TopologicalSpace X]
6364
[ContinuousSMul A X] : ContinuousSMul S X :=
6465
Subsemiring.continuousSMul S.toSubsemiring X
6566

67+
instance [PartialOrder A] [IsOrderedRing A] [ContinuousMul A] :
68+
ContinuousMul (Icc (0 : A) 1) :=
69+
Topology.IsInducing.subtypeVal.continuousMul Icc.coeMonoidWithZeroHom
70+
71+
instance [PartialOrder A] [IsOrderedRing A] [ContinuousMul A] :
72+
ContinuousMul (Ico (0 : A) 1) :=
73+
Topology.IsInducing.subtypeVal.continuousMul Ico.coeMulHom
74+
75+
instance [PartialOrder A] [IsStrictOrderedRing A] [ContinuousMul A] :
76+
ContinuousMul (Ioc (0 : A) 1) :=
77+
Topology.IsInducing.subtypeVal.continuousMul Ioc.coeMonoidHom
78+
79+
instance [PartialOrder A] [IsStrictOrderedRing A] [ContinuousMul A] :
80+
ContinuousMul (Ioo (0 : A) 1) :=
81+
Topology.IsInducing.subtypeVal.continuousMul Ioo.coeMulHom
82+
6683
section
6784
variable [ContinuousSMul R A]
6885

0 commit comments

Comments
 (0)