Skip to content

Commit 3f81e05

Browse files
chore: split out Topology.EMetricSpace.Pi (#16507)
1 parent 3e18f17 commit 3f81e05

File tree

5 files changed

+93
-68
lines changed

5 files changed

+93
-68
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4504,6 +4504,7 @@ import Mathlib.Topology.EMetricSpace.Defs
45044504
import Mathlib.Topology.EMetricSpace.Diam
45054505
import Mathlib.Topology.EMetricSpace.Lipschitz
45064506
import Mathlib.Topology.EMetricSpace.Paracompact
4507+
import Mathlib.Topology.EMetricSpace.Pi
45074508
import Mathlib.Topology.ExtendFrom
45084509
import Mathlib.Topology.ExtremallyDisconnected
45094510
import Mathlib.Topology.FiberBundle.Basic

Mathlib/Topology/EMetricSpace/Basic.lean

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébas
55
-/
66
import Mathlib.Order.Interval.Finset.Nat
77
import Mathlib.Topology.EMetricSpace.Defs
8-
import Mathlib.Topology.UniformSpace.Pi
98
import Mathlib.Topology.UniformSpace.UniformConvergence
109
import Mathlib.Topology.UniformSpace.UniformEmbedding
1110

@@ -138,55 +137,6 @@ end EMetric
138137

139138
open EMetric
140139

141-
section Pi
142-
143-
open Finset
144-
145-
variable {π : β → Type*} [Fintype β]
146-
147-
-- Porting note: reordered instances
148-
instance [∀ b, EDist (π b)] : EDist (∀ b, π b) where
149-
edist f g := Finset.sup univ fun b => edist (f b) (g b)
150-
151-
theorem edist_pi_def [∀ b, EDist (π b)] (f g : ∀ b, π b) :
152-
edist f g = Finset.sup univ fun b => edist (f b) (g b) :=
153-
rfl
154-
155-
theorem edist_le_pi_edist [∀ b, EDist (π b)] (f g : ∀ b, π b) (b : β) :
156-
edist (f b) (g b) ≤ edist f g :=
157-
le_sup (f := fun b => edist (f b) (g b)) (Finset.mem_univ b)
158-
159-
theorem edist_pi_le_iff [∀ b, EDist (π b)] {f g : ∀ b, π b} {d : ℝ≥0∞} :
160-
edist f g ≤ d ↔ ∀ b, edist (f b) (g b) ≤ d :=
161-
Finset.sup_le_iff.trans <| by simp only [Finset.mem_univ, forall_const]
162-
163-
theorem edist_pi_const_le (a b : α) : (edist (fun _ : β => a) fun _ => b) ≤ edist a b :=
164-
edist_pi_le_iff.2 fun _ => le_rfl
165-
166-
@[simp]
167-
theorem edist_pi_const [Nonempty β] (a b : α) : (edist (fun _ : β => a) fun _ => b) = edist a b :=
168-
Finset.sup_const univ_nonempty (edist a b)
169-
170-
/-- The product of a finite number of pseudoemetric spaces, with the max distance, is still
171-
a pseudoemetric space.
172-
This construction would also work for infinite products, but it would not give rise
173-
to the product topology. Hence, we only formalize it in the good situation of finitely many
174-
spaces. -/
175-
instance pseudoEMetricSpacePi [∀ b, PseudoEMetricSpace (π b)] : PseudoEMetricSpace (∀ b, π b) where
176-
edist_self f := bot_unique <| Finset.sup_le <| by simp
177-
edist_comm f g := by simp [edist_pi_def, edist_comm]
178-
edist_triangle f g h := edist_pi_le_iff.2 fun b => le_trans (edist_triangle _ (g b) _)
179-
(add_le_add (edist_le_pi_edist _ _ _) (edist_le_pi_edist _ _ _))
180-
toUniformSpace := Pi.uniformSpace _
181-
uniformity_edist := by
182-
simp only [Pi.uniformity, PseudoEMetricSpace.uniformity_edist, comap_iInf, gt_iff_lt,
183-
preimage_setOf_eq, comap_principal, edist_pi_def]
184-
rw [iInf_comm]; congr; funext ε
185-
rw [iInf_comm]; congr; funext εpos
186-
simp [setOf_forall, εpos]
187-
188-
end Pi
189-
190140
namespace EMetric
191141

192142
variable {x y z : α} {ε ε₁ ε₂ : ℝ≥0∞} {s t : Set α}
@@ -299,22 +249,6 @@ corresponding to the product of uniform spaces, to avoid diamond problems. -/
299249
instance Prod.emetricSpaceMax [EMetricSpace β] : EMetricSpace (γ × β) :=
300250
.ofT0PseudoEMetricSpace _
301251

302-
section Pi
303-
304-
open Finset
305-
306-
variable {π : β → Type*} [Fintype β]
307-
308-
/-- The product of a finite number of emetric spaces, with the max distance, is still
309-
an emetric space.
310-
This construction would also work for infinite products, but it would not give rise
311-
to the product topology. Hence, we only formalize it in the good situation of finitely many
312-
spaces. -/
313-
instance emetricSpacePi [∀ b, EMetricSpace (π b)] : EMetricSpace (∀ b, π b) :=
314-
.ofT0PseudoEMetricSpace _
315-
316-
end Pi
317-
318252
namespace EMetric
319253

320254
/-- A compact set in an emetric space is separable, i.e., it is the closure of a countable set. -/

Mathlib/Topology/EMetricSpace/Diam.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2015, 2017 Jeremy Avigad. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébastien Gouëzel
55
-/
6-
import Mathlib.Topology.EMetricSpace.Basic
6+
import Mathlib.Topology.EMetricSpace.Pi
77
import Mathlib.Data.ENNReal.Real
88

99
/-!
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/-
2+
Copyright (c) 2015, 2017 Jeremy Avigad. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébastien Gouëzel
5+
-/
6+
import Mathlib.Topology.EMetricSpace.Basic
7+
import Mathlib.Topology.UniformSpace.Pi
8+
9+
/-!
10+
# Indexed product of extended metric spaces
11+
-/
12+
13+
open Set Filter
14+
15+
universe u v w
16+
17+
variable {α : Type u} {β : Type v} {X : Type*}
18+
19+
open scoped Uniformity Topology NNReal ENNReal Pointwise
20+
21+
variable [PseudoEMetricSpace α]
22+
23+
open EMetric
24+
25+
section Pi
26+
27+
open Finset
28+
29+
variable {π : β → Type*} [Fintype β]
30+
31+
-- Porting note: reordered instances
32+
instance [∀ b, EDist (π b)] : EDist (∀ b, π b) where
33+
edist f g := Finset.sup univ fun b => edist (f b) (g b)
34+
35+
theorem edist_pi_def [∀ b, EDist (π b)] (f g : ∀ b, π b) :
36+
edist f g = Finset.sup univ fun b => edist (f b) (g b) :=
37+
rfl
38+
39+
theorem edist_le_pi_edist [∀ b, EDist (π b)] (f g : ∀ b, π b) (b : β) :
40+
edist (f b) (g b) ≤ edist f g :=
41+
le_sup (f := fun b => edist (f b) (g b)) (Finset.mem_univ b)
42+
43+
theorem edist_pi_le_iff [∀ b, EDist (π b)] {f g : ∀ b, π b} {d : ℝ≥0∞} :
44+
edist f g ≤ d ↔ ∀ b, edist (f b) (g b) ≤ d :=
45+
Finset.sup_le_iff.trans <| by simp only [Finset.mem_univ, forall_const]
46+
47+
theorem edist_pi_const_le (a b : α) : (edist (fun _ : β => a) fun _ => b) ≤ edist a b :=
48+
edist_pi_le_iff.2 fun _ => le_rfl
49+
50+
@[simp]
51+
theorem edist_pi_const [Nonempty β] (a b : α) : (edist (fun _ : β => a) fun _ => b) = edist a b :=
52+
Finset.sup_const univ_nonempty (edist a b)
53+
54+
/-- The product of a finite number of pseudoemetric spaces, with the max distance, is still
55+
a pseudoemetric space.
56+
This construction would also work for infinite products, but it would not give rise
57+
to the product topology. Hence, we only formalize it in the good situation of finitely many
58+
spaces. -/
59+
instance pseudoEMetricSpacePi [∀ b, PseudoEMetricSpace (π b)] : PseudoEMetricSpace (∀ b, π b) where
60+
edist_self f := bot_unique <| Finset.sup_le <| by simp
61+
edist_comm f g := by simp [edist_pi_def, edist_comm]
62+
edist_triangle f g h := edist_pi_le_iff.2 fun b => le_trans (edist_triangle _ (g b) _)
63+
(add_le_add (edist_le_pi_edist _ _ _) (edist_le_pi_edist _ _ _))
64+
toUniformSpace := Pi.uniformSpace _
65+
uniformity_edist := by
66+
simp only [Pi.uniformity, PseudoEMetricSpace.uniformity_edist, comap_iInf, gt_iff_lt,
67+
preimage_setOf_eq, comap_principal, edist_pi_def]
68+
rw [iInf_comm]; congr; funext ε
69+
rw [iInf_comm]; congr; funext εpos
70+
simp [setOf_forall, εpos]
71+
72+
end Pi
73+
74+
variable {γ : Type w} [EMetricSpace γ]
75+
76+
section Pi
77+
78+
open Finset
79+
80+
variable {π : β → Type*} [Fintype β]
81+
82+
/-- The product of a finite number of emetric spaces, with the max distance, is still
83+
an emetric space.
84+
This construction would also work for infinite products, but it would not give rise
85+
to the product topology. Hence, we only formalize it in the good situation of finitely many
86+
spaces. -/
87+
instance emetricSpacePi [∀ b, EMetricSpace (π b)] : EMetricSpace (∀ b, π b) :=
88+
.ofT0PseudoEMetricSpace _
89+
90+
end Pi

Mathlib/Topology/MetricSpace/Pseudo/Pi.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébastien Gouëzel
55
-/
66
import Mathlib.Topology.Bornology.Constructions
7-
import Mathlib.Topology.EMetricSpace.Basic
7+
import Mathlib.Topology.EMetricSpace.Pi
88
import Mathlib.Topology.MetricSpace.Pseudo.Defs
99

1010
/-!

0 commit comments

Comments
 (0)