@@ -20,80 +20,165 @@ open Set Metric
20
20
21
21
variable {π : Type *}
22
22
23
+ /-!
24
+ ### Algebraic structures on `Metric.ball 0 1`
25
+ -/
26
+
23
27
/-- Unit ball in a non-unital seminormed ring as a bundled `Subsemigroup`. -/
24
28
def Subsemigroup.unitBall (π : Type *) [NonUnitalSeminormedRing π] : Subsemigroup π where
25
29
carrier := ball (0 : π) 1
26
30
mul_mem' hx hy := by
27
31
rw [mem_ball_zero_iff] at *
28
32
exact (norm_mul_le _ _).trans_lt (mul_lt_one_of_nonneg_of_lt_one_left (norm_nonneg _) hx hy.le)
29
33
30
- instance Metric.unitBall.semigroup [NonUnitalSeminormedRing π] : Semigroup (ball (0 : π) 1 ) :=
34
+ instance Metric.unitBall.instSemigroup [NonUnitalSeminormedRing π] : Semigroup (ball (0 : π) 1 ) :=
31
35
MulMemClass.toSemigroup (Subsemigroup.unitBall π)
32
36
33
- instance Metric.unitBall.continuousMul [NonUnitalSeminormedRing π] :
37
+ instance Metric.unitBall.instContinuousMul [NonUnitalSeminormedRing π] :
34
38
ContinuousMul (ball (0 : π) 1 ) :=
35
39
(Subsemigroup.unitBall π).continuousMul
36
40
37
- instance Metric.unitBall.commSemigroup [SeminormedCommRing π] : CommSemigroup (ball (0 : π) 1 ) :=
41
+ instance Metric.unitBall.instCommSemigroup [SeminormedCommRing π] :
42
+ CommSemigroup (ball (0 : π) 1 ) :=
38
43
MulMemClass.toCommSemigroup (Subsemigroup.unitBall π)
39
44
40
- instance Metric.unitBall.hasDistribNeg [NonUnitalSeminormedRing π] :
45
+ instance Metric.unitBall.instHasDistribNeg [NonUnitalSeminormedRing π] :
41
46
HasDistribNeg (ball (0 : π) 1 ) :=
42
47
Subtype.coe_injective.hasDistribNeg ((β) : ball (0 : π) 1 β π) (fun _ => rfl) fun _ _ => rfl
43
48
44
49
@[simp, norm_cast]
45
- theorem coe_mul_unitBall [NonUnitalSeminormedRing π] (x y : ball (0 : π) 1 ) :
50
+ protected theorem Metric.unitBall.coe_mul [NonUnitalSeminormedRing π] (x y : ball (0 : π) 1 ) :
46
51
β(x * y) = (x * y : π) :=
47
52
rfl
48
53
54
+ @[deprecated (since := "2025-04-18")]
55
+ alias coe_mul_unitBall := Metric.unitBall.coe_mul
56
+
57
+ instance Metric.unitBall.instZero [Zero π] [PseudoMetricSpace π] : Zero (ball (0 : π) 1 ) :=
58
+ β¨β¨0 , by simpβ©β©
59
+
60
+ @[simp, norm_cast]
61
+ protected theorem Metric.unitBall.coe_zero [Zero π] [PseudoMetricSpace π] :
62
+ ((0 : ball (0 : π) 1 ) : π) = 0 :=
63
+ rfl
64
+
65
+ @[simp, norm_cast]
66
+ protected theorem Metric.unitBall.coe_eq_zero [Zero π] [PseudoMetricSpace π] {a : ball (0 : π) 1 } :
67
+ (a : π) = 0 β a = 0 :=
68
+ Subtype.val_injective.eq_iff' unitBall.coe_zero
69
+
70
+ instance Metric.unitBall.instSemigroupWithZero [NonUnitalSeminormedRing π] :
71
+ SemigroupWithZero (ball (0 : π) 1 ) where
72
+ zero_mul _ := Subtype.eq <| zero_mul _
73
+ mul_zero _ := Subtype.eq <| mul_zero _
74
+
75
+ instance Metric.unitBall.instIsLeftCancelMulZero [NonUnitalSeminormedRing π]
76
+ [IsLeftCancelMulZero π] : IsLeftCancelMulZero (ball (0 : π) 1 ) :=
77
+ Subtype.val_injective.isLeftCancelMulZero _ rfl fun _ _ β¦ rfl
78
+
79
+ instance Metric.unitBall.instIsRightCancelMulZero [NonUnitalSeminormedRing π]
80
+ [IsRightCancelMulZero π] : IsRightCancelMulZero (ball (0 : π) 1 ) :=
81
+ Subtype.val_injective.isRightCancelMulZero _ rfl fun _ _ β¦ rfl
82
+
83
+ instance Metric.unitBall.instIsCancelMulZero [NonUnitalSeminormedRing π]
84
+ [IsCancelMulZero π] : IsCancelMulZero (ball (0 : π) 1 ) where
85
+
86
+ /-!
87
+ ### Algebraic instances for `Metric.closedBall 0 1`
88
+ -/
89
+
49
90
/-- Closed unit ball in a non-unital seminormed ring as a bundled `Subsemigroup`. -/
50
91
def Subsemigroup.unitClosedBall (π : Type *) [NonUnitalSeminormedRing π] : Subsemigroup π where
51
92
carrier := closedBall 0 1
52
93
mul_mem' hx hy := by
53
94
rw [mem_closedBall_zero_iff] at *
54
95
exact (norm_mul_le _ _).trans (mul_le_oneβ hx (norm_nonneg _) hy)
55
96
56
- instance Metric.unitClosedBall.semigroup [NonUnitalSeminormedRing π] :
97
+ instance Metric.unitClosedBall.instSemigroup [NonUnitalSeminormedRing π] :
57
98
Semigroup (closedBall (0 : π) 1 ) :=
58
99
MulMemClass.toSemigroup (Subsemigroup.unitClosedBall π)
59
100
60
- instance Metric.unitClosedBall.hasDistribNeg [NonUnitalSeminormedRing π] :
101
+ instance Metric.unitClosedBall.instHasDistribNeg [NonUnitalSeminormedRing π] :
61
102
HasDistribNeg (closedBall (0 : π) 1 ) :=
62
103
Subtype.coe_injective.hasDistribNeg ((β) : closedBall (0 : π) 1 β π) (fun _ => rfl) fun _ _ => rfl
63
104
64
- instance Metric.unitClosedBall.continuousMul [NonUnitalSeminormedRing π] :
105
+ instance Metric.unitClosedBall.instContinuousMul [NonUnitalSeminormedRing π] :
65
106
ContinuousMul (closedBall (0 : π) 1 ) :=
66
107
(Subsemigroup.unitClosedBall π).continuousMul
67
108
68
109
@[simp, norm_cast]
69
- theorem coe_mul_unitClosedBall [NonUnitalSeminormedRing π] (x y : closedBall ( 0 : π) 1 ) :
70
- β(x * y) = (x * y : π) :=
110
+ protected theorem Metric.unitClosedBall.coe_mul [NonUnitalSeminormedRing π]
111
+ (x y : closedBall ( 0 : π) 1 ) : β(x * y) = (x * y : π) :=
71
112
rfl
72
113
114
+ @[deprecated (since := "2025-04-18")]
115
+ alias coe_mul_unitClosedBall := Metric.unitClosedBall.coe_mul
116
+
117
+ instance Metric.unitClosedBall.instZero [Zero π] [PseudoMetricSpace π] :
118
+ Zero (closedBall (0 : π) 1 ) where
119
+ zero := β¨0 , by simpβ©
120
+
121
+ @[simp, norm_cast]
122
+ protected lemma Metric.unitClosedBall.coe_zero [Zero π] [PseudoMetricSpace π] :
123
+ ((0 : closedBall (0 : π) 1 ) : π) = 0 :=
124
+ rfl
125
+
126
+ @[simp, norm_cast]
127
+ protected lemma Metric.unitClosedBall.coe_eq_zero [Zero π] [PseudoMetricSpace π]
128
+ {a : closedBall (0 : π) 1 } : (a : π) = 0 β a = 0 :=
129
+ Subtype.val_injective.eq_iff' unitClosedBall.coe_zero
130
+
131
+ instance Metric.unitClosedBall.instSemigroupWithZero [NonUnitalSeminormedRing π] :
132
+ SemigroupWithZero (closedBall (0 : π) 1 ) where
133
+ zero_mul _ := Subtype.eq <| zero_mul _
134
+ mul_zero _ := Subtype.eq <| mul_zero _
135
+
73
136
/-- Closed unit ball in a seminormed ring as a bundled `Submonoid`. -/
74
137
def Submonoid.unitClosedBall (π : Type *) [SeminormedRing π] [NormOneClass π] : Submonoid π :=
75
138
{ Subsemigroup.unitClosedBall π with
76
139
carrier := closedBall 0 1
77
140
one_mem' := mem_closedBall_zero_iff.2 norm_one.le }
78
141
79
- instance Metric.unitClosedBall.monoid [SeminormedRing π] [NormOneClass π] :
142
+ instance Metric.unitClosedBall.instMonoid [SeminormedRing π] [NormOneClass π] :
80
143
Monoid (closedBall (0 : π) 1 ) :=
81
144
SubmonoidClass.toMonoid (Submonoid.unitClosedBall π)
82
145
83
- instance Metric.unitClosedBall.commMonoid [SeminormedCommRing π] [NormOneClass π] :
146
+ instance Metric.unitClosedBall.instCommMonoid [SeminormedCommRing π] [NormOneClass π] :
84
147
CommMonoid (closedBall (0 : π) 1 ) :=
85
148
SubmonoidClass.toCommMonoid (Submonoid.unitClosedBall π)
86
149
87
150
@[simp, norm_cast]
88
- theorem coe_one_unitClosedBall [SeminormedRing π] [NormOneClass π] :
151
+ protected theorem Metric.unitClosedBall.coe_one [SeminormedRing π] [NormOneClass π] :
89
152
((1 : closedBall (0 : π) 1 ) : π) = 1 :=
90
153
rfl
91
154
155
+ @[deprecated (since := "2025-04-18")]
156
+ alias coe_one_unitClosedBall := Metric.unitClosedBall.coe_one
157
+
92
158
@[simp, norm_cast]
93
- theorem coe_pow_unitClosedBall [SeminormedRing π] [NormOneClass π] (x : closedBall (0 : π) 1 )
94
- (n : β) : β(x ^ n) = (x : π) ^ n :=
159
+ protected theorem Metric.unitClosedBall.coe_eq_one [SeminormedRing π] [NormOneClass π]
160
+ {a : closedBall (0 : π) 1 } : (a : π) = 1 β a = 1 :=
161
+ Subtype.val_injective.eq_iff' unitClosedBall.coe_one
162
+
163
+ @[simp, norm_cast]
164
+ protected theorem Metric.unitClosedBall.coe_pow [SeminormedRing π] [NormOneClass π]
165
+ (x : closedBall (0 : π) 1 ) (n : β) : β(x ^ n) = (x : π) ^ n :=
95
166
rfl
96
167
168
+ @[deprecated (since := "2025-04-18")]
169
+ alias coe_pow_unitClosedBall := Metric.unitClosedBall.coe_pow
170
+
171
+ instance Metric.unitClosedBall.instMonoidWithZero [SeminormedRing π] [NormOneClass π] :
172
+ MonoidWithZero (closedBall (0 : π) 1 ) where
173
+
174
+ instance Metric.unitClosedBall.instCancelMonoidWithZero [SeminormedRing π] [IsCancelMulZero π]
175
+ [NormOneClass π] : CancelMonoidWithZero (closedBall (0 : π) 1 ) where
176
+ toIsCancelMulZero := Subtype.val_injective.isCancelMulZero _ rfl fun _ _ β¦ rfl
177
+
178
+ /-!
179
+ ### Algebraic instances on the unit sphere
180
+ -/
181
+
97
182
/-- Unit sphere in a seminormed ring (with strictly multiplicative norm) as a bundled
98
183
`Submonoid`. -/
99
184
@[simps]
@@ -105,63 +190,74 @@ def Submonoid.unitSphere (π : Type*) [SeminormedRing π] [NormMulClass π
105
190
simp [*]
106
191
one_mem' := mem_sphere_zero_iff_norm.2 norm_one
107
192
108
- instance Metric.unitSphere.inv [NormedDivisionRing π] : Inv (sphere (0 : π) 1 ) :=
109
- β¨fun x =>
110
- β¨xβ»ΒΉ,
111
- mem_sphere_zero_iff_norm.2 <| by
112
- rw [norm_inv, mem_sphere_zero_iff_norm.1 x.coe_prop, inv_one]β©β©
193
+ instance Metric.unitSphere.instInv [NormedDivisionRing π] : Inv (sphere (0 : π) 1 ) where
194
+ inv x := β¨xβ»ΒΉ, mem_sphere_zero_iff_norm.2 <| by
195
+ rw [norm_inv, mem_sphere_zero_iff_norm.1 x.coe_prop, inv_one]β©
113
196
114
197
@[simp, norm_cast]
115
- theorem coe_inv_unitSphere [NormedDivisionRing π] (x : sphere (0 : π) 1 ) : βxβ»ΒΉ = (xβ»ΒΉ : π) :=
198
+ theorem Metric.unitSphere.coe_inv [NormedDivisionRing π] (x : sphere (0 : π) 1 ) :
199
+ βxβ»ΒΉ = (xβ»ΒΉ : π) :=
116
200
rfl
117
201
118
- instance Metric.unitSphere.div [NormedDivisionRing π] : Div (sphere ( 0 : π) 1 ) :=
119
- β¨ fun x y =>
120
- β¨x / y,
121
- mem_sphere_zero_iff_norm. 2 <| by
122
- rw [norm_div, mem_sphere_zero_iff_norm. 1 x.coe_prop, mem_sphere_zero_iff_norm.1 y.coe_prop,
123
- div_one]β©β©
202
+ @[deprecated (since := "2025-04-18")]
203
+ alias coe_inv_unitSphere := Metric.unitSphere.coe_inv
204
+
205
+ instance Metric.unitSphere.instDiv [NormedDivisionRing π] : Div (sphere ( 0 : π) 1 ) where
206
+ div x y := .mk (x / y) <| mem_sphere_zero_iff_norm.2 <| by
207
+ rw [norm_div, mem_sphere_zero_iff_norm. 1 x. 2 , mem_sphere_zero_iff_norm. 1 y.coe_prop, div_one]
124
208
125
209
@[simp, norm_cast]
126
- theorem coe_div_unitSphere [NormedDivisionRing π] (x y : sphere (0 : π) 1 ) :
210
+ protected theorem Metric.unitSphere.coe_div [NormedDivisionRing π] (x y : sphere (0 : π) 1 ) :
127
211
β(x / y) = (x / y : π) :=
128
212
rfl
129
213
130
- instance Metric.unitSphere.pow [NormedDivisionRing π] : Pow (sphere (0 : π) 1 ) β€ :=
131
- β¨fun x n =>
132
- β¨(x : π) ^ n, by
133
- rw [mem_sphere_zero_iff_norm, norm_zpow, mem_sphere_zero_iff_norm.1 x.coe_prop, one_zpow]β©β©
214
+ @[deprecated (since := "2025-04-18")]
215
+ alias coe_div_unitSphere := Metric.unitSphere.coe_div
216
+
217
+ instance Metric.unitSphere.instZPow [NormedDivisionRing π] : Pow (sphere (0 : π) 1 ) β€ where
218
+ pow x n := .mk ((x : π) ^ n) <| by
219
+ rw [mem_sphere_zero_iff_norm, norm_zpow, mem_sphere_zero_iff_norm.1 x.coe_prop, one_zpow]
134
220
135
221
@[simp, norm_cast]
136
- theorem coe_zpow_unitSphere [NormedDivisionRing π] (x : sphere (0 : π) 1 ) (n : β€) :
222
+ theorem Metric.unitSphere.coe_zpow [NormedDivisionRing π] (x : sphere (0 : π) 1 ) (n : β€) :
137
223
β(x ^ n) = (x : π) ^ n :=
138
224
rfl
139
225
140
- instance Metric.unitSphere.monoid [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
226
+ @[deprecated (since := "2025-04-18")]
227
+ alias coe_zpow_unitSphere := Metric.unitSphere.coe_zpow
228
+
229
+ instance Metric.unitSphere.instMonoid [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
141
230
Monoid (sphere (0 : π) 1 ) :=
142
231
SubmonoidClass.toMonoid (Submonoid.unitSphere π)
143
232
144
- instance Metric.unitSphere.commMonoid [SeminormedCommRing π] [NormMulClass π] [NormOneClass π] :
233
+ instance Metric.unitSphere.instCommMonoid [SeminormedCommRing π] [NormMulClass π] [NormOneClass π] :
145
234
CommMonoid (sphere (0 : π) 1 ) :=
146
235
SubmonoidClass.toCommMonoid (Submonoid.unitSphere π)
147
236
148
237
@[simp, norm_cast]
149
- theorem coe_one_unitSphere [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
238
+ protected theorem Metric.unitSphere.coe_one [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
150
239
((1 : sphere (0 : π) 1 ) : π) = 1 :=
151
240
rfl
152
241
242
+ @[deprecated (since := "2025-04-18")]
243
+ alias coe_one_unitSphere := Metric.unitSphere.coe_one
244
+
153
245
@[simp, norm_cast]
154
- theorem coe_mul_unitSphere [SeminormedRing π] [NormMulClass π] [NormOneClass π]
155
- (x y : sphere (0 : π) 1 ) :
156
- β(x * y) = (x * y : π) :=
246
+ theorem Metric.unitSphere.coe_mul [SeminormedRing π] [NormMulClass π] [NormOneClass π]
247
+ (x y : sphere (0 : π) 1 ) : β(x * y) = (x * y : π) :=
157
248
rfl
158
249
250
+ @[deprecated (since := "2025-04-18")]
251
+ alias coe_mul_unitSphere := Metric.unitSphere.coe_mul
252
+
159
253
@[simp, norm_cast]
160
- theorem coe_pow_unitSphere [SeminormedRing π] [NormMulClass π] [NormOneClass π]
161
- (x : sphere (0 : π) 1 ) (n : β) :
162
- β(x ^ n) = (x : π) ^ n :=
254
+ theorem Metric.unitSphere.coe_pow [SeminormedRing π] [NormMulClass π] [NormOneClass π]
255
+ (x : sphere (0 : π) 1 ) (n : β) : β(x ^ n) = (x : π) ^ n :=
163
256
rfl
164
257
258
+ @[deprecated (since := "2025-04-18")]
259
+ alias coe_pow_unitSphere := Metric.unitSphere.coe_pow
260
+
165
261
/-- Monoid homomorphism from the unit sphere in a normed division ring to the group of units. -/
166
262
def unitSphereToUnits (π : Type *) [NormedDivisionRing π] : sphere (0 : π) 1 β* Units π :=
167
263
Units.liftRight (Submonoid.unitSphere π).subtype
@@ -176,25 +272,23 @@ theorem unitSphereToUnits_injective [NormedDivisionRing π] :
176
272
Function.Injective (unitSphereToUnits π) := fun x y h =>
177
273
Subtype.eq <| by convert congr_arg Units.val h
178
274
179
- instance Metric.sphere.group [NormedDivisionRing π] : Group (sphere (0 : π) 1 ) :=
275
+ instance Metric.unitSphere.instGroup [NormedDivisionRing π] : Group (sphere (0 : π) 1 ) :=
180
276
unitSphereToUnits_injective.group (unitSphereToUnits π) (Units.ext rfl)
181
277
(fun _x _y => Units.ext rfl)
182
278
(fun _x => Units.ext rfl) (fun _x _y => Units.ext <| div_eq_mul_inv _ _)
183
279
(fun x n => Units.ext (Units.val_pow_eq_pow_val (unitSphereToUnits π x) n).symm) fun x n =>
184
280
Units.ext (Units.val_zpow_eq_zpow_val (unitSphereToUnits π x) n).symm
185
281
186
- instance Metric.sphere.hasDistribNeg [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
282
+ instance Metric.sphere.instHasDistribNeg [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
187
283
HasDistribNeg (sphere (0 : π) 1 ) :=
188
284
Subtype.coe_injective.hasDistribNeg ((β) : sphere (0 : π) 1 β π) (fun _ => rfl) fun _ _ => rfl
189
285
190
- instance Metric.sphere.continuousMul [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
286
+ instance Metric.sphere.instContinuousMul [SeminormedRing π] [NormMulClass π] [NormOneClass π] :
191
287
ContinuousMul (sphere (0 : π) 1 ) :=
192
288
(Submonoid.unitSphere π).continuousMul
193
289
194
- instance Metric.sphere.topologicalGroup [NormedDivisionRing π] :
290
+ instance Metric.sphere.instIsTopologicalGroup [NormedDivisionRing π] :
195
291
IsTopologicalGroup (sphere (0 : π) 1 ) where
196
292
continuous_inv := (continuous_subtype_val.invβ ne_zero_of_mem_unit_sphere).subtype_mk _
197
293
198
- instance Metric.sphere.commGroup [NormedField π] : CommGroup (sphere (0 : π) 1 ) :=
199
- { Metric.sphere.group,
200
- Subtype.coe_injective.commMonoid _ rfl (fun _ _ => rfl) (fun _ _ => rfl) with }
294
+ instance Metric.sphere.instCommGroup [NormedField π] : CommGroup (sphere (0 : π) 1 ) where
0 commit comments