Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c39b43f

Browse files
committed
feat(analysis/metric_space): sup metric for product of metric spaces
1 parent 1dddcf6 commit c39b43f

File tree

7 files changed

+40
-8
lines changed

7 files changed

+40
-8
lines changed

algebra/linear_algebra/multivariate_polynomial.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ instance : has_add (mv_polynomial σ α) := finsupp.has_add
108108
instance : has_mul (mv_polynomial σ α) := finsupp.has_mul
109109
instance : comm_semiring (mv_polynomial σ α) := finsupp.to_comm_semiring
110110

111-
/-- monomial s a is the monomial `a * X^s` -/
111+
/-- `monomial s a` is the monomial `a * X^s` -/
112112
def monomial (s : σ →₀ ℕ) (a : α) : mv_polynomial σ α := single s a
113113

114-
/-- C a is the constant polynomial with value a -/
114+
/-- `C a` is the constant polynomial with value `a` -/
115115
def C (a : α) : mv_polynomial σ α := monomial 0 a
116116

117-
/-- X n is the polynomial with value X_n -/
117+
/-- `X n` is the polynomial with value X_n -/
118118
def X (n : σ) : mv_polynomial σ α := monomial (single n 1) 1
119119

120120
@[simp] lemma C_0 : C 0 = (0 : mv_polynomial σ α) := by simp [C, monomial]; refl

analysis/metric_space.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ nonneg_of_mul_nonneg_left this two_pos
9999
theorem dist_pos_of_ne {x y : α} (h : x ≠ y) : dist x y > 0 :=
100100
lt_of_le_of_ne dist_nonneg (by simp * at *)
101101

102+
theorem dist_le_zero_iff {x y : α} : dist x y ≤ 0 ↔ x = y :=
103+
by simpa [le_antisymm_iff, dist_nonneg] using @dist_eq_zero_iff _ _ x y
104+
102105
theorem ne_of_dist_pos {x y : α} (h : dist x y > 0) : x ≠ y :=
103106
assume : x = y,
104107
have 0 < (0:real), by simp [this] at h; exact h,
@@ -239,3 +242,23 @@ end
239242

240243
theorem is_open_metric : is_open s ↔ (∀x∈s, ∃ε>0, open_ball x ε ⊆ s) :=
241244
by simp [is_open_iff_nhds, mem_nhds_sets_iff_metric]
245+
246+
instance prod.metric_space_max [metric_space α] [metric_space β] : metric_space (α × β) :=
247+
{ dist := λ x y, max (dist x.1 y.1) (dist x.2 y.2),
248+
dist_self := λ x, by simp,
249+
eq_of_dist_eq_zero := λ x y h, begin
250+
cases max_le_iff.1 (le_of_eq h) with h₁ h₂,
251+
exact prod.ext.2 ⟨dist_le_zero_iff.1 h₁, dist_le_zero_iff.1 h₂⟩
252+
end,
253+
dist_comm := λ x y, by simp [dist_comm],
254+
dist_triangle := λ x y z, max_le
255+
(le_trans (dist_triangle _ _ _) (add_le_add (le_max_left _ _) (le_max_left _ _)))
256+
(le_trans (dist_triangle _ _ _) (add_le_add (le_max_right _ _) (le_max_right _ _))),
257+
uniformity_dist := begin
258+
refine prod_uniformity.trans _,
259+
simp [uniformity_dist, vmap_infi],
260+
rw ← infi_inf_eq, congr, funext,
261+
rw ← infi_inf_eq, congr, funext,
262+
simp [inf_principal, set_eq_def, max_lt_iff]
263+
end,
264+
to_uniform_space := prod.uniform_space }

analysis/topology/topological_space.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ end locally_finite
419419
/- compact sets -/
420420
section compact
421421

422-
/-- A set `s` is compact if every filter that contains `s` also contains every
422+
/-- A set `s` is compact if every filter that contains `s` also meets every
423423
neighborhood of some `a ∈ s`. -/
424424
def compact (s : set α) := ∀f, f ≠ ⊥ → f ≤ principal s → ∃a∈s, f ⊓ nhds a ≠ ⊥
425425

@@ -654,6 +654,7 @@ end topological_space
654654
namespace topological_space
655655
variables {α : Type u}
656656

657+
/-- The least topology containing a collection of basic sets. -/
657658
inductive generate_open (g : set (set α)) : set α → Prop
658659
| basic : ∀s∈g, generate_open s
659660
| univ : generate_open univ
@@ -742,7 +743,7 @@ lemma is_closed_induced_iff [t : topological_space β] {s : set α} {f : α →
742743
assume ⟨t, ht, heq⟩, ⟨-t, ht, by simp [preimage_compl, heq.symm]⟩⟩
743744

744745
/-- Given `f : α → β` and a topology on `α`, the coinduced topology on `β` is defined
745-
such that `s:set β` is open if the preimage of `s` is open. This is the coarsest topology that
746+
such that `s:set β` is open if the preimage of `s` is open. This is the finest topology that
746747
makes `f` continuous. -/
747748
def topological_space.coinduced {α : Type u} {β : Type v} (f : α → β) (t : topological_space α) :
748749
topological_space β :=

analysis/topology/uniform_space.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,11 @@ uniform_space.of_core_eq
13821382
by rw [to_topological_space_sup, to_topological_space_vmap, to_topological_space_vmap]; refl
13831383
... = _ : by rw [uniform_space.to_core_to_topological_space])
13841384

1385+
theorem prod_uniformity [uniform_space α] [uniform_space β] : @uniformity (α × β) _ =
1386+
uniformity.vmap (λp:(α × β) × α × β, (p.1.1, p.2.1)) ⊓
1387+
uniformity.vmap (λp:(α × β) × α × β, (p.1.2, p.2.2)) :=
1388+
sup_uniformity
1389+
13851390
lemma uniform_embedding_subtype_emb {α : Type*} {β : Type*} [uniform_space α] [uniform_space β]
13861391
(p : α → Prop) {e : α → β} (ue : uniform_embedding e) (de : dense_embedding e) :
13871392
uniform_embedding (de.subtype_emb p) :=

data/equiv.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ section
312312
def arrow_prod_equiv_prod_arrow (α β γ : Type*) : (γ → α × β) ≃ ((γ → α) × (γ → β)) :=
313313
⟨λ f, (λ c, (f c).1, λ c, (f c).2),
314314
λ p c, (p.1 c, p.2 c),
315-
λ f, funext $ λ c, prod.mk.eta,
315+
λ f, funext $ λ c, prod.mk.eta _,
316316
λ p, by cases p; refl⟩
317317

318318
def arrow_arrow_equiv_prod_arrow (α β γ : Sort*) : (α → β → γ) ≃ (α × β → γ) :=

data/prod.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ variables {α : Type u} {β : Type v}
1818
namespace prod
1919

2020
-- copied from parser
21-
@[simp] lemma mk.eta : ∀{p : α × β}, (p.1, p.2) = p
21+
@[simp] lemma mk.eta : ∀ p : α × β, (p.1, p.2) = p
2222
| (a, b) := rfl
2323

2424
@[simp] theorem mk.inj_iff {a₁ a₂ : α} {b₁ b₂ : β} : (a₁, b₁) = (a₂, b₂) ↔ (a₁ = a₂ ∧ b₁ = b₂) :=
2525
⟨prod.mk.inj, by cc⟩
2626

27+
lemma ext {p q : α × β} : p = q ↔ p.1 = q.1 ∧ p.2 = q.2 :=
28+
by rw [← mk.eta p, ← mk.eta q, mk.inj_iff]
29+
2730
/-- Swap the factors of a product. `swap (a, b) = (b, a)` -/
2831
def swap : α × β → β × α := λp, (p.2, p.1)
2932

order/complete_lattice.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ le_antisymm
346346

347347
attribute [ematch] le_refl
348348

349-
theorem infi_inf_eq {f g : β → α} : (⨅ x, f x ⊓ g x) = (⨅ x, f x) ⊓ (⨅ x, g x) :=
349+
theorem infi_inf_eq {f g : ι → α} : (⨅ x, f x ⊓ g x) = (⨅ x, f x) ⊓ (⨅ x, g x) :=
350350
le_antisymm
351351
(le_inf
352352
(le_infi $ assume i, infi_le_of_le i inf_le_left)

0 commit comments

Comments
 (0)