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
Prod.emetricSpaceMax [EMetricSpace β] : EMetricSpace (γ × β) := .ofT0PseudoEMetricSpace _
instance
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
Prod.emetricSpaceMax
If a `PseudoEMetricSpace` is a T₀ space, then it is an `EMetricSpace`. -/ -- TODO: make it an instance? abbrev EMetricSpace.ofT0PseudoEMetricSpace (α : Type*) [PseudoEMetricSpace α] [T0Space α] : EMetricSpace α := { ‹PseudoEMetricSpace α› with eq_of_edist_eq_zero := fun h => (EMetric.inseparable_iff.2 h).eq } /-- The product of two emetric spaces, with the max distance, is an extended metric spaces. We make sure that the uniform structure thus constructed is the one corresponding to the product of uniform spaces, to avoid diamond problems.
countable_closure_of_compact {s : Set γ} (hs : IsCompact s) : ∃ t, t ⊆ s ∧ t.Countable ∧ s = closure t := by rcases subset_countable_closure_of_compact hs with ⟨t, hts, htc, hsub⟩ exact ⟨t, hts, htc, hsub.antisymm (closure_minimal hts hs.isClosed)⟩
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
countable_closure_of_compact
A compact set in an emetric space is separable, i.e., it is the closure of a countable set.
@[simp] SeparationQuotient.edist_mk [PseudoEMetricSpace X] (x y : X) : edist (mk x) (mk y) = edist x y := rfl open SeparationQuotient in
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
SeparationQuotient.edist_mk
null
IsSeparable.exists_countable_dense_subset {s : Set α} (hs : IsSeparable s) : ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t := by have : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ s ⊆ ⋃ x ∈ t, closedBall x ε := fun ε ε0 => by rcases hs with ⟨t, htc, hst⟩ refine ⟨t, htc, hst.trans fun x hx => ?_⟩ rcases mem_closure_iff.1 hx ε ε0 with ⟨y, hyt, hxy⟩ exact mem_iUnion₂.2 ⟨y, hyt, mem_closedBall.2 hxy.le⟩ exact subset_countable_closure_of_almost_dense_set _ this
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
IsSeparable.exists_countable_dense_subset
If a set `s` is separable in a (pseudo extended) metric space, then it admits a countable dense subset. This is not obvious, as the countable set whose closure covers `s` given by the definition of separability does not need in general to be contained in `s`.
IsSeparable.separableSpace {s : Set α} (hs : IsSeparable s) : SeparableSpace s := by rcases hs.exists_countable_dense_subset with ⟨t, hts, htc, hst⟩ lift t to Set s using hts refine ⟨⟨t, countable_of_injective_of_countable_image Subtype.coe_injective.injOn htc, ?_⟩⟩ rwa [IsInducing.subtypeVal.dense_iff, Subtype.forall]
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
IsSeparable.separableSpace
If a set `s` is separable, then the corresponding subtype is separable in a (pseudo extended) metric space. This is not obvious, as the countable set whose closure covers `s` does not need in general to be contained in `s`.
lebesgue_number_lemma_of_emetric {ι : Sort*} {c : ι → Set α} (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) : ∃ δ > 0, ∀ x ∈ s, ∃ i, ball x δ ⊆ c i := by simpa only [ball, UniformSpace.ball, preimage_setOf_eq, edist_comm] using uniformity_basis_edist.lebesgue_number_lemma hs hc₁ hc₂
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric
null
lebesgue_number_lemma_of_emetric_nhds' {c : (x : α) → x ∈ s → Set α} (hs : IsCompact s) (hc : ∀ x hx, c x hx ∈ 𝓝 x) : ∃ δ > 0, ∀ x ∈ s, ∃ y : s, ball x δ ⊆ c y y.2 := by simpa only [ball, UniformSpace.ball, preimage_setOf_eq, edist_comm] using uniformity_basis_edist.lebesgue_number_lemma_nhds' hs hc
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric_nhds'
null
lebesgue_number_lemma_of_emetric_nhds {c : α → Set α} (hs : IsCompact s) (hc : ∀ x ∈ s, c x ∈ 𝓝 x) : ∃ δ > 0, ∀ x ∈ s, ∃ y, ball x δ ⊆ c y := by simpa only [ball, UniformSpace.ball, preimage_setOf_eq, edist_comm] using uniformity_basis_edist.lebesgue_number_lemma_nhds hs hc
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric_nhds
null
lebesgue_number_lemma_of_emetric_nhdsWithin' {c : (x : α) → x ∈ s → Set α} (hs : IsCompact s) (hc : ∀ x hx, c x hx ∈ 𝓝[s] x) : ∃ δ > 0, ∀ x ∈ s, ∃ y : s, ball x δ ∩ s ⊆ c y y.2 := by simpa only [ball, UniformSpace.ball, preimage_setOf_eq, edist_comm] using uniformity_basis_edist.lebesgue_number_lemma_nhdsWithin' hs hc
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric_nhdsWithin'
null
lebesgue_number_lemma_of_emetric_nhdsWithin {c : α → Set α} (hs : IsCompact s) (hc : ∀ x ∈ s, c x ∈ 𝓝[s] x) : ∃ δ > 0, ∀ x ∈ s, ∃ y, ball x δ ∩ s ⊆ c y := by simpa only [ball, UniformSpace.ball, preimage_setOf_eq, edist_comm] using uniformity_basis_edist.lebesgue_number_lemma_nhdsWithin hs hc
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric_nhdsWithin
null
lebesgue_number_lemma_of_emetric_sUnion {c : Set (Set α)} (hs : IsCompact s) (hc₁ : ∀ t ∈ c, IsOpen t) (hc₂ : s ⊆ ⋃₀ c) : ∃ δ > 0, ∀ x ∈ s, ∃ t ∈ c, ball x δ ⊆ t := by rw [sUnion_eq_iUnion] at hc₂; simpa using lebesgue_number_lemma_of_emetric hs (by simpa) hc₂
theorem
Topology
[ "Mathlib.Algebra.Order.BigOperators.Group.Finset", "Mathlib.Algebra.Order.Interval.Finset.SuccPred", "Mathlib.Data.Nat.SuccPred", "Mathlib.Order.Interval.Finset.Nat", "Mathlib.Topology.EMetricSpace.Defs", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.Topology.UniformSpace.LocallyUniformConvergence",...
Mathlib/Topology/EMetricSpace/Basic.lean
lebesgue_number_lemma_of_emetric_sUnion
null
noncomputable eVariationOn (f : α → E) (s : Set α) : ℝ≥0∞ := ⨆ p : ℕ × { u : ℕ → α // Monotone u ∧ ∀ i, u i ∈ s }, ∑ i ∈ Finset.range p.1, edist (f (p.2.1 (i + 1))) (f (p.2.1 i))
def
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eVariationOn
The (extended-real-valued) variation of a function `f` on a set `s` inside a linear order is the supremum of the sum of `edist (f (u (i+1))) (f (u i))` over all finite increasing sequences `u` in `s`.
BoundedVariationOn (f : α → E) (s : Set α) := eVariationOn f s ≠ ∞
def
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
BoundedVariationOn
A function has bounded variation on a set `s` if its total variation there is finite.
LocallyBoundedVariationOn (f : α → E) (s : Set α) := ∀ a b, a ∈ s → b ∈ s → BoundedVariationOn f (s ∩ Icc a b) /-! ## Basic computations of variation -/
def
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LocallyBoundedVariationOn
A function has locally bounded variation on a set `s` if, given any interval `[a, b]` with endpoints in `s`, then the function has finite variation on `s ∩ [a, b]`.
nonempty_monotone_mem {s : Set α} (hs : s.Nonempty) : Nonempty { u // Monotone u ∧ ∀ i : ℕ, u i ∈ s } := by obtain ⟨x, hx⟩ := hs exact ⟨⟨fun _ => x, fun i j _ => le_rfl, fun _ => hx⟩⟩
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
nonempty_monotone_mem
null
eq_of_edist_zero_on {f f' : α → E} {s : Set α} (h : ∀ ⦃x⦄, x ∈ s → edist (f x) (f' x) = 0) : eVariationOn f s = eVariationOn f' s := by dsimp only [eVariationOn] congr 1 with p : 1 congr 1 with i : 1 rw [edist_congr_right (h <| p.snd.prop.2 (i + 1)), edist_congr_left (h <| p.snd.prop.2 i)]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_of_edist_zero_on
null
eq_of_eqOn {f f' : α → E} {s : Set α} (h : EqOn f f' s) : eVariationOn f s = eVariationOn f' s := eq_of_edist_zero_on fun x xs => by rw [h xs, edist_self]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_of_eqOn
null
sum_le (f : α → E) {s : Set α} (n : ℕ) {u : ℕ → α} (hu : Monotone u) (us : ∀ i, u i ∈ s) : (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := le_iSup_of_le ⟨n, u, hu, us⟩ le_rfl
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sum_le
null
sum_le_of_monotoneOn_Icc (f : α → E) {s : Set α} {m n : ℕ} {u : ℕ → α} (hu : MonotoneOn u (Icc m n)) (us : ∀ i ∈ Icc m n, u i ∈ s) : (∑ i ∈ Finset.Ico m n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by rcases le_total n m with hnm | hmn · simp [Finset.Ico_eq_empty_of_le hnm] let π := projIcc m n hmn let v i := u (π i) calc ∑ i ∈ Finset.Ico m n, edist (f (u (i + 1))) (f (u i)) = ∑ i ∈ Finset.Ico m n, edist (f (v (i + 1))) (f (v i)) := Finset.sum_congr rfl fun i hi ↦ by rw [Finset.mem_Ico] at hi simp only [v, π, projIcc_of_mem hmn ⟨hi.1, hi.2.le⟩, projIcc_of_mem hmn ⟨hi.1.trans i.le_succ, hi.2⟩] _ ≤ ∑ i ∈ Finset.range n, edist (f (v (i + 1))) (f (v i)) := Finset.sum_mono_set _ (Nat.Iio_eq_range ▸ Finset.Ico_subset_Iio_self) _ ≤ eVariationOn f s := sum_le _ _ (fun i j h ↦ hu (π i).2 (π j).2 (monotone_projIcc hmn h)) fun i ↦ us _ (π i).2
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sum_le_of_monotoneOn_Icc
null
sum_le_of_monotoneOn_Iic (f : α → E) {s : Set α} {n : ℕ} {u : ℕ → α} (hu : MonotoneOn u (Iic n)) (us : ∀ i ≤ n, u i ∈ s) : (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s := by simpa using sum_le_of_monotoneOn_Icc f (m := 0) (hu.mono Icc_subset_Iic_self) fun i hi ↦ us i hi.2
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sum_le_of_monotoneOn_Iic
null
mono (f : α → E) {s t : Set α} (hst : t ⊆ s) : eVariationOn f t ≤ eVariationOn f s := by apply iSup_le _ rintro ⟨n, ⟨u, hu, ut⟩⟩ exact sum_le f n hu fun i => hst (ut i)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
mono
null
_root_.BoundedVariationOn.mono {f : α → E} {s : Set α} (h : BoundedVariationOn f s) {t : Set α} (ht : t ⊆ s) : BoundedVariationOn f t := ne_top_of_le_ne_top h (eVariationOn.mono f ht)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
_root_.BoundedVariationOn.mono
null
_root_.BoundedVariationOn.locallyBoundedVariationOn {f : α → E} {s : Set α} (h : BoundedVariationOn f s) : LocallyBoundedVariationOn f s := fun _ _ _ _ => h.mono inter_subset_left
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
_root_.BoundedVariationOn.locallyBoundedVariationOn
null
edist_le (f : α → E) {s : Set α} {x y : α} (hx : x ∈ s) (hy : y ∈ s) : edist (f x) (f y) ≤ eVariationOn f s := by wlog hxy : y ≤ x generalizing x y · rw [edist_comm] exact this hy hx (le_of_not_ge hxy) let u : ℕ → α := fun n => if n = 0 then y else x have hu : Monotone u := monotone_nat_of_le_succ fun | 0 => hxy | (_ + 1) => le_rfl have us : ∀ i, u i ∈ s := fun | 0 => hy | (_ + 1) => hx simpa only [Finset.sum_range_one] using sum_le f 1 hu us
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
edist_le
null
eq_zero_iff (f : α → E) {s : Set α} : eVariationOn f s = 0 ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) = 0 := by constructor · rintro h x xs y ys rw [← le_zero_iff, ← h] exact edist_le f xs ys · rintro h dsimp only [eVariationOn] rw [ENNReal.iSup_eq_zero] rintro ⟨n, u, um, us⟩ exact Finset.sum_eq_zero fun i _ => h _ (us i.succ) _ (us i)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_zero_iff
null
constant_on {f : α → E} {s : Set α} (hf : (f '' s).Subsingleton) : eVariationOn f s = 0 := by rw [eq_zero_iff] rintro x xs y ys rw [hf ⟨x, xs, rfl⟩ ⟨y, ys, rfl⟩, edist_self] @[simp]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
constant_on
null
protected subsingleton (f : α → E) {s : Set α} (hs : s.Subsingleton) : eVariationOn f s = 0 := constant_on (hs.image f)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
subsingleton
null
lowerSemicontinuous_aux {ι : Type*} {F : ι → α → E} {p : Filter ι} {f : α → E} {s : Set α} (Ffs : ∀ x ∈ s, Tendsto (fun i => F i x) p (𝓝 (f x))) {v : ℝ≥0∞} (hv : v < eVariationOn f s) : ∀ᶠ n : ι in p, v < eVariationOn (F n) s := by obtain ⟨⟨n, ⟨u, um, us⟩⟩, hlt⟩ : ∃ p : ℕ × { u : ℕ → α // Monotone u ∧ ∀ i, u i ∈ s }, v < ∑ i ∈ Finset.range p.1, edist (f ((p.2 : ℕ → α) (i + 1))) (f ((p.2 : ℕ → α) i)) := lt_iSup_iff.mp hv have : Tendsto (fun j => ∑ i ∈ Finset.range n, edist (F j (u (i + 1))) (F j (u i))) p (𝓝 (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i)))) := by apply tendsto_finset_sum exact fun i _ => Tendsto.edist (Ffs (u i.succ) (us i.succ)) (Ffs (u i) (us i)) exact (this.eventually_const_lt hlt).mono fun i h => h.trans_le (sum_le (F i) n um us)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
lowerSemicontinuous_aux
null
protected lowerSemicontinuous (s : Set α) : LowerSemicontinuous fun f : α →ᵤ[s.image singleton] E => eVariationOn f s := fun f ↦ by apply @lowerSemicontinuous_aux _ _ _ _ (UniformOnFun α E (s.image singleton)) id (𝓝 f) f s _ simpa only [UniformOnFun.tendsto_iff_tendstoUniformlyOn, mem_image, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂, tendstoUniformlyOn_singleton_iff_tendsto] using @tendsto_id _ (𝓝 f)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
lowerSemicontinuous
The map `(eVariationOn · s)` is lower semicontinuous for pointwise convergence *on `s`*. Pointwise convergence on `s` is encoded here as uniform convergence on the family consisting of the singletons of elements of `s`.
lowerSemicontinuous_uniformOn (s : Set α) : LowerSemicontinuous fun f : α →ᵤ[{s}] E => eVariationOn f s := fun f ↦ by apply @lowerSemicontinuous_aux _ _ _ _ (UniformOnFun α E {s}) id (𝓝 f) f s _ have := @tendsto_id _ (𝓝 f) rw [UniformOnFun.tendsto_iff_tendstoUniformlyOn] at this simp_rw [← tendstoUniformlyOn_singleton_iff_tendsto] exact fun x xs => (this s rfl).mono (singleton_subset_iff.mpr xs)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
lowerSemicontinuous_uniformOn
The map `(eVariationOn · s)` is lower semicontinuous for uniform convergence on `s`.
_root_.BoundedVariationOn.dist_le {E : Type*} [PseudoMetricSpace E] {f : α → E} {s : Set α} (h : BoundedVariationOn f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s) : dist (f x) (f y) ≤ (eVariationOn f s).toReal := by rw [← ENNReal.ofReal_le_ofReal_iff ENNReal.toReal_nonneg, ENNReal.ofReal_toReal h, ← edist_dist] exact edist_le f hx hy
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
_root_.BoundedVariationOn.dist_le
null
_root_.BoundedVariationOn.sub_le {f : α → ℝ} {s : Set α} (h : BoundedVariationOn f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s) : f x - f y ≤ (eVariationOn f s).toReal := by apply (le_abs_self _).trans rw [← Real.dist_eq] exact h.dist_le hx hy
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
_root_.BoundedVariationOn.sub_le
null
add_point (f : α → E) {s : Set α} {x : α} (hx : x ∈ s) (u : ℕ → α) (hu : Monotone u) (us : ∀ i, u i ∈ s) (n : ℕ) : ∃ (v : ℕ → α) (m : ℕ), Monotone v ∧ (∀ i, v i ∈ s) ∧ x ∈ v '' Iio m ∧ (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ ∑ j ∈ Finset.range m, edist (f (v (j + 1))) (f (v j)) := by rcases le_or_gt (u n) x with (h | h) · let v i := if i ≤ n then u i else x have vs : ∀ i, v i ∈ s := fun i ↦ by simp only [v] split_ifs · exact us i · exact hx have hv : Monotone v := by refine monotone_nat_of_le_succ fun i => ?_ simp only [v] rcases lt_trichotomy i n with (hi | rfl | hi) · have : i + 1 ≤ n := Nat.succ_le_of_lt hi simp only [hi.le, this, if_true] exact hu (Nat.le_succ i) · simp only [le_refl, if_true, add_le_iff_nonpos_right, Nat.le_zero, Nat.one_ne_zero, if_false, h] · have A : ¬i ≤ n := hi.not_ge have B : ¬i + 1 ≤ n := fun h => A (i.le_succ.trans h) simp only [A, B, if_false, le_rfl] refine ⟨v, n + 2, hv, vs, (mem_image _ _ _).2 ⟨n + 1, ?_, ?_⟩, ?_⟩ · rw [mem_Iio]; exact Nat.lt_succ_self (n + 1) · have : ¬n + 1 ≤ n := Nat.not_succ_le_self n simp only [v, this, ite_eq_right_iff, IsEmpty.forall_iff] · calc (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) = ∑ i ∈ Finset.range n, edist (f (v (i + 1))) (f (v i)) := by apply Finset.sum_congr rfl fun i hi => ?_ simp only [Finset.mem_range] at hi have : i + 1 ≤ n := Nat.succ_le_of_lt hi simp only [v, hi.le, this, if_true] _ ≤ ∑ j ∈ Finset.range (n + 2), edist (f (v (j + 1))) (f (v j)) := by gcongr apply Nat.le_add_right have exists_N : ∃ N, N ≤ n ∧ x < u N := ⟨n, le_rfl, h⟩ let N := Nat.find exists_N have hN : N ≤ n ∧ x < u N := Nat.find_spec exists_N let w : ℕ → α := fun i => if i < N then u i else if i = N then x else u (i - 1) have ws : ∀ i, w i ∈ s := by grind have hw : Monotone w := by apply monotone_nat_of_le_succ fun i => ?_ dsimp only [w] rcases lt_trichotomy (i + 1) N with (hi | hi | hi) · have : i < N := Nat.lt_of_le_of_lt (Nat.le_succ i) hi simp only [hi, this, if_true] exact hu (Nat.le_succ _) · have A : i < N := hi ▸ i.lt_succ_self ...
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
add_point
Consider a monotone function `u` parameterizing some points of a set `s`. Given `x ∈ s`, then one can find another monotone function `v` parameterizing the same points as `u`, with `x` added. In particular, the variation of a function along `u` is bounded by its variation along `v`.
add_le_union (f : α → E) {s t : Set α} (h : ∀ x ∈ s, ∀ y ∈ t, x ≤ y) : eVariationOn f s + eVariationOn f t ≤ eVariationOn f (s ∪ t) := by by_cases hs : s = ∅ · simp [hs] have : Nonempty { u // Monotone u ∧ ∀ i : ℕ, u i ∈ s } := nonempty_monotone_mem (nonempty_iff_ne_empty.2 hs) by_cases ht : t = ∅ · simp [ht] have : Nonempty { u // Monotone u ∧ ∀ i : ℕ, u i ∈ t } := nonempty_monotone_mem (nonempty_iff_ne_empty.2 ht) refine ENNReal.iSup_add_iSup_le ?_ /- We start from two sequences `u` and `v` along `s` and `t` respectively, and we build a new sequence `w` along `s ∪ t` by juxtaposing them. Its variation is larger than the sum of the variations. -/ rintro ⟨n, ⟨u, hu, us⟩⟩ ⟨m, ⟨v, hv, vt⟩⟩ let w i := if i ≤ n then u i else v (i - (n + 1)) have wst : ∀ i, w i ∈ s ∪ t := by intro i by_cases hi : i ≤ n · simp [w, hi, us] · simp [w, hi, vt] have hw : Monotone w := by intro i j hij dsimp only [w] split_ifs with h_1 h_2 h_2 · exact hu hij · apply h _ (us _) _ (vt _) · exfalso; exact h_1 (hij.trans h_2) · apply hv (tsub_le_tsub hij le_rfl) calc ((∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) + ∑ i ∈ Finset.range m, edist (f (v (i + 1))) (f (v i))) = (∑ i ∈ Finset.range n, edist (f (w (i + 1))) (f (w i))) + ∑ i ∈ Finset.range m, edist (f (w (n + 1 + i + 1))) (f (w (n + 1 + i))) := by dsimp only [w] congr 1 · grind [Finset.sum_congr] · grind _ = (∑ i ∈ Finset.range n, edist (f (w (i + 1))) (f (w i))) + ∑ i ∈ Finset.Ico (n + 1) (n + 1 + m), edist (f (w (i + 1))) (f (w i)) := by congr 1 rw [Finset.range_eq_Ico] convert Finset.sum_Ico_add (fun i : ℕ => edist (f (w (i + 1))) (f (w i))) 0 m (n + 1) using 3 <;> abel _ ≤ ∑ i ∈ Finset.range (n + 1 + m), edist (f (w (i + 1))) (f (w i)) := by rw [← Finset.sum_union] · gcongr rintro i hi simp only [Finset.mem_union, Finset.mem_range, Finset.mem_Ico] at hi ⊢ cutsat · refine Finset.disjoint_left.2 fun i hi h'i => ?_ ...
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
add_le_union
The variation of a function on the union of two sets `s` and `t`, with `s` to the left of `t`, bounds the sum of the variations along `s` and `t`.
union (f : α → E) {s t : Set α} {x : α} (hs : IsGreatest s x) (ht : IsLeast t x) : eVariationOn f (s ∪ t) = eVariationOn f s + eVariationOn f t := by classical apply le_antisymm _ (eVariationOn.add_le_union f fun a ha b hb => le_trans (hs.2 ha) (ht.2 hb)) apply iSup_le _ rintro ⟨n, ⟨u, hu, ust⟩⟩ obtain ⟨v, m, hv, vst, xv, huv⟩ : ∃ (v : ℕ → α) (m : ℕ), Monotone v ∧ (∀ i, v i ∈ s ∪ t) ∧ x ∈ v '' Iio m ∧ (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ ∑ j ∈ Finset.range m, edist (f (v (j + 1))) (f (v j)) := eVariationOn.add_point f (mem_union_left t hs.1) u hu ust n obtain ⟨N, hN, Nx⟩ : ∃ N, N < m ∧ v N = x := xv calc (∑ j ∈ Finset.range n, edist (f (u (j + 1))) (f (u j))) ≤ ∑ j ∈ Finset.range m, edist (f (v (j + 1))) (f (v j)) := huv _ = (∑ j ∈ Finset.Ico 0 N, edist (f (v (j + 1))) (f (v j))) + ∑ j ∈ Finset.Ico N m, edist (f (v (j + 1))) (f (v j)) := by rw [Finset.range_eq_Ico, Finset.sum_Ico_consecutive _ (zero_le _) hN.le] _ ≤ eVariationOn f s + eVariationOn f t := by refine add_le_add ?_ ?_ · apply sum_le_of_monotoneOn_Icc _ (hv.monotoneOn _) fun i hi => ?_ rcases vst i with (h | h); · exact h have : v i = x := by apply le_antisymm · rw [← Nx]; exact hv hi.2 · exact ht.2 h rw [this] exact hs.1 · apply sum_le_of_monotoneOn_Icc _ (hv.monotoneOn _) fun i hi => ?_ rcases vst i with (h | h); swap; · exact h have : v i = x := by apply le_antisymm · exact hs.2 h · rw [← Nx]; exact hv hi.1 rw [this] exact ht.1
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
union
If a set `s` is to the left of a set `t`, and both contain the boundary point `x`, then the variation of `f` along `s ∪ t` is the sum of the variations.
Icc_add_Icc (f : α → E) {s : Set α} {a b c : α} (hab : a ≤ b) (hbc : b ≤ c) (hb : b ∈ s) : eVariationOn f (s ∩ Icc a b) + eVariationOn f (s ∩ Icc b c) = eVariationOn f (s ∩ Icc a c) := by have A : IsGreatest (s ∩ Icc a b) b := ⟨⟨hb, hab, le_rfl⟩, inter_subset_right.trans Icc_subset_Iic_self⟩ have B : IsLeast (s ∩ Icc b c) b := ⟨⟨hb, le_rfl, hbc⟩, inter_subset_right.trans Icc_subset_Ici_self⟩ rw [← eVariationOn.union f A B, ← inter_union_distrib_left, Icc_union_Icc_eq_Icc hab hbc]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
Icc_add_Icc
null
sum (f : α → E) {s : Set α} {E : ℕ → α} (hE : Monotone E) {n : ℕ} (hn : ∀ i, 0 < i → i < n → E i ∈ s) : ∑ i ∈ Finset.range n, eVariationOn f (s ∩ Icc (E i) (E (i + 1))) = eVariationOn f (s ∩ Icc (E 0) (E n)) := by induction n with | zero => simp [eVariationOn.subsingleton f Subsingleton.inter_singleton] | succ n ih => by_cases hn₀ : n = 0 · simp [hn₀] rw [← Icc_add_Icc (b := E n)] · rw [← ih (by intros; apply hn <;> omega)] apply Finset.sum_range_succ · apply hE; omega · apply hE; omega · apply hn <;> omega
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sum
null
sum' (f : α → E) {I : ℕ → α} (hI : Monotone I) {n : ℕ} : ∑ i ∈ Finset.range n, eVariationOn f (Icc (I i) (I (i + 1))) = eVariationOn f (Icc (I 0) (I n)) := by convert sum f hI (s := Icc (I 0) (I n)) (n := n) (hn := by intros; rw [mem_Icc]; constructor <;> (apply hI; omega) ) with i hi · simp only [right_eq_inter] gcongr <;> (apply hI; rw [Finset.mem_range] at hi; omega) · simp
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sum'
null
comp_le_of_monotoneOn (f : α → E) {s : Set α} {t : Set β} (φ : β → α) (hφ : MonotoneOn φ t) (φst : MapsTo φ t s) : eVariationOn (f ∘ φ) t ≤ eVariationOn f s := iSup_le fun ⟨n, u, hu, ut⟩ => le_iSup_of_le ⟨n, φ ∘ u, fun x y xy => hφ (ut x) (ut y) (hu xy), fun i => φst (ut i)⟩ le_rfl
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_le_of_monotoneOn
null
comp_le_of_antitoneOn (f : α → E) {s : Set α} {t : Set β} (φ : β → α) (hφ : AntitoneOn φ t) (φst : MapsTo φ t s) : eVariationOn (f ∘ φ) t ≤ eVariationOn f s := by refine iSup_le ?_ rintro ⟨n, u, hu, ut⟩ rw [← Finset.sum_range_reflect] refine (Finset.sum_congr rfl fun x hx => ?_).trans_le <| le_iSup_of_le ⟨n, fun i => φ (u <| n - i), fun x y xy => hφ (ut _) (ut _) (hu <| Nat.sub_le_sub_left xy n), fun i => φst (ut _)⟩ le_rfl rw [Finset.mem_range] at hx dsimp only [Subtype.coe_mk, Function.comp_apply] rw [edist_comm] congr 4 <;> omega
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_le_of_antitoneOn
null
comp_eq_of_monotoneOn (f : α → E) {t : Set β} (φ : β → α) (hφ : MonotoneOn φ t) : eVariationOn (f ∘ φ) t = eVariationOn f (φ '' t) := by apply le_antisymm (comp_le_of_monotoneOn f φ hφ (mapsTo_image φ t)) cases isEmpty_or_nonempty β · convert zero_le (_ : ℝ≥0∞) exact eVariationOn.subsingleton f <| (subsingleton_of_subsingleton.image _).anti (surjOn_image φ t) let ψ := φ.invFunOn t have ψφs : EqOn (φ ∘ ψ) id (φ '' t) := (surjOn_image φ t).rightInvOn_invFunOn have ψts : MapsTo ψ (φ '' t) t := (surjOn_image φ t).mapsTo_invFunOn have hψ : MonotoneOn ψ (φ '' t) := Function.monotoneOn_of_rightInvOn_of_mapsTo hφ ψφs ψts change eVariationOn (f ∘ id) (φ '' t) ≤ eVariationOn (f ∘ φ) t rw [← eq_of_eqOn (ψφs.comp_left : EqOn (f ∘ φ ∘ ψ) (f ∘ id) (φ '' t))] exact comp_le_of_monotoneOn _ ψ hψ ψts
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_eq_of_monotoneOn
null
comp_inter_Icc_eq_of_monotoneOn (f : α → E) {t : Set β} (φ : β → α) (hφ : MonotoneOn φ t) {x y : β} (hx : x ∈ t) (hy : y ∈ t) : eVariationOn (f ∘ φ) (t ∩ Icc x y) = eVariationOn f (φ '' t ∩ Icc (φ x) (φ y)) := by rcases le_total x y with (h | h) · convert comp_eq_of_monotoneOn f φ (hφ.mono Set.inter_subset_left) apply le_antisymm · rintro _ ⟨⟨u, us, rfl⟩, vφx, vφy⟩ rcases le_total x u with (xu | ux) · rcases le_total u y with (uy | yu) · exact ⟨u, ⟨us, ⟨xu, uy⟩⟩, rfl⟩ · rw [le_antisymm vφy (hφ hy us yu)] exact ⟨y, ⟨hy, ⟨h, le_rfl⟩⟩, rfl⟩ · rw [← le_antisymm vφx (hφ us hx ux)] exact ⟨x, ⟨hx, ⟨le_rfl, h⟩⟩, rfl⟩ · rintro _ ⟨u, ⟨⟨hu, xu, uy⟩, rfl⟩⟩ exact ⟨⟨u, hu, rfl⟩, ⟨hφ hx hu xu, hφ hu hy uy⟩⟩ · rw [eVariationOn.subsingleton, eVariationOn.subsingleton] exacts [(Set.subsingleton_Icc_of_ge (hφ hy hx h)).anti Set.inter_subset_right, (Set.subsingleton_Icc_of_ge h).anti Set.inter_subset_right]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_inter_Icc_eq_of_monotoneOn
null
comp_eq_of_antitoneOn (f : α → E) {t : Set β} (φ : β → α) (hφ : AntitoneOn φ t) : eVariationOn (f ∘ φ) t = eVariationOn f (φ '' t) := by apply le_antisymm (comp_le_of_antitoneOn f φ hφ (mapsTo_image φ t)) cases isEmpty_or_nonempty β · convert zero_le (_ : ℝ≥0∞) exact eVariationOn.subsingleton f <| (subsingleton_of_subsingleton.image _).anti (surjOn_image φ t) let ψ := φ.invFunOn t have ψφs : EqOn (φ ∘ ψ) id (φ '' t) := (surjOn_image φ t).rightInvOn_invFunOn have ψts := (surjOn_image φ t).mapsTo_invFunOn have hψ : AntitoneOn ψ (φ '' t) := Function.antitoneOn_of_rightInvOn_of_mapsTo hφ ψφs ψts change eVariationOn (f ∘ id) (φ '' t) ≤ eVariationOn (f ∘ φ) t rw [← eq_of_eqOn (ψφs.comp_left : EqOn (f ∘ φ ∘ ψ) (f ∘ id) (φ '' t))] exact comp_le_of_antitoneOn _ ψ hψ ψts open OrderDual
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_eq_of_antitoneOn
null
comp_ofDual (f : α → E) (s : Set α) : eVariationOn (f ∘ ofDual) (ofDual ⁻¹' s) = eVariationOn f s := by convert comp_eq_of_antitoneOn f ofDual fun _ _ _ _ => id simp only [Equiv.image_preimage]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_ofDual
null
MonotoneOn.eVariationOn_le {f : α → ℝ} {s : Set α} (hf : MonotoneOn f s) {a b : α} (as : a ∈ s) (bs : b ∈ s) : eVariationOn f (s ∩ Icc a b) ≤ ENNReal.ofReal (f b - f a) := by apply iSup_le _ rintro ⟨n, ⟨u, hu, us⟩⟩ calc (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) = ∑ i ∈ Finset.range n, ENNReal.ofReal (f (u (i + 1)) - f (u i)) := by refine Finset.sum_congr rfl fun i hi => ?_ simp only [Finset.mem_range] at hi rw [edist_dist, Real.dist_eq, abs_of_nonneg] exact sub_nonneg_of_le (hf (us i).1 (us (i + 1)).1 (hu (Nat.le_succ _))) _ = ENNReal.ofReal (∑ i ∈ Finset.range n, (f (u (i + 1)) - f (u i))) := by rw [ENNReal.ofReal_sum_of_nonneg] intro i _ exact sub_nonneg_of_le (hf (us i).1 (us (i + 1)).1 (hu (Nat.le_succ _))) _ = ENNReal.ofReal (f (u n) - f (u 0)) := by rw [Finset.sum_range_sub fun i => f (u i)] _ ≤ ENNReal.ofReal (f b - f a) := by apply ENNReal.ofReal_le_ofReal exact sub_le_sub (hf (us n).1 bs (us n).2.2) (hf as (us 0).1 (us 0).2.1)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
MonotoneOn.eVariationOn_le
null
MonotoneOn.locallyBoundedVariationOn {f : α → ℝ} {s : Set α} (hf : MonotoneOn f s) : LocallyBoundedVariationOn f s := fun _ _ as bs => ((hf.eVariationOn_le as bs).trans_lt ENNReal.ofReal_lt_top).ne
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
MonotoneOn.locallyBoundedVariationOn
null
noncomputable variationOnFromTo (f : α → E) (s : Set α) (a b : α) : ℝ := if a ≤ b then (eVariationOn f (s ∩ Icc a b)).toReal else -(eVariationOn f (s ∩ Icc b a)).toReal
def
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
variationOnFromTo
The **signed** variation of `f` on the interval `Icc a b` intersected with the set `s`, squashed to a real (therefore only really meaningful if the variation is finite)
protected self (a : α) : variationOnFromTo f s a a = 0 := by dsimp only [variationOnFromTo] rw [if_pos le_rfl, Icc_self, eVariationOn.subsingleton, ENNReal.toReal_zero] exact fun x hx y hy => hx.2.trans hy.2.symm
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
self
null
protected nonneg_of_le {a b : α} (h : a ≤ b) : 0 ≤ variationOnFromTo f s a b := by simp only [variationOnFromTo, if_pos h, ENNReal.toReal_nonneg]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
nonneg_of_le
null
protected eq_neg_swap (a b : α) : variationOnFromTo f s a b = -variationOnFromTo f s b a := by rcases lt_trichotomy a b with (ab | rfl | ba) · simp only [variationOnFromTo, if_pos ab.le, if_neg ab.not_ge, neg_neg] · simp only [variationOnFromTo.self, neg_zero] · simp only [variationOnFromTo, if_pos ba.le, if_neg ba.not_ge]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_neg_swap
null
protected nonpos_of_ge {a b : α} (h : b ≤ a) : variationOnFromTo f s a b ≤ 0 := by rw [variationOnFromTo.eq_neg_swap] exact neg_nonpos_of_nonneg (variationOnFromTo.nonneg_of_le f s h)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
nonpos_of_ge
null
protected eq_of_le {a b : α} (h : a ≤ b) : variationOnFromTo f s a b = (eVariationOn f (s ∩ Icc a b)).toReal := if_pos h
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_of_le
null
protected eq_of_ge {a b : α} (h : b ≤ a) : variationOnFromTo f s a b = -(eVariationOn f (s ∩ Icc b a)).toReal := by rw [variationOnFromTo.eq_neg_swap, neg_inj, variationOnFromTo.eq_of_le f s h]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_of_ge
null
protected add {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b c : α} (ha : a ∈ s) (hb : b ∈ s) (hc : c ∈ s) : variationOnFromTo f s a b + variationOnFromTo f s b c = variationOnFromTo f s a c := by symm refine additive_of_isTotal (· ≤ · : α → α → Prop) (variationOnFromTo f s) (· ∈ s) ?_ ?_ ha hb hc · rintro x y _xs _ys simp only [variationOnFromTo.eq_neg_swap f s y x, add_neg_cancel] · rintro x y z xy yz xs ys zs rw [variationOnFromTo.eq_of_le f s xy, variationOnFromTo.eq_of_le f s yz, variationOnFromTo.eq_of_le f s (xy.trans yz), ← ENNReal.toReal_add (hf x y xs ys) (hf y z ys zs), eVariationOn.Icc_add_Icc f xy yz ys] variable {f s} in
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
add
null
protected edist_zero_of_eq_zero (hf : LocallyBoundedVariationOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) (h : variationOnFromTo f s a b = 0) : edist (f a) (f b) = 0 := by wlog h' : a ≤ b · rw [edist_comm] apply this hf hb ha _ (le_of_not_ge h') rw [variationOnFromTo.eq_neg_swap, h, neg_zero] · apply le_antisymm _ (zero_le _) rw [← ENNReal.ofReal_zero, ← h, variationOnFromTo.eq_of_le f s h', ENNReal.ofReal_toReal (hf a b ha hb)] apply eVariationOn.edist_le exacts [⟨ha, ⟨le_rfl, h'⟩⟩, ⟨hb, ⟨h', le_rfl⟩⟩]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
edist_zero_of_eq_zero
null
protected eq_left_iff {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b c : α} (ha : a ∈ s) (hb : b ∈ s) (hc : c ∈ s) : variationOnFromTo f s a b = variationOnFromTo f s a c ↔ variationOnFromTo f s b c = 0 := by simp only [← variationOnFromTo.add hf ha hb hc, left_eq_add]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_left_iff
null
protected eq_zero_iff_of_le {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) (ab : a ≤ b) : variationOnFromTo f s a b = 0 ↔ ∀ ⦃x⦄ (_hx : x ∈ s ∩ Icc a b) ⦃y⦄ (_hy : y ∈ s ∩ Icc a b), edist (f x) (f y) = 0 := by rw [variationOnFromTo.eq_of_le _ _ ab, ENNReal.toReal_eq_zero_iff, or_iff_left (hf a b ha hb), eVariationOn.eq_zero_iff]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_zero_iff_of_le
null
protected eq_zero_iff_of_ge {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) (ba : b ≤ a) : variationOnFromTo f s a b = 0 ↔ ∀ ⦃x⦄ (_hx : x ∈ s ∩ Icc b a) ⦃y⦄ (_hy : y ∈ s ∩ Icc b a), edist (f x) (f y) = 0 := by rw [variationOnFromTo.eq_of_ge _ _ ba, neg_eq_zero, ENNReal.toReal_eq_zero_iff, or_iff_left (hf b a hb ha), eVariationOn.eq_zero_iff]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_zero_iff_of_ge
null
protected eq_zero_iff {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) : variationOnFromTo f s a b = 0 ↔ ∀ ⦃x⦄ (_hx : x ∈ s ∩ uIcc a b) ⦃y⦄ (_hy : y ∈ s ∩ uIcc a b), edist (f x) (f y) = 0 := by rcases le_total a b with (ab | ba) · rw [uIcc_of_le ab] exact variationOnFromTo.eq_zero_iff_of_le hf ha hb ab · rw [uIcc_of_ge ba] exact variationOnFromTo.eq_zero_iff_of_ge hf ha hb ba variable {f} {s}
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
eq_zero_iff
null
protected monotoneOn (hf : LocallyBoundedVariationOn f s) {a : α} (as : a ∈ s) : MonotoneOn (variationOnFromTo f s a) s := by rintro b bs c cs bc rw [← variationOnFromTo.add hf as bs cs] exact le_add_of_nonneg_right (variationOnFromTo.nonneg_of_le f s bc)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
monotoneOn
null
protected antitoneOn (hf : LocallyBoundedVariationOn f s) {b : α} (bs : b ∈ s) : AntitoneOn (fun a => variationOnFromTo f s a b) s := by rintro a as c cs ac dsimp only rw [← variationOnFromTo.add hf as cs bs] exact le_add_of_nonneg_left (variationOnFromTo.nonneg_of_le f s ac)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
antitoneOn
null
protected sub_self_monotoneOn {f : α → ℝ} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a : α} (as : a ∈ s) : MonotoneOn (variationOnFromTo f s a - f) s := by rintro b bs c cs bc rw [Pi.sub_apply, Pi.sub_apply, le_sub_iff_add_le, add_comm_sub, ← le_sub_iff_add_le'] calc f c - f b ≤ |f c - f b| := le_abs_self _ _ = dist (f b) (f c) := by rw [dist_comm, Real.dist_eq] _ ≤ variationOnFromTo f s b c := by rw [variationOnFromTo.eq_of_le f s bc, dist_edist] apply ENNReal.toReal_mono (hf b c bs cs) apply eVariationOn.edist_le f exacts [⟨bs, le_rfl, bc⟩, ⟨cs, bc, le_rfl⟩] _ = variationOnFromTo f s a c - variationOnFromTo f s a b := by rw [← variationOnFromTo.add hf as bs cs, add_sub_cancel_left]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
sub_self_monotoneOn
null
protected comp_eq_of_monotoneOn {β : Type*} [LinearOrder β] (f : α → E) {t : Set β} (φ : β → α) (hφ : MonotoneOn φ t) {x y : β} (hx : x ∈ t) (hy : y ∈ t) : variationOnFromTo (f ∘ φ) t x y = variationOnFromTo f (φ '' t) (φ x) (φ y) := by rcases le_total x y with (h | h) · rw [variationOnFromTo.eq_of_le _ _ h, variationOnFromTo.eq_of_le _ _ (hφ hx hy h), eVariationOn.comp_inter_Icc_eq_of_monotoneOn f φ hφ hx hy] · rw [variationOnFromTo.eq_of_ge _ _ h, variationOnFromTo.eq_of_ge _ _ (hφ hy hx h), eVariationOn.comp_inter_Icc_eq_of_monotoneOn f φ hφ hy hx]
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
comp_eq_of_monotoneOn
null
LocallyBoundedVariationOn.exists_monotoneOn_sub_monotoneOn {f : α → ℝ} {s : Set α} (h : LocallyBoundedVariationOn f s) : ∃ p q : α → ℝ, MonotoneOn p s ∧ MonotoneOn q s ∧ f = p - q := by rcases eq_empty_or_nonempty s with (rfl | ⟨c, cs⟩) · exact ⟨f, 0, subsingleton_empty.monotoneOn _, subsingleton_empty.monotoneOn _, (sub_zero f).symm⟩ · exact ⟨_, _, variationOnFromTo.monotoneOn h cs, variationOnFromTo.sub_self_monotoneOn h cs, (sub_sub_cancel _ _).symm⟩ /-! ## Lipschitz functions and bounded variation -/
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LocallyBoundedVariationOn.exists_monotoneOn_sub_monotoneOn
If a real-valued function has bounded variation on a set, then it is a difference of monotone functions there.
LipschitzOnWith.comp_eVariationOn_le {f : E → F} {C : ℝ≥0} {t : Set E} (h : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t) : eVariationOn (f ∘ g) s ≤ C * eVariationOn g s := by apply iSup_le _ rintro ⟨n, ⟨u, hu, us⟩⟩ calc (∑ i ∈ Finset.range n, edist (f (g (u (i + 1)))) (f (g (u i)))) ≤ ∑ i ∈ Finset.range n, C * edist (g (u (i + 1))) (g (u i)) := Finset.sum_le_sum fun i _ => h (hg (us _)) (hg (us _)) _ = C * ∑ i ∈ Finset.range n, edist (g (u (i + 1))) (g (u i)) := by rw [Finset.mul_sum] _ ≤ C * eVariationOn g s := mul_le_mul_left' (eVariationOn.sum_le _ _ hu us) _
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzOnWith.comp_eVariationOn_le
null
LipschitzOnWith.comp_boundedVariationOn {f : E → F} {C : ℝ≥0} {t : Set E} (hf : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t) (h : BoundedVariationOn g s) : BoundedVariationOn (f ∘ g) s := ne_top_of_le_ne_top (by finiteness) (hf.comp_eVariationOn_le hg)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzOnWith.comp_boundedVariationOn
null
LipschitzOnWith.comp_locallyBoundedVariationOn {f : E → F} {C : ℝ≥0} {t : Set E} (hf : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t) (h : LocallyBoundedVariationOn g s) : LocallyBoundedVariationOn (f ∘ g) s := fun x y xs ys => hf.comp_boundedVariationOn (hg.mono_left inter_subset_left) (h x y xs ys)
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzOnWith.comp_locallyBoundedVariationOn
null
LipschitzWith.comp_boundedVariationOn {f : E → F} {C : ℝ≥0} (hf : LipschitzWith C f) {g : α → E} {s : Set α} (h : BoundedVariationOn g s) : BoundedVariationOn (f ∘ g) s := hf.lipschitzOnWith.comp_boundedVariationOn (mapsTo_univ _ _) h
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzWith.comp_boundedVariationOn
null
LipschitzWith.comp_locallyBoundedVariationOn {f : E → F} {C : ℝ≥0} (hf : LipschitzWith C f) {g : α → E} {s : Set α} (h : LocallyBoundedVariationOn g s) : LocallyBoundedVariationOn (f ∘ g) s := hf.lipschitzOnWith.comp_locallyBoundedVariationOn (mapsTo_univ _ _) h
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzWith.comp_locallyBoundedVariationOn
null
LipschitzOnWith.locallyBoundedVariationOn {f : ℝ → E} {C : ℝ≥0} {s : Set ℝ} (hf : LipschitzOnWith C f s) : LocallyBoundedVariationOn f s := hf.comp_locallyBoundedVariationOn (mapsTo_id _) (@monotoneOn_id ℝ _ s).locallyBoundedVariationOn
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzOnWith.locallyBoundedVariationOn
null
LipschitzWith.locallyBoundedVariationOn {f : ℝ → E} {C : ℝ≥0} (hf : LipschitzWith C f) (s : Set ℝ) : LocallyBoundedVariationOn f s := hf.lipschitzOnWith.locallyBoundedVariationOn
theorem
Topology
[ "Mathlib.Order.Interval.Set.ProjIcc", "Mathlib.Tactic.Finiteness", "Mathlib.Topology.Semicontinuous", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology" ]
Mathlib/Topology/EMetricSpace/BoundedVariation.lean
LipschitzWith.locallyBoundedVariationOn
null
uniformity_dist_of_mem_uniformity [LT β] {U : Filter (α × α)} (z : β) (D : α → α → β) (H : ∀ s, s ∈ U ↔ ∃ ε > z, ∀ {a b : α}, D a b < ε → (a, b) ∈ s) : U = ⨅ ε > z, 𝓟 { p : α × α | D p.1 p.2 < ε } := HasBasis.eq_biInf ⟨fun s => by simp only [H, subset_def, Prod.forall, mem_setOf]⟩ open scoped Uniformity Topology Filter NNReal ENNReal Pointwise
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_dist_of_mem_uniformity
Characterizing uniformities associated to a (generalized) distance function `D` in terms of the elements of the uniformity.
@[ext] EDist (α : Type*) where /-- Extended distance between two points -/ edist : α → α → ℝ≥0∞ export EDist (edist)
class
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
EDist
`EDist α` means that `α` is equipped with an extended distance.
@[reducible] uniformSpaceOfEDist (edist : α → α → ℝ≥0∞) (edist_self : ∀ x : α, edist x x = 0) (edist_comm : ∀ x y : α, edist x y = edist y x) (edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z) : UniformSpace α := .ofFun edist edist_self edist_comm edist_triangle fun ε ε0 => ⟨ε / 2, ENNReal.half_pos ε0.ne', fun _ h₁ _ h₂ => (ENNReal.add_lt_add h₁ h₂).trans_eq (ENNReal.add_halves _)⟩
def
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformSpaceOfEDist
Creating a uniform space from an extended distance.
@[reducible] noncomputable uniformSpaceOfEDistOfHasBasis [TopologicalSpace α] (edist : α → α → ℝ≥0∞) (edist_self : ∀ x : α, edist x x = 0) (edist_comm : ∀ x y : α, edist x y = edist y x) (edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z) (basis : ∀ x, (𝓝 x).HasBasis (fun c ↦ 0 < c) (fun c ↦ {y | edist x y < c})) : UniformSpace α := .ofFunOfHasBasis edist edist_self edist_comm edist_triangle (fun ε ε0 => ⟨ε / 2, ENNReal.half_pos ε0.ne', fun _ h₁ _ h₂ => (ENNReal.add_lt_add h₁ h₂).trans_eq (ENNReal.add_halves _)⟩) basis
def
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformSpaceOfEDistOfHasBasis
Creating a uniform space from an extended distance. We assume that there is a preexisting topology, for which the neighborhoods can be expressed using the distance, and we make sure that the uniform space structure we construct has a topology which is defeq to the original one.
PseudoEMetricSpace (α : Type u) : Type u extends EDist α where edist_self : ∀ x : α, edist x x = 0 edist_comm : ∀ x y : α, edist x y = edist y x edist_triangle : ∀ x y z : α, edist x z ≤ edist x y + edist y z toUniformSpace : UniformSpace α := uniformSpaceOfEDist edist edist_self edist_comm edist_triangle uniformity_edist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := by rfl attribute [instance] PseudoEMetricSpace.toUniformSpace /- Pseudoemetric spaces are less common than metric spaces. Therefore, we work in a dedicated namespace, while notions associated to metric spaces are mostly in the root namespace. -/
class
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
PseudoEMetricSpace
A pseudo extended metric space is a type endowed with a `ℝ≥0∞`-valued distance `edist` satisfying reflexivity `edist x x = 0`, commutativity `edist x y = edist y x`, and the triangle inequality `edist x z ≤ edist x y + edist y z`. Note that we do not require `edist x y = 0 → x = y`. See extended metric spaces (`EMetricSpace`) for the similar class with that stronger assumption. Any pseudo extended metric space is a topological space and a uniform space (see `TopologicalSpace`, `UniformSpace`), where the topology and uniformity come from the metric. Note that a T1 pseudo extended metric space is just an extended metric space. We make the uniformity/topology part of the data instead of deriving it from the metric. This e.g. ensures that we do not get a diamond when doing `[PseudoEMetricSpace α] [PseudoEMetricSpace β] : TopologicalSpace (α × β)`: The product metric and product topology agree, but not definitionally so. See Note [forgetful inheritance].
@[ext] protected PseudoEMetricSpace.ext {α : Type*} {m m' : PseudoEMetricSpace α} (h : m.toEDist = m'.toEDist) : m = m' := by obtain ⟨_, _, _, U, hU⟩ := m; rename EDist α => ed obtain ⟨_, _, _, U', hU'⟩ := m'; rename EDist α => ed' congr 1 exact UniformSpace.ext (((show ed = ed' from h) ▸ hU).trans hU'.symm) variable [PseudoEMetricSpace α] export PseudoEMetricSpace (edist_self edist_comm edist_triangle) attribute [simp] edist_self
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
PseudoEMetricSpace.ext
Two pseudo emetric space structures with the same edistance function coincide.
edist_triangle_left (x y z : α) : edist x y ≤ edist z x + edist z y := by rw [edist_comm z]; apply edist_triangle
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_triangle_left
Triangle inequality for the extended distance
edist_triangle_right (x y z : α) : edist x y ≤ edist x z + edist y z := by rw [edist_comm y]; apply edist_triangle
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_triangle_right
null
edist_congr_right {x y z : α} (h : edist x y = 0) : edist x z = edist y z := by apply le_antisymm · rw [← zero_add (edist y z), ← h] apply edist_triangle · rw [edist_comm] at h rw [← zero_add (edist x z), ← h] apply edist_triangle
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_congr_right
null
edist_congr_left {x y z : α} (h : edist x y = 0) : edist z x = edist z y := by rw [edist_comm z x, edist_comm z y] apply edist_congr_right h
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_congr_left
null
edist_congr {w x y z : α} (hl : edist w x = 0) (hr : edist y z = 0) : edist w y = edist x z := (edist_congr_right hl).trans (edist_congr_left hr)
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_congr
null
edist_triangle4 (x y z t : α) : edist x t ≤ edist x y + edist y z + edist z t := calc edist x t ≤ edist x z + edist z t := edist_triangle x z t _ ≤ edist x y + edist y z + edist z t := add_le_add_right (edist_triangle x y z) _
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_triangle4
null
uniformity_pseudoedist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε } := PseudoEMetricSpace.uniformity_edist
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_pseudoedist
Reformulation of the uniform structure in terms of the extended distance
uniformSpace_edist : ‹PseudoEMetricSpace α›.toUniformSpace = uniformSpaceOfEDist edist edist_self edist_comm edist_triangle := UniformSpace.ext uniformity_pseudoedist
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformSpace_edist
null
uniformity_basis_edist : (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε } := (@uniformSpace_edist α _).symm ▸ UniformSpace.hasBasis_ofFun ⟨1, one_pos⟩ _ _ _ _ _
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist
null
mem_uniformity_edist {s : Set (α × α)} : s ∈ 𝓤 α ↔ ∃ ε > 0, ∀ {a b : α}, edist a b < ε → (a, b) ∈ s := uniformity_basis_edist.mem_uniformity_iff
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
mem_uniformity_edist
Characterization of the elements of the uniformity in terms of the extended distance
protected EMetric.mk_uniformity_basis {β : Type*} {p : β → Prop} {f : β → ℝ≥0∞} (hf₀ : ∀ x, p x → 0 < f x) (hf : ∀ ε, 0 < ε → ∃ x, p x ∧ f x ≤ ε) : (𝓤 α).HasBasis p fun x => { p : α × α | edist p.1 p.2 < f x } := by refine ⟨fun s => uniformity_basis_edist.mem_iff.trans ?_⟩ constructor · rintro ⟨ε, ε₀, hε⟩ rcases hf ε ε₀ with ⟨i, hi, H⟩ exact ⟨i, hi, fun x hx => hε <| lt_of_lt_of_le hx.out H⟩ · exact fun ⟨i, hi, H⟩ => ⟨f i, hf₀ i hi, H⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
EMetric.mk_uniformity_basis
Given `f : β → ℝ≥0∞`, if `f` sends `{i | p i}` to a set of positive numbers accumulating to zero, then `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`. For specific bases see `uniformity_basis_edist`, `uniformity_basis_edist'`, `uniformity_basis_edist_nnreal`, and `uniformity_basis_edist_inv_nat`.
protected EMetric.mk_uniformity_basis_le {β : Type*} {p : β → Prop} {f : β → ℝ≥0∞} (hf₀ : ∀ x, p x → 0 < f x) (hf : ∀ ε, 0 < ε → ∃ x, p x ∧ f x ≤ ε) : (𝓤 α).HasBasis p fun x => { p : α × α | edist p.1 p.2 ≤ f x } := by refine ⟨fun s => uniformity_basis_edist.mem_iff.trans ?_⟩ constructor · rintro ⟨ε, ε₀, hε⟩ rcases exists_between ε₀ with ⟨ε', hε'⟩ rcases hf ε' hε'.1 with ⟨i, hi, H⟩ exact ⟨i, hi, fun x hx => hε <| lt_of_le_of_lt (le_trans hx.out H) hε'.2⟩ · exact fun ⟨i, hi, H⟩ => ⟨f i, hf₀ i hi, fun x hx => H (le_of_lt hx.out)⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
EMetric.mk_uniformity_basis_le
Given `f : β → ℝ≥0∞`, if `f` sends `{i | p i}` to a set of positive numbers accumulating to zero, then closed `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`. For specific bases see `uniformity_basis_edist_le` and `uniformity_basis_edist_le'`.
uniformity_basis_edist_le : (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε } := EMetric.mk_uniformity_basis_le (fun _ => id) fun ε ε₀ => ⟨ε, ε₀, le_refl ε⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_le
null
uniformity_basis_edist' (ε' : ℝ≥0∞) (hε' : 0 < ε') : (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 < ε } := EMetric.mk_uniformity_basis (fun _ => And.left) fun ε ε₀ => let ⟨δ, hδ⟩ := exists_between hε' ⟨min ε δ, ⟨lt_min ε₀ hδ.1, lt_of_le_of_lt (min_le_right _ _) hδ.2⟩, min_le_left _ _⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist'
null
uniformity_basis_edist_le' (ε' : ℝ≥0∞) (hε' : 0 < ε') : (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => ε ∈ Ioo 0 ε') fun ε => { p : α × α | edist p.1 p.2 ≤ ε } := EMetric.mk_uniformity_basis_le (fun _ => And.left) fun ε ε₀ => let ⟨δ, hδ⟩ := exists_between hε' ⟨min ε δ, ⟨lt_min ε₀ hδ.1, lt_of_le_of_lt (min_le_right _ _) hδ.2⟩, min_le_left _ _⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_le'
null
uniformity_basis_edist_nnreal : (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε } := EMetric.mk_uniformity_basis (fun _ => ENNReal.coe_pos.2) fun _ε ε₀ => let ⟨δ, hδ⟩ := ENNReal.lt_iff_exists_nnreal_btwn.1 ε₀ ⟨δ, ENNReal.coe_pos.1 hδ.1, le_of_lt hδ.2⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_nnreal
null
uniformity_basis_edist_nnreal_le : (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 ≤ ε } := EMetric.mk_uniformity_basis_le (fun _ => ENNReal.coe_pos.2) fun _ε ε₀ => let ⟨δ, hδ⟩ := ENNReal.lt_iff_exists_nnreal_btwn.1 ε₀ ⟨δ, ENNReal.coe_pos.1 hδ.1, le_of_lt hδ.2⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_nnreal_le
null
uniformity_basis_edist_inv_nat : (𝓤 α).HasBasis (fun _ => True) fun n : ℕ => { p : α × α | edist p.1 p.2 < (↑n)⁻¹ } := EMetric.mk_uniformity_basis (fun n _ ↦ ENNReal.inv_pos.2 <| ENNReal.natCast_ne_top n) fun _ε ε₀ ↦ let ⟨n, hn⟩ := ENNReal.exists_inv_nat_lt (ne_of_gt ε₀) ⟨n, trivial, le_of_lt hn⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_inv_nat
null
uniformity_basis_edist_inv_two_pow : (𝓤 α).HasBasis (fun _ => True) fun n : ℕ => { p : α × α | edist p.1 p.2 < 2⁻¹ ^ n } := EMetric.mk_uniformity_basis (fun _ _ ↦ ENNReal.pow_pos (ENNReal.inv_pos.2 ENNReal.ofNat_ne_top) _) fun _ε ε₀ ↦ let ⟨n, hn⟩ := ENNReal.exists_inv_two_pow_lt (ne_of_gt ε₀) ⟨n, trivial, le_of_lt hn⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformity_basis_edist_inv_two_pow
null
edist_mem_uniformity {ε : ℝ≥0∞} (ε0 : 0 < ε) : { p : α × α | edist p.1 p.2 < ε } ∈ 𝓤 α := mem_uniformity_edist.2 ⟨ε, ε0, id⟩
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
edist_mem_uniformity
Fixed size neighborhoods of the diagonal belong to the uniform structure
uniformContinuousOn_iff [PseudoEMetricSpace β] {f : α → β} {s : Set α} : UniformContinuousOn f s ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a}, a ∈ s → ∀ {b}, b ∈ s → edist a b < δ → edist (f a) (f b) < ε := uniformity_basis_edist.uniformContinuousOn_iff uniformity_basis_edist
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformContinuousOn_iff
ε-δ characterization of uniform continuity on a set for pseudoemetric spaces
uniformContinuous_iff [PseudoEMetricSpace β] {f : α → β} : UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε := uniformity_basis_edist.uniformContinuous_iff uniformity_basis_edist
theorem
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
uniformContinuous_iff
ε-δ characterization of uniform continuity on pseudoemetric spaces
PseudoEMetricSpace.replaceUniformity {α} [U : UniformSpace α] (m : PseudoEMetricSpace α) (H : 𝓤[U] = 𝓤[PseudoEMetricSpace.toUniformSpace]) : PseudoEMetricSpace α where edist := @edist _ m.toEDist edist_self := edist_self edist_comm := edist_comm edist_triangle := edist_triangle toUniformSpace := U uniformity_edist := H.trans (@PseudoEMetricSpace.uniformity_edist α _)
abbrev
Topology
[ "Mathlib.Data.ENNReal.Inv", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.OfFun" ]
Mathlib/Topology/EMetricSpace/Defs.lean
PseudoEMetricSpace.replaceUniformity
Auxiliary function to replace the uniformity on a pseudoemetric space with a uniformity which is equal to the original one, but maybe not defeq. This is useful if one wants to construct a pseudoemetric space with a specified uniformity. See Note [forgetful inheritance] explaining why having definitionally the right uniformity is often important. See note [reducible non-instances].