fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
protected eq_of_dist_eq_zero (x y : ∀ n, E n) (hxy : dist x y = 0) : x = y := by rcases eq_or_ne x y with (rfl | h); · rfl simp [dist_eq_of_ne h] at hxy
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
eq_of_dist_eq_zero
null
mem_cylinder_iff_dist_le {x y : ∀ n, E n} {n : ℕ} : y ∈ cylinder x n ↔ dist y x ≤ (1 / 2) ^ n := by rcases eq_or_ne y x with (rfl | hne) · simp [PiNat.dist_self] suffices (∀ i : ℕ, i < n → y i = x i) ↔ n ≤ firstDiff y x by simpa [dist_eq_of_ne hne] constructor · intro hy by_contra! H exact apply_firstDiff_ne hne (hy _ H) · intro h i hi exact apply_eq_of_lt_firstDiff (hi.trans_le h)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
mem_cylinder_iff_dist_le
null
apply_eq_of_dist_lt {x y : ∀ n, E n} {n : ℕ} (h : dist x y < (1 / 2) ^ n) {i : ℕ} (hi : i ≤ n) : x i = y i := by rcases eq_or_ne x y with (rfl | hne) · rfl have : n < firstDiff x y := by simpa [dist_eq_of_ne hne, inv_lt_inv₀, pow_lt_pow_iff_right₀, one_lt_two] using h exact apply_eq_of_lt_firstDiff (hi.trans_lt this)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
apply_eq_of_dist_lt
null
lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder {α : Type*} [PseudoMetricSpace α] {f : (∀ n, E n) → α} : (∀ x y : ∀ n, E n, dist (f x) (f y) ≤ dist x y) ↔ ∀ x y n, y ∈ cylinder x n → dist (f x) (f y) ≤ (1 / 2) ^ n := by constructor · intro H x y n hxy apply (H x y).trans rw [PiNat.dist_comm] exact mem_cylinder_iff_dist_le.1 hxy · intro H x y rcases eq_or_ne x y with (rfl | hne) · simp [PiNat.dist_nonneg] rw [dist_eq_of_ne hne] apply H x y (firstDiff x y) rw [firstDiff_comm] exact mem_cylinder_firstDiff _ _ variable (E) variable [∀ n, TopologicalSpace (E n)] [∀ n, DiscreteTopology (E n)]
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
lipschitz_with_one_iff_forall_dist_image_le_of_mem_cylinder
A function to a pseudo-metric-space is `1`-Lipschitz if and only if points in the same cylinder of length `n` are sent to points within distance `(1/2)^n`. Not expressed using `LipschitzWith` as we don't have a metric space structure
isOpen_cylinder (x : ∀ n, E n) (n : ℕ) : IsOpen (cylinder x n) := by rw [PiNat.cylinder_eq_pi] exact isOpen_set_pi (Finset.range n).finite_toSet fun a _ => isOpen_discrete _
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
isOpen_cylinder
null
isTopologicalBasis_cylinders : IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n } := by apply isTopologicalBasis_of_isOpen_of_nhds · rintro u ⟨x, n, rfl⟩ apply isOpen_cylinder · intro x u hx u_open obtain ⟨v, ⟨U, F, -, rfl⟩, xU, Uu⟩ : ∃ v ∈ { S : Set (∀ i : ℕ, E i) | ∃ (U : ∀ i : ℕ, Set (E i)) (F : Finset ℕ), (∀ i : ℕ, i ∈ F → U i ∈ { s : Set (E i) | IsOpen s }) ∧ S = (F : Set ℕ).pi U }, x ∈ v ∧ v ⊆ u := (isTopologicalBasis_pi fun n : ℕ => isTopologicalBasis_opens).exists_subset_of_mem_open hx u_open rcases Finset.bddAbove F with ⟨n, hn⟩ refine ⟨cylinder x (n + 1), ⟨x, n + 1, rfl⟩, self_mem_cylinder _ _, Subset.trans ?_ Uu⟩ intro y hy suffices ∀ i : ℕ, i ∈ F → y i ∈ U i by simpa intro i hi have : y i = x i := mem_cylinder_iff.1 hy i ((hn hi).trans_lt (lt_add_one n)) rw [this] simp only [Set.mem_pi, Finset.mem_coe] at xU exact xU i hi variable {E}
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
isTopologicalBasis_cylinders
null
isOpen_iff_dist (s : Set (∀ n, E n)) : IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s := by constructor · intro hs x hx obtain ⟨v, ⟨y, n, rfl⟩, h'x, h's⟩ : ∃ v ∈ { s | ∃ (x : ∀ n : ℕ, E n) (n : ℕ), s = cylinder x n }, x ∈ v ∧ v ⊆ s := (isTopologicalBasis_cylinders E).exists_subset_of_mem_open hx hs rw [← mem_cylinder_iff_eq.1 h'x] at h's exact ⟨(1 / 2 : ℝ) ^ n, by simp, fun y hy => h's fun i hi => (apply_eq_of_dist_lt hy hi.le).symm⟩ · intro h refine (isTopologicalBasis_cylinders E).isOpen_iff.2 fun x hx => ?_ rcases h x hx with ⟨ε, εpos, hε⟩ obtain ⟨n, hn⟩ : ∃ n : ℕ, (1 / 2 : ℝ) ^ n < ε := exists_pow_lt_of_lt_one εpos one_half_lt_one refine ⟨cylinder x n, ⟨x, n, rfl⟩, self_mem_cylinder x n, fun y hy => hε y ?_⟩ rw [PiNat.dist_comm] exact (mem_cylinder_iff_dist_le.1 hy).trans_lt hn
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
isOpen_iff_dist
null
protected metricSpace : MetricSpace (∀ n, E n) := MetricSpace.ofDistTopology dist PiNat.dist_self PiNat.dist_comm PiNat.dist_triangle isOpen_iff_dist PiNat.eq_of_dist_eq_zero
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
metricSpace
Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete topology, where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and `y` differ. Not registered as a global instance by default. Warning: this definition makes sure that the topology is defeq to the original product topology, but it does not take care of a possible uniformity. If the `E n` have a uniform structure, then there will be two non-defeq uniform structures on `Π n, E n`, the product one and the one coming from the metric structure. In this case, use `metricSpaceOfDiscreteUniformity` instead.
protected metricSpaceOfDiscreteUniformity {E : ℕ → Type*} [∀ n, UniformSpace (E n)] (h : ∀ n, uniformity (E n) = 𝓟 idRel) : MetricSpace (∀ n, E n) := haveI : ∀ n, DiscreteTopology (E n) := fun n => discreteTopology_of_discrete_uniformity (h n) { dist_triangle := PiNat.dist_triangle dist_comm := PiNat.dist_comm dist_self := PiNat.dist_self eq_of_dist_eq_zero := PiNat.eq_of_dist_eq_zero _ _ toUniformSpace := Pi.uniformSpace _ uniformity_dist := by simp only [Pi.uniformity, h, idRel, comap_principal, preimage_setOf_eq] apply le_antisymm · simp only [le_iInf_iff, le_principal_iff] intro ε εpos obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < ε := exists_pow_lt_of_lt_one εpos (by norm_num) apply @mem_iInf_of_iInter _ _ _ _ _ (Finset.range n).finite_toSet fun i => { p : (∀ n : ℕ, E n) × ∀ n : ℕ, E n | p.fst i = p.snd i } · simp only [mem_principal, setOf_subset_setOf, imp_self, imp_true_iff] · rintro ⟨x, y⟩ hxy simp only [Finset.mem_coe, Finset.mem_range, iInter_coe_set, mem_iInter, mem_setOf_eq] at hxy apply lt_of_le_of_lt _ hn rw [← mem_cylinder_iff_dist_le, mem_cylinder_iff] exact hxy · simp only [le_iInf_iff, le_principal_iff] intro n refine mem_iInf_of_mem ((1 / 2) ^ n : ℝ) ?_ refine mem_iInf_of_mem (by positivity) ?_ simp only [mem_principal, setOf_subset_setOf, Prod.forall] intro x y hxy exact apply_eq_of_dist_lt hxy le_rfl }
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
metricSpaceOfDiscreteUniformity
Metric space structure on `Π (n : ℕ), E n` when the spaces `E n` have the discrete uniformity, where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and `y` differ. Not registered as a global instance by default.
metricSpaceNatNat : MetricSpace (ℕ → ℕ) := PiNat.metricSpaceOfDiscreteUniformity fun _ => rfl attribute [local instance] PiNat.metricSpace
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
metricSpaceNatNat
Metric space structure on `ℕ → ℕ` where the distance is given by `dist x y = (1/2)^n`, where `n` is the smallest index where `x` and `y` differ. Not registered as a global instance by default.
protected completeSpace : CompleteSpace (∀ n, E n) := by refine Metric.complete_of_convergent_controlled_sequences (fun n => (1 / 2) ^ n) (by simp) ?_ intro u hu refine ⟨fun n => u n n, tendsto_pi_nhds.2 fun i => ?_⟩ refine tendsto_const_nhds.congr' ?_ filter_upwards [Filter.Ici_mem_atTop i] with n hn exact apply_eq_of_dist_lt (hu i i n le_rfl hn) le_rfl /-!
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
completeSpace
null
exists_disjoint_cylinder {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n} (hx : x ∉ s) : ∃ n, Disjoint s (cylinder x n) := by rcases eq_empty_or_nonempty s with (rfl | hne) · exact ⟨0, by simp⟩ have A : 0 < infDist x s := (hs.notMem_iff_infDist_pos hne).1 hx obtain ⟨n, hn⟩ : ∃ n, (1 / 2 : ℝ) ^ n < infDist x s := exists_pow_lt_of_lt_one A one_half_lt_one refine ⟨n, disjoint_left.2 fun y ys hy => ?_⟩ apply lt_irrefl (infDist x s) calc infDist x s ≤ dist x y := infDist_le_dist_of_mem ys _ ≤ (1 / 2) ^ n := by rw [mem_cylinder_comm] at hy exact mem_cylinder_iff_dist_le.1 hy _ < infDist x s := hn open Classical in
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
exists_disjoint_cylinder
null
shortestPrefixDiff {E : ℕ → Type*} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ := if h : ∃ n, Disjoint s (cylinder x n) then Nat.find h else 0
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
shortestPrefixDiff
Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then `shortestPrefixDiff x s` if the smallest `n` for which there is no element of `s` having the same prefix of length `n` as `x`. If there is no such `n`, then use `0` by convention.
firstDiff_lt_shortestPrefixDiff {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n} (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y < shortestPrefixDiff x s := by have A := exists_disjoint_cylinder hs hx rw [shortestPrefixDiff, dif_pos A] classical have B := Nat.find_spec A contrapose! B rw [not_disjoint_iff_nonempty_inter] refine ⟨y, hy, ?_⟩ rw [mem_cylinder_comm] exact cylinder_anti y B (mem_cylinder_firstDiff x y)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
firstDiff_lt_shortestPrefixDiff
null
shortestPrefixDiff_pos {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) {x : ∀ n, E n} (hx : x ∉ s) : 0 < shortestPrefixDiff x s := by rcases hne with ⟨y, hy⟩ exact (zero_le _).trans_lt (firstDiff_lt_shortestPrefixDiff hs hx hy)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
shortestPrefixDiff_pos
null
longestPrefix {E : ℕ → Type*} (x : ∀ n, E n) (s : Set (∀ n, E n)) : ℕ := shortestPrefixDiff x s - 1
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
longestPrefix
Given a point `x` in a product space `Π (n : ℕ), E n`, and `s` a subset of this space, then `longestPrefix x s` if the largest `n` for which there is an element of `s` having the same prefix of length `n` as `x`. If there is no such `n`, use `0` by convention.
firstDiff_le_longestPrefix {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n} (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y ≤ longestPrefix x s := by rw [longestPrefix, le_tsub_iff_right] · exact firstDiff_lt_shortestPrefixDiff hs hx hy · exact shortestPrefixDiff_pos hs ⟨y, hy⟩ hx
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
firstDiff_le_longestPrefix
null
inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty := by by_cases hx : x ∈ s · exact ⟨x, hx, self_mem_cylinder _ _⟩ have A := exists_disjoint_cylinder hs hx have B : longestPrefix x s < shortestPrefixDiff x s := Nat.pred_lt (shortestPrefixDiff_pos hs hne hx).ne' rw [longestPrefix, shortestPrefixDiff, dif_pos A] at B ⊢ classical obtain ⟨y, ys, hy⟩ : ∃ y : ∀ n : ℕ, E n, y ∈ s ∧ x ∈ cylinder y (Nat.find A - 1) := by simpa only [not_disjoint_iff, mem_cylinder_comm] using Nat.find_min A B refine ⟨y, ys, ?_⟩ rw [mem_cylinder_iff_eq] at hy ⊢ rw [hy]
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
inter_cylinder_longestPrefix_nonempty
null
disjoint_cylinder_of_longestPrefix_lt {s : Set (∀ n, E n)} (hs : IsClosed s) {x : ∀ n, E n} (hx : x ∉ s) {n : ℕ} (hn : longestPrefix x s < n) : Disjoint s (cylinder x n) := by contrapose! hn rcases not_disjoint_iff_nonempty_inter.1 hn with ⟨y, ys, hy⟩ apply le_trans _ (firstDiff_le_longestPrefix hs hx ys) apply (mem_cylinder_iff_le_firstDiff (ne_of_mem_of_not_mem ys hx).symm _).1 rwa [mem_cylinder_comm]
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
disjoint_cylinder_of_longestPrefix_lt
null
cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff {x y : ∀ n, E n} {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) (H : longestPrefix x s < firstDiff x y) (xs : x ∉ s) (ys : y ∉ s) : cylinder x (longestPrefix x s) = cylinder y (longestPrefix y s) := by have l_eq : longestPrefix y s = longestPrefix x s := by rcases lt_trichotomy (longestPrefix y s) (longestPrefix x s) with (L | L | L) · have Ax : (s ∩ cylinder x (longestPrefix x s)).Nonempty := inter_cylinder_longestPrefix_nonempty hs hne x have Z := disjoint_cylinder_of_longestPrefix_lt hs ys L rw [firstDiff_comm] at H rw [cylinder_eq_cylinder_of_le_firstDiff _ _ H.le] at Z exact (Ax.not_disjoint Z).elim · exact L · have Ay : (s ∩ cylinder y (longestPrefix y s)).Nonempty := inter_cylinder_longestPrefix_nonempty hs hne y have A'y : (s ∩ cylinder y (longestPrefix x s).succ).Nonempty := Ay.mono (inter_subset_inter_right s (cylinder_anti _ L)) have Z := disjoint_cylinder_of_longestPrefix_lt hs xs (Nat.lt_succ_self _) rw [cylinder_eq_cylinder_of_le_firstDiff _ _ H] at Z exact (A'y.not_disjoint Z).elim rw [l_eq, ← mem_cylinder_iff_eq] exact cylinder_anti y H.le (mem_cylinder_firstDiff x y)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff
If two points `x, y` coincide up to length `n`, and the longest common prefix of `x` with `s` is strictly shorter than `n`, then the longest common prefix of `y` with `s` is the same, and both cylinders of this length based at `x` and `y` coincide.
exists_lipschitz_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) : ∃ f : (∀ n, E n) → ∀ n, E n, (∀ x ∈ s, f x = x) ∧ range f = s ∧ LipschitzWith 1 f := by /- The map `f` is defined as follows. For `x ∈ s`, let `f x = x`. Otherwise, consider the longest prefix `w` that `x` shares with an element of `s`, and let `f x = z_w` where `z_w` is an element of `s` starting with `w`. All the desired properties are clear, except the fact that `f` is `1`-Lipschitz: if two points `x, y` belong to a common cylinder of length `n`, one should show that their images also belong to a common cylinder of length `n`. This is a case analysis: * if both `x, y ∈ s`, then this is clear. * if `x ∈ s` but `y ∉ s`, then the longest prefix `w` of `y` shared by an element of `s` is of length at least `n` (because of `x`), and then `f y` starts with `w` and therefore stays in the same length `n` cylinder. * if `x ∉ s`, `y ∉ s`, let `w` be the longest prefix of `x` shared by an element of `s`. If its length is `< n`, then it is also the longest prefix of `y`, and we get `f x = f y = z_w`. Otherwise, `f x` remains in the same `n`-cylinder as `x`. Similarly for `y`. Finally, `f x` and `f y` are again in the same `n`-cylinder, as desired. -/ classical set f := fun x => if x ∈ s then x else (inter_cylinder_longestPrefix_nonempty hs hne x).some have fs : ∀ x ∈ s, f x = x := fun x xs => by simp [f, xs] refine ⟨f, fs, ?_, ?_⟩ · apply Subset.antisymm · rintro x ⟨y, rfl⟩ by_cases hy : y ∈ s · rwa [fs y hy] simpa [f, if_neg hy] using (inter_cylinder_longestPrefix_nonempty hs hne y).choose_spec.1 · intro x hx rw [← fs x hx] exact mem_range_self _ · refine LipschitzWith.mk_one fun x y => ?_ rcases eq_or_ne x y with (rfl | hxy) · simp rcases eq_or_ne (f x) (f y) with (h' | hfxfy) · simp [h'] have I2 : cylinder x (firstDiff x y) = cylinder y (firstDiff x y) := by rw [← mem_cylinder_iff_eq] apply mem_cylinder_firstDiff suffices firstDiff x y ≤ firstDiff (f x) (f y) by simpa [dist_eq_of_ne hxy, dist_eq_of_ne hfxfy] by_cases xs : x ∈ s · rw [fs x xs] at hfxfy ⊢ by_cases ys : y ∈ s · rw [fs y ys] have A : (s ∩ cylinder y (longestPrefix y s)).Nonempty := inter_cylinder_longestPrefix_nonempty hs hne y have fy : f y = A.some := by simp_rw [f, if_neg ys] have I : cylinder A.some (firstDiff x y) = cylinder y (firstDiff x y) := by rw [← mem_cylinder_iff_eq, firstDiff_comm] apply cylinder_anti y _ A.some_mem.2 exact firstDiff_le_longestPrefix hs ys xs rwa [← fy, ← I2, ← mem_cylinder_iff_eq, mem_cylinder_iff_le_firstDiff hfxfy.symm, firstDiff_comm _ x] at I ...
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
exists_lipschitz_retraction_of_isClosed
Given a closed nonempty subset `s` of `Π (n : ℕ), E n`, there exists a Lipschitz retraction onto this set, i.e., a Lipschitz map with range equal to `s`, equal to the identity on `s`.
exists_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) : ∃ f : (∀ n, E n) → ∀ n, E n, (∀ x ∈ s, f x = x) ∧ range f = s ∧ Continuous f := by rcases exists_lipschitz_retraction_of_isClosed hs hne with ⟨f, fs, frange, hf⟩ exact ⟨f, fs, frange, hf.continuous⟩
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
exists_retraction_of_isClosed
Given a closed nonempty subset `s` of `Π (n : ℕ), E n`, there exists a retraction onto this set, i.e., a continuous map with range equal to `s`, equal to the identity on `s`.
exists_retraction_subtype_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) : ∃ f : (∀ n, E n) → s, (∀ x : s, f x = x) ∧ Surjective f ∧ Continuous f := by obtain ⟨f, fs, rfl, f_cont⟩ : ∃ f : (∀ n, E n) → ∀ n, E n, (∀ x ∈ s, f x = x) ∧ range f = s ∧ Continuous f := exists_retraction_of_isClosed hs hne have A : ∀ x : range f, rangeFactorization f x = x := fun x ↦ Subtype.eq <| fs x x.2 exact ⟨rangeFactorization f, A, fun x => ⟨x, A x⟩, f_cont.subtype_mk _⟩
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
exists_retraction_subtype_of_isClosed
null
exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [MetricSpace α] [CompleteSpace α] [SecondCountableTopology α] [Nonempty α] : ∃ f : (ℕ → ℕ) → α, Continuous f ∧ Surjective f := by /- First, we define a surjective map from a closed subset `s` of `ℕ → ℕ`. Then, we compose this map with a retraction of `ℕ → ℕ` onto `s` to obtain the desired map. Let us consider a dense sequence `u` in `α`. Then `s` is the set of sequences `xₙ` such that the balls `closedBall (u xₙ) (1/2^n)` have a nonempty intersection. This set is closed, and we define `f x` there to be the unique point in the intersection. This function is continuous and surjective by design. -/ letI : MetricSpace (ℕ → ℕ) := PiNat.metricSpaceNatNat have I0 : (0 : ℝ) < 1 / 2 := by simp have I1 : (1 / 2 : ℝ) < 1 := by norm_num rcases exists_dense_seq α with ⟨u, hu⟩ let s : Set (ℕ → ℕ) := { x | (⋂ n : ℕ, closedBall (u (x n)) ((1 / 2) ^ n)).Nonempty } let g : s → α := fun x => x.2.some have A : ∀ (x : s) (n : ℕ), dist (g x) (u ((x : ℕ → ℕ) n)) ≤ (1 / 2) ^ n := fun x n => (mem_iInter.1 x.2.some_mem n :) have g_cont : Continuous g := by refine continuous_iff_continuousAt.2 fun y => ?_ refine continuousAt_of_locally_lipschitz zero_lt_one 4 fun x hxy => ?_ rcases eq_or_ne x y with (rfl | hne) · simp have hne' : x.1 ≠ y.1 := Subtype.coe_injective.ne hne have dist' : dist x y = dist x.1 y.1 := rfl let n := firstDiff x.1 y.1 - 1 have diff_pos : 0 < firstDiff x.1 y.1 := by by_contra! h apply apply_firstDiff_ne hne' rw [Nat.le_zero.1 h] apply apply_eq_of_dist_lt _ le_rfl rw [pow_zero] exact hxy have hn : firstDiff x.1 y.1 = n + 1 := (Nat.succ_pred_eq_of_pos diff_pos).symm rw [dist', dist_eq_of_ne hne', hn] have B : x.1 n = y.1 n := mem_cylinder_firstDiff x.1 y.1 n (Nat.pred_lt diff_pos.ne') calc dist (g x) (g y) ≤ dist (g x) (u (x.1 n)) + dist (g y) (u (x.1 n)) := dist_triangle_right _ _ _ _ = dist (g x) (u (x.1 n)) + dist (g y) (u (y.1 n)) := by rw [← B] _ ≤ (1 / 2) ^ n + (1 / 2) ^ n := add_le_add (A x n) (A y n) _ = 4 * (1 / 2) ^ (n + 1) := by ring have g_surj : Surjective g := fun y ↦ by have : ∀ n : ℕ, ∃ j, y ∈ closedBall (u j) ((1 / 2) ^ n) := fun n ↦ by rcases hu.exists_dist_lt y (by simp : (0 : ℝ) < (1 / 2) ^ n) with ⟨j, hj⟩ exact ⟨j, hj.le⟩ choose x hx using this have I : (⋂ n : ℕ, closedBall (u (x n)) ((1 / 2) ^ n)).Nonempty := ⟨y, mem_iInter.2 hx⟩ refine ⟨⟨x, I⟩, ?_⟩ refine dist_le_zero.1 ?_ have J : ∀ n : ℕ, dist (g ⟨x, I⟩) y ≤ (1 / 2) ^ n + (1 / 2) ^ n := fun n => calc ...
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
exists_nat_nat_continuous_surjective_of_completeSpace
Any nonempty complete second countable metric space is the continuous image of the fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see `exists_nat_nat_continuous_surjective_of_polishSpace`.
protected dist : Dist (∀ i, F i) := ⟨fun x y => ∑' i : ι, min ((1 / 2) ^ encode i) (dist (x i) (y i))⟩ attribute [local instance] PiCountable.dist
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
dist
Given a countable family of metric spaces, one may put a distance on their product `Π i, E i`. It is highly non-canonical, though, and therefore not registered as a global instance. The distance we use here is `dist x y = ∑' i, min (1/2)^(encode i) (dist (x i) (y i))`.
dist_eq_tsum (x y : ∀ i, F i) : dist x y = ∑' i : ι, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) := rfl
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
dist_eq_tsum
null
dist_summable (x y : ∀ i, F i) : Summable fun i : ι => min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) := by refine .of_nonneg_of_le (fun i => ?_) (fun i => min_le_left _ _) summable_geometric_two_encode exact le_min (pow_nonneg (by simp) _) dist_nonneg
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
dist_summable
null
min_dist_le_dist_pi (x y : ∀ i, F i) (i : ι) : min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) ≤ dist x y := (dist_summable x y).le_tsum i fun j _ => le_min (by simp) dist_nonneg
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
min_dist_le_dist_pi
null
dist_le_dist_pi_of_dist_lt {x y : ∀ i, F i} {i : ι} (h : dist x y < (1 / 2) ^ encode i) : dist (x i) (y i) ≤ dist x y := by simpa only [not_le.2 h, false_or] using min_le_iff.1 (min_dist_le_dist_pi x y i) open Topology Filter NNReal variable (E)
theorem
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
dist_le_dist_pi_of_dist_lt
null
protected metricSpace : MetricSpace (∀ i, F i) where dist_self x := by simp [dist_eq_tsum] dist_comm x y := by simp [dist_eq_tsum, dist_comm] dist_triangle x y z := have I : ∀ i, min ((1 / 2) ^ encode i : ℝ) (dist (x i) (z i)) ≤ min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) + min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i)) := fun i => calc min ((1 / 2) ^ encode i : ℝ) (dist (x i) (z i)) ≤ min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i) + dist (y i) (z i)) := min_le_min le_rfl (dist_triangle _ _ _) _ = min ((1 / 2) ^ encode i : ℝ) (min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) + min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i))) := by convert congr_arg ((↑) : ℝ≥0 → ℝ) (min_add_distrib ((1 / 2 : ℝ≥0) ^ encode i) (nndist (x i) (y i)) (nndist (y i) (z i))) _ ≤ min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) + min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i)) := min_le_right _ _ calc dist x z ≤ ∑' i, (min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i)) + min ((1 / 2) ^ encode i : ℝ) (dist (y i) (z i))) := (dist_summable x z).tsum_le_tsum I ((dist_summable x y).add (dist_summable y z)) _ = dist x y + dist y z := (dist_summable x y).tsum_add (dist_summable y z) eq_of_dist_eq_zero hxy := by ext1 n rw [← dist_le_zero, ← hxy] apply dist_le_dist_pi_of_dist_lt rw [hxy] simp toUniformSpace := Pi.uniformSpace _ uniformity_dist := by simp only [Pi.uniformity, comap_iInf, gt_iff_lt, preimage_setOf_eq, comap_principal, PseudoMetricSpace.uniformity_dist] apply le_antisymm · simp only [le_iInf_iff, le_principal_iff] intro ε εpos classical obtain ⟨K, hK⟩ : ∃ K : Finset ι, (∑' i : { j // j ∉ K }, (1 / 2 : ℝ) ^ encode (i : ι)) < ε / 2 := ((tendsto_order.1 (tendsto_tsum_compl_atTop_zero fun i : ι => (1 / 2 : ℝ) ^ encode i)).2 _ (half_pos εpos)).exists obtain ⟨δ, δpos, hδ⟩ : ∃ δ : ℝ, 0 < δ ∧ (K.card : ℝ) * δ < ε / 2 := exists_pos_mul_lt (half_pos εpos) _ apply @mem_iInf_of_iInter _ _ _ _ _ K.finite_toSet fun i => { p : (∀ i : ι, F i) × ∀ i : ι, F i | dist (p.fst i) (p.snd i) < δ } · rintro ⟨i, hi⟩ refine mem_iInf_of_mem δ (mem_iInf_of_mem δpos ?_) simp only [mem_principal, Subset.rfl] · rintro ⟨x, y⟩ hxy simp only [mem_iInter, mem_setOf_eq, SetCoe.forall, Finset.mem_coe] at hxy calc ...
def
Topology
[ "Mathlib.Topology.Algebra.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.HausdorffDistance" ]
Mathlib/Topology/MetricSpace/PiNat.lean
metricSpace
Given a countable family of metric spaces, one may put a distance on their product `Π i, E i`, defining the right topology and uniform structure. It is highly non-canonical, though, and therefore not registered as a global instance. The distance we use here is `dist x y = ∑' n, min (1/2)^(encode i) (dist (x n) (y n))`.
PolishSpace (α : Type*) [h : TopologicalSpace α] : Prop extends SecondCountableTopology α, IsCompletelyMetrizableSpace α
class
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
PolishSpace
A Polish space is a topological space with second countable topology, that can be endowed with a metric for which it is complete. To endow a Polish space with a complete metric space structure, do `letI := upgradeIsCompletelyMetrizable α`.
exists_nat_nat_continuous_surjective (α : Type*) [TopologicalSpace α] [PolishSpace α] [Nonempty α] : ∃ f : (ℕ → ℕ) → α, Continuous f ∧ Surjective f := letI := upgradeIsCompletelyMetrizable α exists_nat_nat_continuous_surjective_of_completeSpace α
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
exists_nat_nat_continuous_surjective
Any nonempty Polish space is the continuous image of the fundamental space `ℕ → ℕ`.
_root_.Topology.IsClosedEmbedding.polishSpace [TopologicalSpace α] [TopologicalSpace β] [PolishSpace β] {f : α → β} (hf : IsClosedEmbedding f) : PolishSpace α := by letI := upgradeIsCompletelyMetrizable β letI : MetricSpace α := hf.isEmbedding.comapMetricSpace f haveI : SecondCountableTopology α := hf.isEmbedding.secondCountableTopology have : CompleteSpace α := by rw [completeSpace_iff_isComplete_range hf.isEmbedding.to_isometry.isUniformInducing] exact hf.isClosed_range.isComplete infer_instance
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.Topology.IsClosedEmbedding.polishSpace
Given a closed embedding into a Polish space, the source space is also Polish.
_root_.Equiv.polishSpace_induced [t : TopologicalSpace β] [PolishSpace β] (f : α ≃ β) : @PolishSpace α (t.induced f) := letI : TopologicalSpace α := t.induced f (f.toHomeomorphOfIsInducing ⟨rfl⟩).isClosedEmbedding.polishSpace
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.Equiv.polishSpace_induced
Pulling back a Polish topology under an equiv gives again a Polish topology.
_root_.IsClosed.polishSpace [TopologicalSpace α] [PolishSpace α] {s : Set α} (hs : IsClosed s) : PolishSpace s := hs.isClosedEmbedding_subtypeVal.polishSpace
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.IsClosed.polishSpace
A closed subset of a Polish space is also Polish.
protected _root_.CompletePseudometrizable.iInf {ι : Type*} [Countable ι] {t : ι → TopologicalSpace α} (ht₀ : ∃ t₀, @T2Space α t₀ ∧ ∀ i, t i ≤ t₀) (ht : ∀ i, ∃ u : UniformSpace α, CompleteSpace α ∧ 𝓤[u].IsCountablyGenerated ∧ u.toTopologicalSpace = t i) : ∃ u : UniformSpace α, CompleteSpace α ∧ 𝓤[u].IsCountablyGenerated ∧ u.toTopologicalSpace = ⨅ i, t i := by choose u hcomp hcount hut using ht obtain rfl : t = fun i ↦ (u i).toTopologicalSpace := (funext hut).symm refine ⟨⨅ i, u i, .iInf hcomp ht₀, ?_, UniformSpace.toTopologicalSpace_iInf⟩ rw [iInf_uniformity] infer_instance
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.CompletePseudometrizable.iInf
null
protected iInf {ι : Type*} [Countable ι] {t : ι → TopologicalSpace α} (ht₀ : ∃ i₀, ∀ i, t i ≤ t i₀) (ht : ∀ i, @PolishSpace α (t i)) : @PolishSpace α (⨅ i, t i) := by rcases ht₀ with ⟨i₀, hi₀⟩ rcases CompletePseudometrizable.iInf ⟨t i₀, letI := t i₀; haveI := ht i₀; inferInstance, hi₀⟩ fun i ↦ letI := t i; haveI := ht i; letI := upgradeIsCompletelyMetrizable α ⟨inferInstance, inferInstance, inferInstance, rfl⟩ with ⟨u, hcomp, hcount, htop⟩ rw [← htop] have : @SecondCountableTopology α u.toTopologicalSpace := htop.symm ▸ secondCountableTopology_iInf fun i ↦ letI := t i; (ht i).toSecondCountableTopology have : @T1Space α u.toTopologicalSpace := htop.symm ▸ t1Space_antitone (iInf_le _ i₀) (by letI := t i₀; haveI := ht i₀; infer_instance) infer_instance
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
iInf
null
exists_polishSpace_forall_le {ι : Type*} [Countable ι] [t : TopologicalSpace α] [p : PolishSpace α] (m : ι → TopologicalSpace α) (hm : ∀ n, m n ≤ t) (h'm : ∀ n, @PolishSpace α (m n)) : ∃ t' : TopologicalSpace α, (∀ n, t' ≤ m n) ∧ t' ≤ t ∧ @PolishSpace α t' := ⟨⨅ i : Option ι, i.elim t m, fun i ↦ iInf_le _ (some i), iInf_le _ none, .iInf ⟨none, Option.forall.2 ⟨le_rfl, hm⟩⟩ <| Option.forall.2 ⟨p, h'm⟩⟩
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
exists_polishSpace_forall_le
Given a Polish space, and countably many finer Polish topologies, there exists another Polish topology which is finer than all of them.
CompleteCopy {α : Type*} [MetricSpace α] (s : Opens α) : Type _ := s
def
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
CompleteCopy
A type synonym for a subset `s` of a metric space, on which we will construct another metric for which it will be complete.
instDist : Dist (CompleteCopy s) where dist x y := dist x.1 y.1 + abs (1 / infDist x.1 sᶜ - 1 / infDist y.1 sᶜ)
instance
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
instDist
A distance on an open subset `s` of a metric space, designed to make it complete. It is given by `dist' x y = dist x y + |1 / dist x sᶜ - 1 / dist y sᶜ|`, where the second term blows up close to the boundary to ensure that Cauchy sequences for `dist'` remain well inside `s`.
dist_eq (x y : CompleteCopy s) : dist x y = dist x.1 y.1 + abs (1 / infDist x.1 sᶜ - 1 / infDist y.1 sᶜ) := rfl
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
dist_eq
null
dist_val_le_dist (x y : CompleteCopy s) : dist x.1 y.1 ≤ dist x y := le_add_of_nonneg_right (abs_nonneg _)
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
dist_val_le_dist
null
instMetricSpace : MetricSpace (CompleteCopy s) := by refine @MetricSpace.ofT0PseudoMetricSpace (CompleteCopy s) (.ofDistTopology dist (fun _ ↦ ?_) (fun _ _ ↦ ?_) (fun x y z ↦ ?_) fun t ↦ ?_) _ · simp only [dist_eq, dist_self, one_div, sub_self, abs_zero, add_zero] · simp only [dist_eq, dist_comm, abs_sub_comm] · calc dist x z = dist x.1 z.1 + |1 / infDist x.1 sᶜ - 1 / infDist z.1 sᶜ| := rfl _ ≤ dist x.1 y.1 + dist y.1 z.1 + (|1 / infDist x.1 sᶜ - 1 / infDist y.1 sᶜ| + |1 / infDist y.1 sᶜ - 1 / infDist z.1 sᶜ|) := add_le_add (dist_triangle _ _ _) (dist_triangle (1 / infDist _ _) _ _) _ = dist x y + dist y z := add_add_add_comm .. · refine ⟨fun h x hx ↦ ?_, fun h ↦ isOpen_iff_mem_nhds.2 fun x hx ↦ ?_⟩ · rcases (Metric.isOpen_iff (α := s)).1 h x hx with ⟨ε, ε0, hε⟩ exact ⟨ε, ε0, fun y hy ↦ hε <| (dist_comm _ _).trans_lt <| (dist_val_le_dist _ _).trans_lt hy⟩ · rcases h x hx with ⟨ε, ε0, hε⟩ simp only [dist_eq, one_div] at hε have : Tendsto (fun y : s ↦ dist x.1 y.1 + |(infDist x.1 sᶜ)⁻¹ - (infDist y.1 sᶜ)⁻¹|) (𝓝 x) (𝓝 (dist x.1 x.1 + |(infDist x.1 sᶜ)⁻¹ - (infDist x.1 sᶜ)⁻¹|)) := by refine (tendsto_const_nhds.dist continuous_subtype_val.continuousAt).add (tendsto_const_nhds.sub <| ?_).abs refine (continuousAt_inv_infDist_pt ?_).comp continuous_subtype_val.continuousAt rw [s.isOpen.isClosed_compl.closure_eq, mem_compl_iff, not_not] exact x.2 simp only [dist_self, sub_self, abs_zero, zero_add] at this exact mem_of_superset (this <| gt_mem_nhds ε0) hε
instance
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
instMetricSpace
A metric space structure on a subset `s` of a metric space, designed to make it complete if `s` is open. It is given by `dist' x y = dist x y + |1 / dist x sᶜ - 1 / dist y sᶜ|`, where the second term blows up close to the boundary to ensure that Cauchy sequences for `dist'` remain well inside `s`. This definition ensures the `TopologicalSpace` structure on `TopologicalSpace.Opens.CompleteCopy s` is definitionally equal to the original one.
instCompleteSpace [CompleteSpace α] : CompleteSpace (CompleteCopy s) := by refine Metric.complete_of_convergent_controlled_sequences ((1 / 2) ^ ·) (by simp) fun u hu ↦ ?_ have A : CauchySeq fun n => (u n).1 := by refine cauchySeq_of_le_tendsto_0 (fun n : ℕ => (1 / 2) ^ n) (fun n m N hNn hNm => ?_) ?_ · exact (dist_val_le_dist (u n) (u m)).trans (hu N n m hNn hNm).le · exact tendsto_pow_atTop_nhds_zero_of_lt_one (by simp) (by norm_num) obtain ⟨x, xlim⟩ : ∃ x, Tendsto (fun n => (u n).1) atTop (𝓝 x) := cauchySeq_tendsto_of_complete A by_cases xs : x ∈ s · exact ⟨⟨x, xs⟩, tendsto_subtype_rng.2 xlim⟩ obtain ⟨C, hC⟩ : ∃ C, ∀ n, 1 / infDist (u n).1 sᶜ < C := by refine ⟨(1 / 2) ^ 0 + 1 / infDist (u 0).1 sᶜ, fun n ↦ ?_⟩ rw [← sub_lt_iff_lt_add] calc _ ≤ |1 / infDist (u n).1 sᶜ - 1 / infDist (u 0).1 sᶜ| := le_abs_self _ _ = |1 / infDist (u 0).1 sᶜ - 1 / infDist (u n).1 sᶜ| := abs_sub_comm _ _ _ ≤ dist (u 0) (u n) := le_add_of_nonneg_left dist_nonneg _ < (1 / 2) ^ 0 := hu 0 0 n le_rfl n.zero_le have Cpos : 0 < C := lt_of_le_of_lt (div_nonneg zero_le_one infDist_nonneg) (hC 0) have Hmem : ∀ {y}, y ∈ s ↔ 0 < infDist y sᶜ := fun {y} ↦ by rw [← s.isOpen.isClosed_compl.notMem_iff_infDist_pos ⟨x, xs⟩]; exact not_not.symm have I : ∀ n, 1 / C ≤ infDist (u n).1 sᶜ := fun n ↦ by have : 0 < infDist (u n).1 sᶜ := Hmem.1 (u n).2 rw [div_le_iff₀' Cpos] exact (div_le_iff₀ this).1 (hC n).le have I' : 1 / C ≤ infDist x sᶜ := have : Tendsto (fun n => infDist (u n).1 sᶜ) atTop (𝓝 (infDist x sᶜ)) := ((continuous_infDist_pt (sᶜ : Set α)).tendsto x).comp xlim ge_of_tendsto' this I exact absurd (Hmem.2 <| lt_of_lt_of_le (div_pos one_pos Cpos) I') xs
instance
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
instCompleteSpace
null
_root_.IsOpen.polishSpace {α : Type*} [TopologicalSpace α] [PolishSpace α] {s : Set α} (hs : IsOpen s) : PolishSpace s := by letI := upgradeIsCompletelyMetrizable α lift s to Opens α using hs exact inferInstanceAs (PolishSpace s.CompleteCopy)
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.IsOpen.polishSpace
An open subset of a Polish space is also Polish.
IsClopenable [t : TopologicalSpace α] (s : Set α) : Prop := ∃ t' : TopologicalSpace α, t' ≤ t ∧ @PolishSpace α t' ∧ IsClosed[t'] s ∧ IsOpen[t'] s
def
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
IsClopenable
A set in a topological space is clopenable if there exists a finer Polish topology for which this set is open and closed. It turns out that this notion is equivalent to being Borel-measurable, but this is nontrivial (see `isClopenable_iff_measurableSet`).
_root_.IsClosed.isClopenable [TopologicalSpace α] [PolishSpace α] {s : Set α} (hs : IsClosed s) : IsClopenable s := by /- Both sets `s` and `sᶜ` admit a Polish topology. So does their disjoint union `s ⊕ sᶜ`. Pulling back this topology by the canonical bijection with `α` gives the desired Polish topology in which `s` is both open and closed. -/ classical haveI : PolishSpace s := hs.polishSpace let t : Set α := sᶜ haveI : PolishSpace t := hs.isOpen_compl.polishSpace let f : s ⊕ t ≃ α := Equiv.Set.sumCompl s have hle : TopologicalSpace.coinduced f instTopologicalSpaceSum ≤ ‹_› := by simp only [instTopologicalSpaceSum, coinduced_sup, coinduced_compose, sup_le_iff, ← continuous_iff_coinduced_le] exact ⟨continuous_subtype_val, continuous_subtype_val⟩ refine ⟨.coinduced f instTopologicalSpaceSum, hle, ?_, hs.mono hle, ?_⟩ · rw [← f.induced_symm] exact f.symm.polishSpace_induced · rw [isOpen_coinduced, isOpen_sum_iff] simp only [preimage_preimage, f] have inl (x : s) : (Equiv.Set.sumCompl s) (Sum.inl x) = x := Equiv.Set.sumCompl_apply_inl .. have inr (x : ↑sᶜ) : (Equiv.Set.sumCompl s) (Sum.inr x) = x := Equiv.Set.sumCompl_apply_inr .. simp_rw [t, inl, inr, Subtype.coe_preimage_self] simp only [isOpen_univ, true_and] rw [Subtype.preimage_coe_compl'] simp
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.IsClosed.isClopenable
Given a closed set `s` in a Polish space, one can construct a finer Polish topology for which `s` is both open and closed.
IsClopenable.compl [TopologicalSpace α] {s : Set α} (hs : IsClopenable s) : IsClopenable sᶜ := by rcases hs with ⟨t, t_le, t_polish, h, h'⟩ exact ⟨t, t_le, t_polish, @IsOpen.isClosed_compl α t s h', @IsClosed.isOpen_compl α t s h⟩
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
IsClopenable.compl
null
_root_.IsOpen.isClopenable [TopologicalSpace α] [PolishSpace α] {s : Set α} (hs : IsOpen s) : IsClopenable s := by simpa using hs.isClosed_compl.isClopenable.compl
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
_root_.IsOpen.isClopenable
null
IsClopenable.iUnion [t : TopologicalSpace α] [PolishSpace α] {s : ℕ → Set α} (hs : ∀ n, IsClopenable (s n)) : IsClopenable (⋃ n, s n) := by choose m mt m_polish _ m_open using hs obtain ⟨t', t'm, -, t'_polish⟩ : ∃ t' : TopologicalSpace α, (∀ n : ℕ, t' ≤ m n) ∧ t' ≤ t ∧ @PolishSpace α t' := exists_polishSpace_forall_le m mt m_polish have A : IsOpen[t'] (⋃ n, s n) := by apply isOpen_iUnion intro n apply t'm n exact m_open n obtain ⟨t'', t''_le, t''_polish, h1, h2⟩ : ∃ t'' : TopologicalSpace α, t'' ≤ t' ∧ @PolishSpace α t'' ∧ IsClosed[t''] (⋃ n, s n) ∧ IsOpen[t''] (⋃ n, s n) := @IsOpen.isClopenable α t' t'_polish _ A exact ⟨t'', t''_le.trans ((t'm 0).trans (mt 0)), t''_polish, h1, h2⟩
theorem
Topology
[ "Mathlib.Topology.MetricSpace.PiNat", "Mathlib.Topology.Metrizable.CompletelyMetrizable", "Mathlib.Topology.Sets.Opens" ]
Mathlib/Topology/MetricSpace/Polish.lean
IsClopenable.iUnion
null
ProperSpace (α : Type u) [PseudoMetricSpace α] : Prop where isCompact_closedBall : ∀ x : α, ∀ r, IsCompact (closedBall x r) export ProperSpace (isCompact_closedBall)
class
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
ProperSpace
A pseudometric space is proper if all closed balls are compact.
isCompact_sphere {α : Type*} [PseudoMetricSpace α] [ProperSpace α] (x : α) (r : ℝ) : IsCompact (sphere x r) := (isCompact_closedBall x r).of_isClosed_subset isClosed_sphere sphere_subset_closedBall
theorem
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
isCompact_sphere
In a proper pseudometric space, all spheres are compact.
Metric.sphere.compactSpace {α : Type*} [PseudoMetricSpace α] [ProperSpace α] (x : α) (r : ℝ) : CompactSpace (sphere x r) := isCompact_iff_compactSpace.mp (isCompact_sphere _ _) variable [PseudoMetricSpace α]
instance
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
Metric.sphere.compactSpace
In a proper pseudometric space, any sphere is a `CompactSpace` when considered as a subtype.
ProperSpace.of_isCompact_closedBall_of_le (R : ℝ) (h : ∀ x : α, ∀ r, R ≤ r → IsCompact (closedBall x r)) : ProperSpace α := ⟨fun x r => IsCompact.of_isClosed_subset (h x (max r R) (le_max_right _ _)) isClosed_closedBall (closedBall_subset_closedBall <| le_max_left _ _)⟩
theorem
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
ProperSpace.of_isCompact_closedBall_of_le
A proper pseudo metric space is sigma compact, and therefore second countable. -/ instance (priority := 100) secondCountable_of_proper [ProperSpace α] : SecondCountableTopology α := by -- We already have `sigmaCompactSpace_of_locallyCompact_secondCountable`, so we don't -- add an instance for `SigmaCompactSpace`. suffices SigmaCompactSpace α from EMetric.secondCountable_of_sigmaCompact α rcases em (Nonempty α) with (⟨⟨x⟩⟩ | hn) · exact ⟨⟨fun n => closedBall x n, fun n => isCompact_closedBall _ _, iUnion_closedBall_nat _⟩⟩ · exact ⟨⟨fun _ => ∅, fun _ => isCompact_empty, iUnion_eq_univ_iff.2 fun x => (hn ⟨x⟩).elim⟩⟩ /-- If all closed balls of large enough radius are compact, then the space is proper. Especially useful when the lower bound for the radius is 0.
ProperSpace.of_seq_closedBall {β : Type*} {l : Filter β} [NeBot l] {x : α} {r : β → ℝ} (hr : Tendsto r l atTop) (hc : ∀ᶠ i in l, IsCompact (closedBall x (r i))) : ProperSpace α where isCompact_closedBall a r := let ⟨_i, hci, hir⟩ := (hc.and <| hr.eventually_ge_atTop <| r + dist a x).exists hci.of_isClosed_subset isClosed_closedBall <| closedBall_subset_closedBall' hir
theorem
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
ProperSpace.of_seq_closedBall
If there exists a sequence of compact closed balls with the same center such that the radii tend to infinity, then the space is proper.
prod_properSpace {α : Type*} {β : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β] [ProperSpace α] [ProperSpace β] : ProperSpace (α × β) where isCompact_closedBall := by rintro ⟨x, y⟩ r rw [← closedBall_prod_same x y] exact (isCompact_closedBall x r).prod (isCompact_closedBall y r)
instance
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
prod_properSpace
A proper space is locally compact -/ instance (priority := 100) locallyCompact_of_proper [ProperSpace α] : LocallyCompactSpace α := .of_hasBasis (fun _ => nhds_basis_closedBall) fun _ _ _ => isCompact_closedBall _ _ -- see Note [lower instance priority] /-- A proper space is complete -/ instance (priority := 100) complete_of_proper [ProperSpace α] : CompleteSpace α := ⟨fun {f} hf => by /- We want to show that the Cauchy filter `f` is converging. It suffices to find a closed ball (therefore compact by properness) where it is nontrivial. -/ obtain ⟨t, t_fset, ht⟩ : ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, dist x y < 1 := (Metric.cauchy_iff.1 hf).2 1 zero_lt_one rcases hf.1.nonempty_of_mem t_fset with ⟨x, xt⟩ have : closedBall x 1 ∈ f := mem_of_superset t_fset fun y yt => (ht y yt x xt).le rcases (isCompact_iff_totallyBounded_isComplete.1 (isCompact_closedBall x 1)).2 f hf (le_principal_iff.2 this) with ⟨y, -, hy⟩ exact ⟨y, hy⟩⟩ /-- A binary product of proper spaces is proper.
pi_properSpace {X : β → Type*} [Fintype β] [∀ b, PseudoMetricSpace (X b)] [h : ∀ b, ProperSpace (X b)] : ProperSpace (∀ b, X b) := by refine .of_isCompact_closedBall_of_le 0 fun x r hr => ?_ rw [closedBall_pi _ hr] exact isCompact_univ_pi fun _ => isCompact_closedBall _ _
instance
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
pi_properSpace
A finite product of proper spaces is proper.
ProperSpace.of_isClosed {X : Type*} [PseudoMetricSpace X] [ProperSpace X] {s : Set X} (hs : IsClosed s) : ProperSpace s := ⟨fun x r ↦ Topology.IsEmbedding.subtypeVal.isCompact_iff.mpr ((isCompact_closedBall x.1 r).of_isClosed_subset (hs.isClosedMap_subtype_val _ isClosed_closedBall) (Set.image_subset_iff.mpr subset_rfl))⟩
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Pseudo.Basic", "Mathlib.Topology.MetricSpace.Pseudo.Lemmas", "Mathlib.Topology.MetricSpace.Pseudo.Pi", "Mathlib.Topology.Order.IsLUB" ]
Mathlib/Topology/MetricSpace/ProperSpace.lean
ProperSpace.of_isClosed
A closed subspace of a proper space is proper. This is true for any proper lipschitz map. See `LipschitzWith.properSpace`.
tendsto_subseq_of_frequently_bounded (hs : IsBounded s) {x : ℕ → X} (hx : ∃ᶠ n in atTop, x n ∈ s) : ∃ a ∈ closure s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a) := have hcs : IsSeqCompact (closure s) := hs.isCompact_closure.isSeqCompact have hu' : ∃ᶠ n in atTop, x n ∈ closure s := hx.mono fun _n hn => subset_closure hn hcs.subseq_of_frequently_in hu'
theorem
Topology
[ "Mathlib.Topology.Sequences", "Mathlib.Topology.MetricSpace.Bounded" ]
Mathlib/Topology/MetricSpace/Sequences.lean
tendsto_subseq_of_frequently_bounded
A version of **Bolzano-Weierstrass**: in a proper metric space (e.g. $ℝ^n$), every bounded sequence has a converging subsequence. This version assumes only that the sequence is frequently in some bounded set.
tendsto_subseq_of_bounded (hs : IsBounded s) {x : ℕ → X} (hx : ∀ n, x n ∈ s) : ∃ a ∈ closure s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a) := tendsto_subseq_of_frequently_bounded hs <| Frequently.of_forall hx
theorem
Topology
[ "Mathlib.Topology.Sequences", "Mathlib.Topology.MetricSpace.Bounded" ]
Mathlib/Topology/MetricSpace/Sequences.lean
tendsto_subseq_of_bounded
A version of **Bolzano-Weierstrass**: in a proper metric space (e.g. $ℝ^n$), every bounded sequence has a converging subsequence.
exists_subset_iUnion_ball_radius_lt {r : ι → ℝ} (hs : IsClosed s) (uf : ∀ x ∈ s, { i | x ∈ ball (c i) (r i) }.Finite) (us : s ⊆ ⋃ i, ball (c i) (r i)) : ∃ r' : ι → ℝ, (s ⊆ ⋃ i, ball (c i) (r' i)) ∧ ∀ i, r' i < r i := by rcases exists_subset_iUnion_closed_subset hs (fun i => @isOpen_ball _ _ (c i) (r i)) uf us with ⟨v, hsv, hvc, hcv⟩ have := fun i => exists_lt_subset_ball (hvc i) (hcv i) choose r' hlt hsub using this exact ⟨r', hsv.trans <| iUnion_mono <| hsub, hlt⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_subset_iUnion_ball_radius_lt
**Shrinking lemma** for coverings by open balls in a proper metric space. A point-finite open cover of a closed subset of a proper metric space by open balls can be shrunk to a new cover by open balls so that each of the new balls has strictly smaller radius than the old one. This version assumes that `fun x ↦ ball (c i) (r i)` is a locally finite covering and provides a covering indexed by the same type.
exists_iUnion_ball_eq_radius_lt {r : ι → ℝ} (uf : ∀ x, { i | x ∈ ball (c i) (r i) }.Finite) (uU : ⋃ i, ball (c i) (r i) = univ) : ∃ r' : ι → ℝ, ⋃ i, ball (c i) (r' i) = univ ∧ ∀ i, r' i < r i := let ⟨r', hU, hv⟩ := exists_subset_iUnion_ball_radius_lt isClosed_univ (fun x _ => uf x) uU.ge ⟨r', univ_subset_iff.1 hU, hv⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_iUnion_ball_eq_radius_lt
Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover of a proper metric space by open balls can be shrunk to a new cover by open balls so that each of the new balls has strictly smaller radius than the old one.
exists_subset_iUnion_ball_radius_pos_lt {r : ι → ℝ} (hr : ∀ i, 0 < r i) (hs : IsClosed s) (uf : ∀ x ∈ s, { i | x ∈ ball (c i) (r i) }.Finite) (us : s ⊆ ⋃ i, ball (c i) (r i)) : ∃ r' : ι → ℝ, (s ⊆ ⋃ i, ball (c i) (r' i)) ∧ ∀ i, r' i ∈ Ioo 0 (r i) := by rcases exists_subset_iUnion_closed_subset hs (fun i => @isOpen_ball _ _ (c i) (r i)) uf us with ⟨v, hsv, hvc, hcv⟩ have := fun i => exists_pos_lt_subset_ball (hr i) (hvc i) (hcv i) choose r' hlt hsub using this exact ⟨r', hsv.trans <| iUnion_mono hsub, hlt⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_subset_iUnion_ball_radius_pos_lt
Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover of a closed subset of a proper metric space by nonempty open balls can be shrunk to a new cover by nonempty open balls so that each of the new balls has strictly smaller radius than the old one.
exists_iUnion_ball_eq_radius_pos_lt {r : ι → ℝ} (hr : ∀ i, 0 < r i) (uf : ∀ x, { i | x ∈ ball (c i) (r i) }.Finite) (uU : ⋃ i, ball (c i) (r i) = univ) : ∃ r' : ι → ℝ, ⋃ i, ball (c i) (r' i) = univ ∧ ∀ i, r' i ∈ Ioo 0 (r i) := let ⟨r', hU, hv⟩ := exists_subset_iUnion_ball_radius_pos_lt hr isClosed_univ (fun x _ => uf x) uU.ge ⟨r', univ_subset_iff.1 hU, hv⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_iUnion_ball_eq_radius_pos_lt
Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover of a proper metric space by nonempty open balls can be shrunk to a new cover by nonempty open balls so that each of the new balls has strictly smaller radius than the old one.
exists_locallyFinite_subset_iUnion_ball_radius_lt (hs : IsClosed s) {R : α → ℝ} (hR : ∀ x ∈ s, 0 < R x) : ∃ (ι : Type u) (c : ι → α) (r r' : ι → ℝ), (∀ i, c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧ (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ i, ball (c i) (r i) := by have : ∀ x ∈ s, (𝓝 x).HasBasis (fun r : ℝ => 0 < r ∧ r < R x) fun r => ball x r := fun x hx => nhds_basis_uniformity (uniformity_basis_dist_lt (hR x hx)) rcases refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set hs this with ⟨ι, c, r', hr', hsub', hfin⟩ rcases exists_subset_iUnion_ball_radius_pos_lt (fun i => (hr' i).2.1) hs (fun x _ => hfin.point_finite x) hsub' with ⟨r, hsub, hlt⟩ exact ⟨ι, c, r, r', fun i => ⟨(hr' i).1, (hlt i).1, (hlt i).2, (hr' i).2.2⟩, hfin, hsub⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_locallyFinite_subset_iUnion_ball_radius_lt
Let `R : α → ℝ` be a (possibly discontinuous) function on a proper metric space. Let `s` be a closed set in `α` such that `R` is positive on `s`. Then there exists a collection of pairs of balls `Metric.ball (c i) (r i)`, `Metric.ball (c i) (r' i)` such that * all centers belong to `s`; * for all `i` we have `0 < r i < r' i < R (c i)`; * the family of balls `Metric.ball (c i) (r' i)` is locally finite; * the balls `Metric.ball (c i) (r i)` cover `s`. This is a simple corollary of `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set` and `exists_subset_iUnion_ball_radius_pos_lt`.
exists_locallyFinite_iUnion_eq_ball_radius_lt {R : α → ℝ} (hR : ∀ x, 0 < R x) : ∃ (ι : Type u) (c : ι → α) (r r' : ι → ℝ), (∀ i, 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧ (LocallyFinite fun i => ball (c i) (r' i)) ∧ ⋃ i, ball (c i) (r i) = univ := let ⟨ι, c, r, r', hlt, hfin, hsub⟩ := exists_locallyFinite_subset_iUnion_ball_radius_lt isClosed_univ fun x _ => hR x ⟨ι, c, r, r', fun i => (hlt i).2, hfin, univ_subset_iff.1 hsub⟩
theorem
Topology
[ "Mathlib.Topology.EMetricSpace.Paracompact", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.MetricSpace.ProperSpace.Lemmas", "Mathlib.Topology.ShrinkingLemma" ]
Mathlib/Topology/MetricSpace/ShrinkingLemma.lean
exists_locallyFinite_iUnion_eq_ball_radius_lt
Let `R : α → ℝ` be a (possibly discontinuous) positive function on a proper metric space. Then there exists a collection of pairs of balls `Metric.ball (c i) (r i)`, `Metric.ball (c i) (r' i)` such that * for all `i` we have `0 < r i < r' i < R (c i)`; * the family of balls `Metric.ball (c i) (r' i)` is locally finite; * the balls `Metric.ball (c i) (r i)` cover the whole space. This is a simple corollary of `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis` and `exists_iUnion_ball_eq_radius_pos_lt` or `exists_locallyFinite_subset_iUnion_ball_radius_lt`.
Similar (v₁ : ι → P₁) (v₂ : ι → P₂) : Prop := ∃ r : ℝ≥0, r ≠ 0 ∧ ∀ (i₁ i₂ : ι), (edist (v₁ i₁) (v₁ i₂) = r * edist (v₂ i₁) (v₂ i₂)) @[inherit_doc] scoped[Similar] infixl:25 " ∼ " => Similar
def
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
Similar
Similarity between indexed sets of vertices v₁ and v₂. Use `open scoped Similar` to access the `v₁ ∼ v₂` notation.
similar_iff_exists_edist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ ∀ (i₁ i₂ : ι), (edist (v₁ i₁) (v₁ i₂) = r * edist (v₂ i₁) (v₂ i₂))) := Iff.rfl
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_edist_eq
Similarity holds if and only if all extended distances are proportional.
similar_iff_exists_pairwise_edist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ Pairwise fun i₁ i₂ ↦ (edist (v₁ i₁) (v₁ i₂) = r * edist (v₂ i₁) (v₂ i₂))) := by rw [similar_iff_exists_edist_eq] refine ⟨?_, ?_⟩ <;> rintro ⟨r, hr, h⟩ <;> refine ⟨r, hr, fun i₁ i₂ ↦ ?_⟩ · exact fun _ ↦ h i₁ i₂ · by_cases hi : i₁ = i₂ · simp [hi] · exact h hi
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_pairwise_edist_eq
Similarity holds if and only if all extended distances between points with different indices are proportional.
Congruent.similar {v₁ : ι → P₁} {v₂ : ι → P₂} (h : Congruent v₁ v₂) : Similar v₁ v₂ := ⟨1, one_ne_zero, fun i₁ i₂ ↦ by simpa using h i₁ i₂⟩
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
Congruent.similar
null
index_map (h : v₁ ∼ v₂) (f : ι' → ι) : (v₁ ∘ f) ∼ (v₂ ∘ f) := by rcases h with ⟨r, hr, h⟩ refine ⟨r, hr, fun _ _ => ?_⟩ apply h
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
index_map
A similarity scales extended distance. Forward direction of `similar_iff_exists_edist_eq`. -/ alias ⟨exists_edist_eq, _⟩ := similar_iff_exists_edist_eq /-- Similarity follows from scaled extended distance. Backward direction of `similar_iff_exists_edist_eq`. -/ alias ⟨_, of_exists_edist_eq⟩ := similar_iff_exists_edist_eq /-- A similarity pairwise scales extended distance. Forward direction of `similar_iff_exists_pairwise_edist_eq`. -/ alias ⟨exists_pairwise_edist_eq, _⟩ := similar_iff_exists_pairwise_edist_eq /-- Similarity follows from pairwise scaled extended distance. Backward direction of `similar_iff_exists_pairwise_edist_eq`. -/ alias ⟨_, of_exists_pairwise_edist_eq⟩ := similar_iff_exists_pairwise_edist_eq @[refl] protected lemma refl (v₁ : ι → P₁) : v₁ ∼ v₁ := ⟨1, one_ne_zero, fun _ _ => by {norm_cast; rw [one_mul]}⟩ @[symm] protected lemma symm (h : v₁ ∼ v₂) : v₂ ∼ v₁ := by rcases h with ⟨r, hr, h⟩ refine ⟨r⁻¹, inv_ne_zero hr, fun _ _ => ?_⟩ rw [ENNReal.coe_inv hr, ← ENNReal.div_eq_inv_mul, ENNReal.eq_div_iff _ ENNReal.coe_ne_top, h] norm_cast lemma _root_.similar_comm : v₁ ∼ v₂ ↔ v₂ ∼ v₁ := ⟨Similar.symm, Similar.symm⟩ @[trans] protected lemma trans (h₁ : v₁ ∼ v₂) (h₂ : v₂ ∼ v₃) : v₁ ∼ v₃ := by rcases h₁ with ⟨r₁, hr₁, h₁⟩; rcases h₂ with ⟨r₂, hr₂, h₂⟩ refine ⟨r₁ * r₂, mul_ne_zero hr₁ hr₂, fun _ _ => ?_⟩ rw [ENNReal.coe_mul, mul_assoc, h₁, h₂] /-- Change the index set ι to an index ι' that maps to ι.
@[simp] index_equiv (f : ι' ≃ ι) (v₁ : ι → P₁) (v₂ : ι → P₂) : v₁ ∘ f ∼ v₂ ∘ f ↔ v₁ ∼ v₂ := by refine ⟨fun h => ?_, fun h => Similar.index_map h f⟩ rcases h with ⟨r, hr, h⟩ refine ⟨r, hr, fun i₁ i₂ => ?_⟩ simpa [f.right_inv i₁, f.right_inv i₂] using h (f.symm i₁) (f.symm i₂)
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
index_equiv
Change between equivalent index sets ι and ι'.
similar_iff_exists_nndist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ ∀ (i₁ i₂ : ι), (nndist (v₁ i₁) (v₁ i₂) = r * nndist (v₂ i₁) (v₂ i₂))) := exists_congr <| fun _ => and_congr Iff.rfl <| forall₂_congr <| fun _ _ => by { rw [edist_nndist, edist_nndist]; norm_cast }
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_nndist_eq
Similarity holds if and only if all non-negative distances are proportional.
similar_iff_exists_pairwise_nndist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ Pairwise fun i₁ i₂ ↦ (nndist (v₁ i₁) (v₁ i₂) = r * nndist (v₂ i₁) (v₂ i₂))) := by simp_rw [similar_iff_exists_pairwise_edist_eq, edist_nndist] exact_mod_cast Iff.rfl
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_pairwise_nndist_eq
Similarity holds if and only if all non-negative distances between points with different indices are proportional.
similar_iff_exists_dist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ ∀ (i₁ i₂ : ι), (dist (v₁ i₁) (v₁ i₂) = r * dist (v₂ i₁) (v₂ i₂))) := similar_iff_exists_nndist_eq.trans (exists_congr <| fun _ => and_congr Iff.rfl <| forall₂_congr <| fun _ _ => by { rw [dist_nndist, dist_nndist]; norm_cast })
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_dist_eq
Similarity holds if and only if all distances are proportional.
similar_iff_exists_pairwise_dist_eq : Similar v₁ v₂ ↔ (∃ r : ℝ≥0, r ≠ 0 ∧ Pairwise fun i₁ i₂ ↦ (dist (v₁ i₁) (v₁ i₂) = r * dist (v₂ i₁) (v₂ i₂))) := by simp_rw [similar_iff_exists_pairwise_nndist_eq, dist_nndist] exact_mod_cast Iff.rfl
lemma
Topology
[ "Mathlib.Topology.MetricSpace.Congruence" ]
Mathlib/Topology/MetricSpace/Similarity.lean
similar_iff_exists_pairwise_dist_eq
Similarity holds if and only if all distances between points with different indices are proportional.
thickenedIndicatorAux (δ : ℝ) (E : Set α) : α → ℝ≥0∞ := fun x : α => (1 : ℝ≥0∞) - infEdist x E / ENNReal.ofReal δ
def
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux
The `δ`-thickened indicator of a set `E` is the function that equals `1` on `E` and `0` outside a `δ`-thickening of `E` and interpolates (continuously) between these values using `infEdist _ E`. `thickenedIndicatorAux` is the unbundled `ℝ≥0∞`-valued function. See `thickenedIndicator` for the (bundled) bounded continuous function with `ℝ≥0`-values.
continuous_thickenedIndicatorAux {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) : Continuous (thickenedIndicatorAux δ E) := by unfold thickenedIndicatorAux let f := fun x : α => (⟨1, infEdist x E / ENNReal.ofReal δ⟩ : ℝ≥0 × ℝ≥0∞) let sub := fun p : ℝ≥0 × ℝ≥0∞ => (p.1 : ℝ≥0∞) - p.2 rw [show (fun x : α => (1 : ℝ≥0∞) - infEdist x E / ENNReal.ofReal δ) = sub ∘ f by rfl] apply (@ENNReal.continuous_nnreal_sub 1).comp apply (ENNReal.continuous_div_const (ENNReal.ofReal δ) _).comp continuous_infEdist norm_num [δ_pos]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
continuous_thickenedIndicatorAux
null
thickenedIndicatorAux_le_one (δ : ℝ) (E : Set α) (x : α) : thickenedIndicatorAux δ E x ≤ 1 := by apply tsub_le_self (α := ℝ≥0∞)
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_le_one
null
thickenedIndicatorAux_lt_top {δ : ℝ} {E : Set α} {x : α} : thickenedIndicatorAux δ E x < ∞ := lt_of_le_of_lt (thickenedIndicatorAux_le_one _ _ _) one_lt_top
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_lt_top
null
thickenedIndicatorAux_closure_eq (δ : ℝ) (E : Set α) : thickenedIndicatorAux δ (closure E) = thickenedIndicatorAux δ E := by simp +unfoldPartialApp only [thickenedIndicatorAux, infEdist_closure]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_closure_eq
null
thickenedIndicatorAux_one (δ : ℝ) (E : Set α) {x : α} (x_in_E : x ∈ E) : thickenedIndicatorAux δ E x = 1 := by simp [thickenedIndicatorAux, infEdist_zero_of_mem x_in_E, tsub_zero]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_one
null
thickenedIndicatorAux_one_of_mem_closure (δ : ℝ) (E : Set α) {x : α} (x_mem : x ∈ closure E) : thickenedIndicatorAux δ E x = 1 := by rw [← thickenedIndicatorAux_closure_eq, thickenedIndicatorAux_one δ (closure E) x_mem]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_one_of_mem_closure
null
thickenedIndicatorAux_zero {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α} (x_out : x ∉ thickening δ E) : thickenedIndicatorAux δ E x = 0 := by rw [thickening, mem_setOf_eq, not_lt] at x_out unfold thickenedIndicatorAux apply le_antisymm _ bot_le have key := tsub_le_tsub (@rfl _ (1 : ℝ≥0∞)).le (ENNReal.div_le_div x_out (@rfl _ (ENNReal.ofReal δ : ℝ≥0∞)).le) rw [ENNReal.div_self (ne_of_gt (ENNReal.ofReal_pos.mpr δ_pos)) ofReal_ne_top] at key simpa [tsub_self] using key
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_zero
null
thickenedIndicatorAux_mono {δ₁ δ₂ : ℝ} (hle : δ₁ ≤ δ₂) (E : Set α) : thickenedIndicatorAux δ₁ E ≤ thickenedIndicatorAux δ₂ E := fun _ => tsub_le_tsub (@rfl ℝ≥0∞ 1).le (ENNReal.div_le_div rfl.le (ofReal_le_ofReal hle))
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_mono
null
indicator_le_thickenedIndicatorAux (δ : ℝ) (E : Set α) : (E.indicator fun _ => (1 : ℝ≥0∞)) ≤ thickenedIndicatorAux δ E := by intro a by_cases h : a ∈ E · simp only [h, indicator_of_mem, thickenedIndicatorAux_one δ E h, le_refl] · simp only [h, indicator_of_notMem, not_false_iff, zero_le]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
indicator_le_thickenedIndicatorAux
null
thickenedIndicatorAux_subset (δ : ℝ) {E₁ E₂ : Set α} (subset : E₁ ⊆ E₂) : thickenedIndicatorAux δ E₁ ≤ thickenedIndicatorAux δ E₂ := fun _ => tsub_le_tsub (@rfl ℝ≥0∞ 1).le (ENNReal.div_le_div (infEdist_anti subset) rfl.le)
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_subset
null
thickenedIndicatorAux_tendsto_indicator_closure {δseq : ℕ → ℝ} (δseq_lim : Tendsto δseq atTop (𝓝 0)) (E : Set α) : Tendsto (fun n => thickenedIndicatorAux (δseq n) E) atTop (𝓝 (indicator (closure E) fun _ => (1 : ℝ≥0∞))) := by rw [tendsto_pi_nhds] intro x by_cases x_mem_closure : x ∈ closure E · simp_rw [thickenedIndicatorAux_one_of_mem_closure _ E x_mem_closure] rw [show (indicator (closure E) fun _ => (1 : ℝ≥0∞)) x = 1 by simp only [x_mem_closure, indicator_of_mem]] exact tendsto_const_nhds · rw [show (closure E).indicator (fun _ => (1 : ℝ≥0∞)) x = 0 by simp only [x_mem_closure, indicator_of_notMem, not_false_iff]] rcases exists_real_pos_lt_infEdist_of_notMem_closure x_mem_closure with ⟨ε, ⟨ε_pos, ε_lt⟩⟩ rw [Metric.tendsto_nhds] at δseq_lim specialize δseq_lim ε ε_pos simp only [dist_zero_right, Real.norm_eq_abs, eventually_atTop] at δseq_lim rcases δseq_lim with ⟨N, hN⟩ apply tendsto_atTop_of_eventually_const (i₀ := N) intro n n_large have key : x ∉ thickening ε E := by simpa only [thickening, mem_setOf_eq, not_lt] using ε_lt.le refine le_antisymm ?_ bot_le apply (thickenedIndicatorAux_mono (lt_of_abs_lt (hN n n_large)).le E x).trans exact (thickenedIndicatorAux_zero ε_pos E key).le
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicatorAux_tendsto_indicator_closure
As the thickening radius δ tends to 0, the δ-thickened indicator of a set E (in α) tends pointwise (i.e., w.r.t. the product topology on `α → ℝ≥0∞`) to the indicator function of the closure of E. This statement is for the unbundled `ℝ≥0∞`-valued functions `thickenedIndicatorAux δ E`, see `thickenedIndicator_tendsto_indicator_closure` for the version for bundled `ℝ≥0`-valued bounded continuous functions.
@[simps] thickenedIndicator {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) : α →ᵇ ℝ≥0 where toFun := fun x : α => (thickenedIndicatorAux δ E x).toNNReal continuous_toFun := by apply ContinuousOn.comp_continuous continuousOn_toNNReal (continuous_thickenedIndicatorAux δ_pos E) intro x exact (lt_of_le_of_lt (@thickenedIndicatorAux_le_one _ _ δ E x) one_lt_top).ne map_bounded' := by use 2 intro x y rw [NNReal.dist_eq] apply (abs_sub _ _).trans rw [NNReal.abs_eq, NNReal.abs_eq, ← one_add_one_eq_two] have key := @thickenedIndicatorAux_le_one _ _ δ E apply add_le_add <;> · norm_cast exact (toNNReal_le_toNNReal (lt_of_le_of_lt (key _) one_lt_top).ne one_ne_top).mpr (key _)
def
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator
The `δ`-thickened indicator of a set `E` is the function that equals `1` on `E` and `0` outside a `δ`-thickening of `E` and interpolates (continuously) between these values using `infEdist _ E`. `thickenedIndicator` is the (bundled) bounded continuous function with `ℝ≥0`-values. See `thickenedIndicatorAux` for the unbundled `ℝ≥0∞`-valued function.
thickenedIndicator.coeFn_eq_comp {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) : ⇑(thickenedIndicator δ_pos E) = ENNReal.toNNReal ∘ thickenedIndicatorAux δ E := rfl
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator.coeFn_eq_comp
null
thickenedIndicator_le_one {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) (x : α) : thickenedIndicator δ_pos E x ≤ 1 := by rw [thickenedIndicator.coeFn_eq_comp] simpa using (toNNReal_le_toNNReal thickenedIndicatorAux_lt_top.ne one_ne_top).mpr (thickenedIndicatorAux_le_one δ E x)
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_le_one
null
thickenedIndicator_one_of_mem_closure {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α} (x_mem : x ∈ closure E) : thickenedIndicator δ_pos E x = 1 := by rw [thickenedIndicator_apply, thickenedIndicatorAux_one_of_mem_closure δ E x_mem, toNNReal_one]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_one_of_mem_closure
null
one_le_thickenedIndicator_apply' {X : Type _} [PseudoEMetricSpace X] {δ : ℝ} (δ_pos : 0 < δ) {F : Set X} {x : X} (hxF : x ∈ closure F) : 1 ≤ thickenedIndicator δ_pos F x := by rw [thickenedIndicator_one_of_mem_closure δ_pos F hxF]
lemma
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
one_le_thickenedIndicator_apply'
null
one_le_thickenedIndicator_apply (X : Type _) [PseudoEMetricSpace X] {δ : ℝ} (δ_pos : 0 < δ) {F : Set X} {x : X} (hxF : x ∈ F) : 1 ≤ thickenedIndicator δ_pos F x := one_le_thickenedIndicator_apply' δ_pos (subset_closure hxF)
lemma
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
one_le_thickenedIndicator_apply
null
thickenedIndicator_one {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α} (x_in_E : x ∈ E) : thickenedIndicator δ_pos E x = 1 := thickenedIndicator_one_of_mem_closure _ _ (subset_closure x_in_E)
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_one
null
thickenedIndicator_zero {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α} (x_out : x ∉ thickening δ E) : thickenedIndicator δ_pos E x = 0 := by rw [thickenedIndicator_apply, thickenedIndicatorAux_zero δ_pos E x_out, toNNReal_zero]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_zero
null
indicator_le_thickenedIndicator {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) : (E.indicator fun _ => (1 : ℝ≥0)) ≤ thickenedIndicator δ_pos E := by intro a by_cases h : a ∈ E · simp only [h, indicator_of_mem, thickenedIndicator_one δ_pos E h, le_refl] · simp only [h, indicator_of_notMem, not_false_iff, zero_le]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
indicator_le_thickenedIndicator
null
thickenedIndicator_mono {δ₁ δ₂ : ℝ} (δ₁_pos : 0 < δ₁) (δ₂_pos : 0 < δ₂) (hle : δ₁ ≤ δ₂) (E : Set α) : ⇑(thickenedIndicator δ₁_pos E) ≤ thickenedIndicator δ₂_pos E := by intro x apply (toNNReal_le_toNNReal thickenedIndicatorAux_lt_top.ne thickenedIndicatorAux_lt_top.ne).mpr apply thickenedIndicatorAux_mono hle
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_mono
null
thickenedIndicator_subset {δ : ℝ} (δ_pos : 0 < δ) {E₁ E₂ : Set α} (subset : E₁ ⊆ E₂) : ⇑(thickenedIndicator δ_pos E₁) ≤ thickenedIndicator δ_pos E₂ := fun x => (toNNReal_le_toNNReal thickenedIndicatorAux_lt_top.ne thickenedIndicatorAux_lt_top.ne).mpr (thickenedIndicatorAux_subset δ subset x)
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_subset
null
thickenedIndicator_tendsto_indicator_closure {δseq : ℕ → ℝ} (δseq_pos : ∀ n, 0 < δseq n) (δseq_lim : Tendsto δseq atTop (𝓝 0)) (E : Set α) : Tendsto (fun n : ℕ => ((↑) : (α →ᵇ ℝ≥0) → α → ℝ≥0) (thickenedIndicator (δseq_pos n) E)) atTop (𝓝 (indicator (closure E) fun _ => (1 : ℝ≥0))) := by have key := thickenedIndicatorAux_tendsto_indicator_closure δseq_lim E rw [tendsto_pi_nhds] at * intro x rw [show indicator (closure E) (fun _ => (1 : ℝ≥0)) x = (indicator (closure E) (fun _ => (1 : ℝ≥0∞)) x).toNNReal by refine (congr_fun (comp_indicator_const 1 ENNReal.toNNReal toNNReal_zero) x).symm] refine Tendsto.comp (tendsto_toNNReal ?_) (key x) by_cases x_mem : x ∈ closure E <;> simp [x_mem]
theorem
Topology
[ "Mathlib.Data.ENNReal.Lemmas", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.ContinuousMap.Bounded.Basic" ]
Mathlib/Topology/MetricSpace/ThickenedIndicator.lean
thickenedIndicator_tendsto_indicator_closure
As the thickening radius δ tends to 0, the δ-thickened indicator of a set E (in α) tends pointwise to the indicator function of the closure of E. Note: This version is for the bundled bounded continuous functions, but the topology is not the topology on `α →ᵇ ℝ≥0`. Coercions to functions `α → ℝ≥0` are done first, so the topology instance is the product topology (the topology of pointwise convergence).