@@ -19,8 +19,8 @@ is given by
19
19
$$
20
20
d(x, y) = \left(\sum d(x_i, y_i)^p\right)^{1/p}.
21
21
$$,
22
- whereas for `p = 0` it is the cardinality of the set ${ i | x_i ≠ y_i }$. For `p = ∞` the distance
23
- is the supremum of the distances.
22
+ whereas for `p = 0` it is the cardinality of the set ${i | d ( x_i, y_i) ≠ 0 }$. For `p = ∞` the
23
+ distance is the supremum of the distances.
24
24
25
25
We give instances of this construction for emetric spaces, metric spaces, normed groups and normed
26
26
spaces.
@@ -129,13 +129,14 @@ satisfying a relaxed triangle inequality. The terminology for this varies throug
129
129
literature, but it is sometimes called a *quasi-metric* or *semi-metric* . -/
130
130
instance : EDist (PiLp p β) where
131
131
edist f g :=
132
- if p = 0 then { i | f i ≠ g i }.toFinite.toFinset.card
132
+ if p = 0 then {i | edist ( f i) ( g i) ≠ 0 }.toFinite.toFinset.card
133
133
else
134
134
if p = ∞ then ⨆ i, edist (f i) (g i) else (∑ i, edist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal)
135
135
136
136
variable {β}
137
137
138
- theorem edist_eq_card (f g : PiLp 0 β) : edist f g = { i | f i ≠ g i }.toFinite.toFinset.card :=
138
+ theorem edist_eq_card (f g : PiLp 0 β) :
139
+ edist f g = {i | edist (f i) (g i) ≠ 0 }.toFinite.toFinset.card :=
139
140
if_pos rfl
140
141
#align pi_Lp.edist_eq_card PiLp.edist_eq_card
141
142
@@ -170,7 +171,7 @@ protected theorem edist_self (f : PiLp p β) : edist f f = 0 := by
170
171
from `pi_Lp.pseudo_emetric_space` so it can be used also for `p < 1`. -/
171
172
protected theorem edist_comm (f g : PiLp p β) : edist f g = edist g f := by
172
173
rcases p.trichotomy with (rfl | rfl | h)
173
- · simp only [edist_eq_card, eq_comm, Ne.def ]
174
+ · simp only [edist_eq_card, edist_comm ]
174
175
· simp only [edist_eq_iSup, edist_comm]
175
176
· simp only [edist_eq_sum h, edist_comm]
176
177
#align pi_Lp.edist_comm PiLp.edist_comm
@@ -190,13 +191,14 @@ satisfying a relaxed triangle inequality. The terminology for this varies throug
190
191
literature, but it is sometimes called a *quasi-metric* or *semi-metric* . -/
191
192
instance : Dist (PiLp p α) where
192
193
dist f g :=
193
- if _hp : p = 0 then { i | f i ≠ g i }.toFinite.toFinset.card
194
+ if p = 0 then {i | dist ( f i) ( g i) ≠ 0 }.toFinite.toFinset.card
194
195
else
195
196
if p = ∞ then ⨆ i, dist (f i) (g i) else (∑ i, dist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal)
196
197
197
198
variable {α}
198
199
199
- theorem dist_eq_card (f g : PiLp 0 α) : dist f g = { i | f i ≠ g i }.toFinite.toFinset.card :=
200
+ theorem dist_eq_card (f g : PiLp 0 α) :
201
+ dist f g = {i | dist (f i) (g i) ≠ 0 }.toFinite.toFinset.card :=
200
202
if_pos rfl
201
203
#align pi_Lp.dist_eq_card PiLp.dist_eq_card
202
204
@@ -215,7 +217,7 @@ end Dist
215
217
216
218
section Norm
217
219
218
- variable [∀ i, Norm (β i)] [∀ i, Zero (β i)]
220
+ variable [∀ i, Norm (β i)]
219
221
220
222
/-- Endowing the space `PiLp p β` with the `L^p` norm. We register this instance
221
223
separate from `PiLp.seminormedAddCommGroup` since the latter requires the type class hypothesis
@@ -225,13 +227,13 @@ Registering this separately allows for a future norm-like structure on `PiLp p
225
227
satisfying a relaxed triangle inequality. These are called *quasi-norms* . -/
226
228
instance hasNorm : Norm (PiLp p β) where
227
229
norm f :=
228
- if _hp : p = 0 then { i | f i ≠ 0 }.toFinite.toFinset.card
230
+ if p = 0 then {i | ‖ f i‖ ≠ 0 }.toFinite.toFinset.card
229
231
else if p = ∞ then ⨆ i, ‖f i‖ else (∑ i, ‖f i‖ ^ p.toReal) ^ (1 / p.toReal)
230
232
#align pi_Lp.has_norm PiLp.hasNorm
231
233
232
234
variable {p β}
233
235
234
- theorem norm_eq_card (f : PiLp 0 β) : ‖f‖ = { i | f i ≠ 0 }.toFinite.toFinset.card :=
236
+ theorem norm_eq_card (f : PiLp 0 β) : ‖f‖ = {i | ‖ f i‖ ≠ 0 }.toFinite.toFinset.card :=
235
237
if_pos rfl
236
238
#align pi_Lp.norm_eq_card PiLp.norm_eq_card
237
239
0 commit comments