File: Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean

full_name: MeasureTheory.OuterMeasure.ofFunction
code: /-- Given any function `m` assigning measures to sets satisying `m ∅ = 0`, there is
  a unique maximal outer measure `μ` satisfying `μ s ≤ m s` for all `s : Set α`. -/
protected def ofFunction : OuterMeasure α 
goal: MeasureTheory.OuterMeasure α

full_name: MeasureTheory.OuterMeasure.ofFunction_apply
code: theorem ofFunction_apply (s : Set α) :
    OuterMeasure.ofFunction m m_empty s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, m (t n) 
goal: (MeasureTheory.OuterMeasure.ofFunction m m_empty) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), m (t n)

full_name: MeasureTheory.OuterMeasure.ofFunction_le
code: theorem ofFunction_le (s : Set α) : OuterMeasure.ofFunction m m_empty s ≤ m s 
goal: (MeasureTheory.OuterMeasure.ofFunction m m_empty) s ≤ m s

full_name: MeasureTheory.OuterMeasure.ofFunction_eq
code: theorem ofFunction_eq (s : Set α) (m_mono : ∀ ⦃t : Set α⦄, s ⊆ t → m s ≤ m t)
    (m_subadd : ∀ s : ℕ → Set α, m (⋃ i, s i) ≤ ∑' i, m (s i)) :
    OuterMeasure.ofFunction m m_empty s = m s 
goal: (MeasureTheory.OuterMeasure.ofFunction m m_empty) s = m s

full_name: MeasureTheory.OuterMeasure.le_ofFunction
code: theorem le_ofFunction {μ : OuterMeasure α} :
    μ ≤ OuterMeasure.ofFunction m m_empty ↔ ∀ s, μ s ≤ m s 
goal: μ ≤ MeasureTheory.OuterMeasure.ofFunction m m_empty ↔ ∀ (s : Set α), μ s ≤ m s

full_name: MeasureTheory.OuterMeasure.isGreatest_ofFunction
code: theorem isGreatest_ofFunction :
    IsGreatest { μ : OuterMeasure α | ∀ s, μ s ≤ m s } (OuterMeasure.ofFunction m m_empty) 
goal: IsGreatest {μ | ∀ (s : Set α), μ s ≤ m s} (MeasureTheory.OuterMeasure.ofFunction m m_empty)

full_name: MeasureTheory.OuterMeasure.ofFunction_eq_sSup
code: theorem ofFunction_eq_sSup : OuterMeasure.ofFunction m m_empty = sSup { μ | ∀ s, μ s ≤ m s } 
goal: MeasureTheory.OuterMeasure.ofFunction m m_empty = sSup {μ | ∀ (s : Set α), μ s ≤ m s}

full_name: MeasureTheory.OuterMeasure.ofFunction_union_of_top_of_nonempty_inter
code: /-- If `m u = ∞` for any set `u` that has nonempty intersection both with `s` and `t`, then
`μ (s ∪ t) = μ s + μ t`, where `μ = MeasureTheory.OuterMeasure.ofFunction m m_empty`.

E.g., if `α` is an (e)metric space and `m u = ∞` on any set of diameter `≥ r`, then this lemma
implies that `μ (s ∪ t) = μ s + μ t` on any two sets such that `r ≤ edist x y` for all `x ∈ s`
and `y ∈ t`.  -/
theorem ofFunction_union_of_top_of_nonempty_inter {s t : Set α}
    (h : ∀ u, (s ∩ u).Nonempty → (t ∩ u).Nonempty → m u = ∞) :
    OuterMeasure.ofFunction m m_empty (s ∪ t) =
      OuterMeasure.ofFunction m m_empty s + OuterMeasure.ofFunction m m_empty t 
goal: (MeasureTheory.OuterMeasure.ofFunction m m_empty) (s ∪ t) =
  (MeasureTheory.OuterMeasure.ofFunction m m_empty) s + (MeasureTheory.OuterMeasure.ofFunction m m_empty) t

full_name: MeasureTheory.OuterMeasure.comap_ofFunction
code: theorem comap_ofFunction {β} (f : β → α) (h : Monotone m ∨ Surjective f) :
    comap f (OuterMeasure.ofFunction m m_empty) =
      OuterMeasure.ofFunction (fun s => m (f '' s)) (by simp; simp [m_empty]) 
goal: (MeasureTheory.OuterMeasure.comap f) (MeasureTheory.OuterMeasure.ofFunction m m_empty) =
  MeasureTheory.OuterMeasure.ofFunction (fun s => m (f '' s)) ⋯

full_name: MeasureTheory.OuterMeasure.map_ofFunction_le
code: theorem map_ofFunction_le {β} (f : α → β) :
    map f (OuterMeasure.ofFunction m m_empty) ≤
      OuterMeasure.ofFunction (fun s => m (f ⁻¹' s)) m_empty 
goal: (MeasureTheory.OuterMeasure.map f) (MeasureTheory.OuterMeasure.ofFunction m m_empty) ≤
  MeasureTheory.OuterMeasure.ofFunction (fun s => m (f ⁻¹' s)) m_empty

full_name: MeasureTheory.OuterMeasure.map_ofFunction
code: theorem map_ofFunction {β} {f : α → β} (hf : Injective f) :
    map f (OuterMeasure.ofFunction m m_empty) =
      OuterMeasure.ofFunction (fun s => m (f ⁻¹' s)) m_empty 
goal: (MeasureTheory.OuterMeasure.map f) (MeasureTheory.OuterMeasure.ofFunction m m_empty) =
  MeasureTheory.OuterMeasure.ofFunction (fun s => m (f ⁻¹' s)) m_empty

full_name: MeasureTheory.OuterMeasure.restrict_ofFunction
code: theorem restrict_ofFunction (s : Set α) (hm : Monotone m) :
    restrict s (OuterMeasure.ofFunction m m_empty) =
      OuterMeasure.ofFunction (fun t => m (t ∩ s)) (by simp; simp [m_empty]) 
goal: (MeasureTheory.OuterMeasure.restrict s) (MeasureTheory.OuterMeasure.ofFunction m m_empty) =
  MeasureTheory.OuterMeasure.ofFunction (fun t => m (t ∩ s)) ⋯

full_name: MeasureTheory.OuterMeasure.smul_ofFunction
code: theorem smul_ofFunction {c : ℝ≥0∞} (hc : c ≠ ∞) : c • OuterMeasure.ofFunction m m_empty =
    OuterMeasure.ofFunction (c • m) (by simp [m_empty]) 
goal: c • MeasureTheory.OuterMeasure.ofFunction m m_empty = MeasureTheory.OuterMeasure.ofFunction (c • m) ⋯

full_name: MeasureTheory.OuterMeasure.boundedBy
code: /-- Given any function `m` assigning measures to sets, there is a unique maximal outer measure `μ`
  satisfying `μ s ≤ m s` for all `s : Set α`. This is the same as `OuterMeasure.ofFunction`,
  except that it doesn't require `m ∅ = 0`. -/
def boundedBy : OuterMeasure α 
goal: MeasureTheory.OuterMeasure α

full_name: MeasureTheory.OuterMeasure.boundedBy_le
code: theorem boundedBy_le (s : Set α) : boundedBy m s ≤ m s 
goal: (MeasureTheory.OuterMeasure.boundedBy m) s ≤ m s

full_name: MeasureTheory.OuterMeasure.boundedBy_eq_ofFunction
code: theorem boundedBy_eq_ofFunction (m_empty : m ∅ = 0) (s : Set α) :
    boundedBy m s = OuterMeasure.ofFunction m m_empty s 
goal: (MeasureTheory.OuterMeasure.boundedBy m) s = (MeasureTheory.OuterMeasure.ofFunction m m_empty) s

full_name: MeasureTheory.OuterMeasure.boundedBy_apply
code: theorem boundedBy_apply (s : Set α) :
    boundedBy m s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t),
                      ∑' n, ⨆ _ : (t n).Nonempty, m (t n) 
goal: (MeasureTheory.OuterMeasure.boundedBy m) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨆ (_ : (t n).Nonempty), m (t n)

full_name: MeasureTheory.OuterMeasure.boundedBy_eq
code: theorem boundedBy_eq (s : Set α) (m_empty : m ∅ = 0) (m_mono : ∀ ⦃t : Set α⦄, s ⊆ t → m s ≤ m t)
    (m_subadd : ∀ s : ℕ → Set α, m (⋃ i, s i) ≤ ∑' i, m (s i)) : boundedBy m s = m s 
goal: (MeasureTheory.OuterMeasure.boundedBy m) s = m s

full_name: MeasureTheory.OuterMeasure.boundedBy_eq_self
code: @[simp]
theorem boundedBy_eq_self (m : OuterMeasure α) : boundedBy m = m 
goal: MeasureTheory.OuterMeasure.boundedBy ⇑m = m

full_name: MeasureTheory.OuterMeasure.le_boundedBy
code: theorem le_boundedBy {μ : OuterMeasure α} : μ ≤ boundedBy m ↔ ∀ s, μ s ≤ m s 
goal: μ ≤ MeasureTheory.OuterMeasure.boundedBy m ↔ ∀ (s : Set α), μ s ≤ m s

full_name: MeasureTheory.OuterMeasure.le_boundedBy'
code: theorem le_boundedBy' {μ : OuterMeasure α} :
    μ ≤ boundedBy m ↔ ∀ s : Set α, s.Nonempty → μ s ≤ m s 
goal: μ ≤ MeasureTheory.OuterMeasure.boundedBy m ↔ ∀ (s : Set α), s.Nonempty → μ s ≤ m s

full_name: MeasureTheory.OuterMeasure.boundedBy_top
code: @[simp]
theorem boundedBy_top : boundedBy (⊤ : Set α → ℝ≥0∞) = ⊤ 
goal: MeasureTheory.OuterMeasure.boundedBy ⊤ = ⊤

full_name: MeasureTheory.OuterMeasure.boundedBy_zero
code: @[simp]
theorem boundedBy_zero : boundedBy (0 : Set α → ℝ≥0∞) = 0 
goal: MeasureTheory.OuterMeasure.boundedBy 0 = 0

full_name: MeasureTheory.OuterMeasure.smul_boundedBy
code: theorem smul_boundedBy {c : ℝ≥0∞} (hc : c ≠ ∞) : c • boundedBy m = boundedBy (c • m) 
goal: c • MeasureTheory.OuterMeasure.boundedBy m = MeasureTheory.OuterMeasure.boundedBy (c • m)

full_name: MeasureTheory.OuterMeasure.comap_boundedBy
code: theorem comap_boundedBy {β} (f : β → α)
    (h : (Monotone fun s : { s : Set α // s.Nonempty } => m s) ∨ Surjective f) :
    comap f (boundedBy m) = boundedBy fun s => m (f '' s) 
goal: (MeasureTheory.OuterMeasure.comap f) (MeasureTheory.OuterMeasure.boundedBy m) =
  MeasureTheory.OuterMeasure.boundedBy fun s => m (f '' s)

full_name: MeasureTheory.OuterMeasure.boundedBy_union_of_top_of_nonempty_inter
code: /-- If `m u = ∞` for any set `u` that has nonempty intersection both with `s` and `t`, then
`μ (s ∪ t) = μ s + μ t`, where `μ = MeasureTheory.OuterMeasure.boundedBy m`.

E.g., if `α` is an (e)metric space and `m u = ∞` on any set of diameter `≥ r`, then this lemma
implies that `μ (s ∪ t) = μ s + μ t` on any two sets such that `r ≤ edist x y` for all `x ∈ s`
and `y ∈ t`.  -/
theorem boundedBy_union_of_top_of_nonempty_inter {s t : Set α}
    (h : ∀ u, (s ∩ u).Nonempty → (t ∩ u).Nonempty → m u = ∞) :
    boundedBy m (s ∪ t) = boundedBy m s + boundedBy m t 
goal: (MeasureTheory.OuterMeasure.boundedBy m) (s ∪ t) =
  (MeasureTheory.OuterMeasure.boundedBy m) s + (MeasureTheory.OuterMeasure.boundedBy m) t

full_name: MeasureTheory.OuterMeasure.sInfGen
code: /-- Given a set of outer measures, we define a new function that on a set `s` is defined to be the
  infimum of `μ(s)` for the outer measures `μ` in the collection. We ensure that this
  function is defined to be `0` on `∅`, even if the collection of outer measures is empty.
  The outer measure generated by this function is the infimum of the given outer measures. -/
def sInfGen (m : Set (OuterMeasure α)) (s : Set α) : ℝ≥0∞ 
goal: ℝ≥0∞

full_name: MeasureTheory.OuterMeasure.sInfGen_def
code: theorem sInfGen_def (m : Set (OuterMeasure α)) (t : Set α) :
    sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t 
goal: MeasureTheory.OuterMeasure.sInfGen m t = ⨅ μ ∈ m, μ t

full_name: MeasureTheory.OuterMeasure.sInf_eq_boundedBy_sInfGen
code: theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m) 
goal: sInf m = MeasureTheory.OuterMeasure.boundedBy (MeasureTheory.OuterMeasure.sInfGen m)

full_name: MeasureTheory.OuterMeasure.iSup_sInfGen_nonempty
code: theorem iSup_sInfGen_nonempty {m : Set (OuterMeasure α)} (h : m.Nonempty) (t : Set α) :
    ⨆ _ : t.Nonempty, sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t 
goal: ⨆ (_ : t.Nonempty), MeasureTheory.OuterMeasure.sInfGen m t = ⨅ μ ∈ m, μ t

full_name: MeasureTheory.OuterMeasure.sInf_apply
code: /-- The value of the Infimum of a nonempty set of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem sInf_apply {m : Set (OuterMeasure α)} {s : Set α} (h : m.Nonempty) :
    sInf m s =
      ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ (t n) 
goal: (sInf m) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ μ ∈ m, μ (t n)

full_name: MeasureTheory.OuterMeasure.sInf_apply'
code: /-- The value of the Infimum of a set of outer measures on a nonempty set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem sInf_apply' {m : Set (OuterMeasure α)} {s : Set α} (h : s.Nonempty) :
    sInf m s =
      ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ (t n) 
goal: (sInf m) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ μ ∈ m, μ (t n)

full_name: MeasureTheory.OuterMeasure.iInf_apply
code: /-- The value of the Infimum of a nonempty family of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem iInf_apply {ι} [Nonempty ι] (m : ι → OuterMeasure α) (s : Set α) :
    (⨅ i, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i, m i (t n) 
goal: (⨅ i, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i, (m i) (t n)

full_name: MeasureTheory.OuterMeasure.iInf_apply'
code: /-- The value of the Infimum of a family of outer measures on a nonempty set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem iInf_apply' {ι} (m : ι → OuterMeasure α) {s : Set α} (hs : s.Nonempty) :
    (⨅ i, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i, m i (t n) 
goal: (⨅ i, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i, (m i) (t n)

full_name: MeasureTheory.OuterMeasure.biInf_apply
code: /-- The value of the Infimum of a nonempty family of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem biInf_apply {ι} {I : Set ι} (hI : I.Nonempty) (m : ι → OuterMeasure α) (s : Set α) :
    (⨅ i ∈ I, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i ∈ I, m i (t n) 
goal: (⨅ i ∈ I, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i ∈ I, (m i) (t n)

full_name: MeasureTheory.OuterMeasure.biInf_apply'
code: /-- The value of the Infimum of a nonempty family of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem biInf_apply' {ι} (I : Set ι) (m : ι → OuterMeasure α) {s : Set α} (hs : s.Nonempty) :
    (⨅ i ∈ I, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i ∈ I, m i (t n) 
goal: (⨅ i ∈ I, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i ∈ I, (m i) (t n)

full_name: MeasureTheory.OuterMeasure.map_iInf_le
code: theorem map_iInf_le {ι β} (f : α → β) (m : ι → OuterMeasure α) :
    map f (⨅ i, m i) ≤ ⨅ i, map f (m i) 
goal: (MeasureTheory.OuterMeasure.map f) (⨅ i, m i) ≤ ⨅ i, (MeasureTheory.OuterMeasure.map f) (m i)

full_name: MeasureTheory.OuterMeasure.comap_iInf
code: theorem comap_iInf {ι β} (f : α → β) (m : ι → OuterMeasure β) :
    comap f (⨅ i, m i) = ⨅ i, comap f (m i) 
goal: (MeasureTheory.OuterMeasure.comap f) (⨅ i, m i) = ⨅ i, (MeasureTheory.OuterMeasure.comap f) (m i)

full_name: MeasureTheory.OuterMeasure.map_iInf
code: theorem map_iInf {ι β} {f : α → β} (hf : Injective f) (m : ι → OuterMeasure α) :
    map f (⨅ i, m i) = restrict (range f) (⨅ i, map f (m i)) 
goal: (MeasureTheory.OuterMeasure.map f) (⨅ i, m i) =
  (MeasureTheory.OuterMeasure.restrict (Set.range f)) (⨅ i, (MeasureTheory.OuterMeasure.map f) (m i))

full_name: MeasureTheory.OuterMeasure.map_iInf_comap
code: theorem map_iInf_comap {ι β} [Nonempty ι] {f : α → β} (m : ι → OuterMeasure β) :
    map f (⨅ i, comap f (m i)) = ⨅ i, map f (comap f (m i)) 
goal: (MeasureTheory.OuterMeasure.map f) (⨅ i, (MeasureTheory.OuterMeasure.comap f) (m i)) =
  ⨅ i, (MeasureTheory.OuterMeasure.map f) ((MeasureTheory.OuterMeasure.comap f) (m i))

full_name: MeasureTheory.OuterMeasure.map_biInf_comap
code: theorem map_biInf_comap {ι β} {I : Set ι} (hI : I.Nonempty) {f : α → β} (m : ι → OuterMeasure β) :
    map f (⨅ i ∈ I, comap f (m i)) = ⨅ i ∈ I, map f (comap f (m i)) 
goal: (MeasureTheory.OuterMeasure.map f) (⨅ i ∈ I, (MeasureTheory.OuterMeasure.comap f) (m i)) =
  ⨅ i ∈ I, (MeasureTheory.OuterMeasure.map f) ((MeasureTheory.OuterMeasure.comap f) (m i))

full_name: MeasureTheory.OuterMeasure.restrict_iInf_restrict
code: theorem restrict_iInf_restrict {ι} (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i, restrict s (m i)) = restrict s (⨅ i, m i) 
goal: (MeasureTheory.OuterMeasure.restrict s) (⨅ i, (MeasureTheory.OuterMeasure.restrict s) (m i)) =
  (MeasureTheory.OuterMeasure.restrict s) (⨅ i, m i)

full_name: MeasureTheory.OuterMeasure.restrict_iInf
code: theorem restrict_iInf {ι} [Nonempty ι] (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i, m i) = ⨅ i, restrict s (m i) 
goal: (MeasureTheory.OuterMeasure.restrict s) (⨅ i, m i) = ⨅ i, (MeasureTheory.OuterMeasure.restrict s) (m i)

full_name: MeasureTheory.OuterMeasure.restrict_biInf
code: theorem restrict_biInf {ι} {I : Set ι} (hI : I.Nonempty) (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i ∈ I, m i) = ⨅ i ∈ I, restrict s (m i) 
goal: (MeasureTheory.OuterMeasure.restrict s) (⨅ i ∈ I, m i) = ⨅ i ∈ I, (MeasureTheory.OuterMeasure.restrict s) (m i)

full_name: MeasureTheory.OuterMeasure.restrict_sInf_eq_sInf_restrict
code: /-- This proves that Inf and restrict commute for outer measures, so long as the set of
outer measures is nonempty. -/
theorem restrict_sInf_eq_sInf_restrict (m : Set (OuterMeasure α)) {s : Set α} (hm : m.Nonempty) :
    restrict s (sInf m) = sInf (restrict s '' m) 
goal: (MeasureTheory.OuterMeasure.restrict s) (sInf m) = sInf (⇑(MeasureTheory.OuterMeasure.restrict s) '' m)