File: Mathlib/MeasureTheory/Measure/Regular.lean

full_name: MeasureTheory.Measure.InnerRegularWRT
code: /-- We say that a measure `μ` is *inner regular* with respect to predicates `p q : Set α → Prop`,
if for every `U` such that `q U` and `r < μ U`, there exists a subset `K ⊆ U` satisfying `p K`
of measure greater than `r`.

This definition is used to prove some facts about regular and weakly regular measures without
repeating the proofs. -/
def InnerRegularWRT {α} {_ : MeasurableSpace α} (μ : Measure α) (p q : Set α → Prop) 
goal: {x : MeasurableSpace α} → MeasureTheory.Measure α → (Set α → Prop) → (Set α → Prop) → Prop

full_name: MeasureTheory.Measure.InnerRegularWRT.measure_eq_iSup
code: theorem measure_eq_iSup (H : InnerRegularWRT μ p q) (hU : q U) :
    μ U = ⨆ (K) (_ : K ⊆ U) (_ : p K), μ K 
goal: μ U = ⨆ K, ⨆ (_ : K ⊆ U), ⨆ (_ : p K), μ K

full_name: MeasureTheory.Measure.InnerRegularWRT.exists_subset_lt_add
code: theorem exists_subset_lt_add (H : InnerRegularWRT μ p q) (h0 : p ∅) (hU : q U) (hμU : μ U ≠ ∞)
    (hε : ε ≠ 0) : ∃ K, K ⊆ U ∧ p K ∧ μ U < μ K + ε 
goal: ∃ K ⊆ U, p K ∧ μ U < μ K + ε

full_name: MeasureTheory.Measure.InnerRegularWRT.map
code: protected theorem map {α β} [MeasurableSpace α] [MeasurableSpace β]
    {μ : Measure α} {pa qa : Set α → Prop}
    (H : InnerRegularWRT μ pa qa) {f : α → β} (hf : AEMeasurable f μ) {pb qb : Set β → Prop}
    (hAB : ∀ U, qb U → qa (f ⁻¹' U)) (hAB' : ∀ K, pa K → pb (f '' K))
    (hB₂ : ∀ U, qb U → MeasurableSet U) :
    InnerRegularWRT (map f μ) pb qb 
goal: (MeasureTheory.Measure.map f μ).InnerRegularWRT pb qb

full_name: MeasureTheory.Measure.InnerRegularWRT.map'
code: theorem map' {α β} [MeasurableSpace α] [MeasurableSpace β] {μ : Measure α} {pa qa : Set α → Prop}
    (H : InnerRegularWRT μ pa qa) (f : α ≃ᵐ β) {pb qb : Set β → Prop}
    (hAB : ∀ U, qb U → qa (f ⁻¹' U)) (hAB' : ∀ K, pa K → pb (f '' K)) :
    InnerRegularWRT (map f μ) pb qb 
goal: (MeasureTheory.Measure.map (⇑f) μ).InnerRegularWRT pb qb

full_name: MeasureTheory.Measure.InnerRegularWRT.smul
code: theorem smul (H : InnerRegularWRT μ p q) (c : ℝ≥0∞) : InnerRegularWRT (c • μ) p q 
goal: (c • μ).InnerRegularWRT p q

full_name: MeasureTheory.Measure.InnerRegularWRT.trans
code: theorem trans {q' : Set α → Prop} (H : InnerRegularWRT μ p q) (H' : InnerRegularWRT μ q q') :
    InnerRegularWRT μ p q' 
goal: μ.InnerRegularWRT p q'

full_name: MeasureTheory.Measure.InnerRegularWRT.rfl
code: theorem rfl {p : Set α → Prop} : InnerRegularWRT μ p p 
goal: μ.InnerRegularWRT p p

full_name: MeasureTheory.Measure.InnerRegularWRT.of_imp
code: theorem of_imp (h : ∀ s, q s → p s) : InnerRegularWRT μ p q 
goal: μ.InnerRegularWRT p q

full_name: MeasureTheory.Measure.InnerRegularWRT.mono
code: theorem mono {p' q' : Set α → Prop} (H : InnerRegularWRT μ p q)
    (h : ∀ s, q' s → q s) (h' : ∀ s, p s → p' s) : InnerRegularWRT μ p' q' 
goal: μ.InnerRegularWRT p' q'

full_name: MeasureTheory.Measure.OuterRegular
code: /-- A measure `μ` is outer regular if `μ(A) = inf {μ(U) | A ⊆ U open}` for a measurable set `A`.

This definition implies the same equality for any (not necessarily measurable) set, see
`Set.measure_eq_iInf_isOpen`. -/
class OuterRegular (μ : Measure α) : Prop where
  protected outerRegular :
    ∀ ⦃A : Set α⦄, MeasurableSet A → ∀ r > μ A, ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r
goal: Prop

full_name: MeasureTheory.Measure.OuterRegular.outerRegular
code: /-- A measure `μ` is outer regular if `μ(A) = inf {μ(U) | A ⊆ U open}` for a measurable set `A`.

This definition implies the same equality for any (not necessarily measurable) set, see
`Set.measure_eq_iInf_isOpen`. -/
class OuterRegular (μ : Measure α) : Prop where
  protected outerRegular :
    ∀ ⦃A : Set α⦄, MeasurableSet A → ∀ r > μ A, ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r
goal: MeasurableSet A → ∀ r > μ A, ∃ U ⊇ A, IsOpen U ∧ μ U < r

full_name: MeasureTheory.Measure.Regular
code: /-- A measure `μ` is regular if
  - it is finite on all compact sets;
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using compact sets:
    `μ(U) = sup {μ(K) | K ⊆ U compact}` for `U` open. -/
class Regular (μ : Measure α) extends IsFiniteMeasureOnCompacts μ, OuterRegular μ : Prop where
  innerRegular : InnerRegularWRT μ IsCompact IsOpen
goal: Prop

full_name: MeasureTheory.Measure.Regular.innerRegular
code: /-- A measure `μ` is regular if
  - it is finite on all compact sets;
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using compact sets:
    `μ(U) = sup {μ(K) | K ⊆ U compact}` for `U` open. -/
class Regular (μ : Measure α) extends IsFiniteMeasureOnCompacts μ, OuterRegular μ : Prop where
  innerRegular : InnerRegularWRT μ IsCompact IsOpen
goal: μ.InnerRegularWRT IsCompact IsOpen

full_name: MeasureTheory.Measure.WeaklyRegular
code: /-- A measure `μ` is weakly regular if
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using closed sets:
    `μ(U) = sup {μ(F) | F ⊆ U closed}` for `U` open. -/
class WeaklyRegular (μ : Measure α) extends OuterRegular μ : Prop where
  protected innerRegular : InnerRegularWRT μ IsClosed IsOpen
goal: Prop

full_name: MeasureTheory.Measure.WeaklyRegular.innerRegular
code: /-- A measure `μ` is weakly regular if
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using closed sets:
    `μ(U) = sup {μ(F) | F ⊆ U closed}` for `U` open. -/
class WeaklyRegular (μ : Measure α) extends OuterRegular μ : Prop where
  protected innerRegular : InnerRegularWRT μ IsClosed IsOpen
goal: μ.InnerRegularWRT IsClosed IsOpen

full_name: MeasureTheory.Measure.InnerRegular
code: /-- A measure `μ` is inner regular if, for any measurable set `s`, then
`μ(s) = sup {μ(K) | K ⊆ s compact}`. -/
class InnerRegular (μ : Measure α) : Prop where
  protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s)
goal: Prop

full_name: MeasureTheory.Measure.InnerRegular.innerRegular
code: /-- A measure `μ` is inner regular if, for any measurable set `s`, then
`μ(s) = sup {μ(K) | K ⊆ s compact}`. -/
class InnerRegular (μ : Measure α) : Prop where
  protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s)
goal: μ.InnerRegularWRT IsCompact fun s => MeasurableSet s

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.innerRegular
code: /-- A measure `μ` is inner regular for finite measure sets with respect to compact sets:
for any measurable set `s` with finite measure, then `μ(s) = sup {μ(K) | K ⊆ s compact}`.
The main interest of this class is that it is satisfied for both natural Haar measures (the
regular one and the inner regular one). -/
class InnerRegularCompactLTTop (μ : Measure α) : Prop where
  protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)
goal: μ.InnerRegularWRT IsCompact fun s => MeasurableSet s ∧ μ s ≠ ⊤

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop
code: /-- A measure `μ` is inner regular for finite measure sets with respect to compact sets:
for any measurable set `s` with finite measure, then `μ(s) = sup {μ(K) | K ⊆ s compact}`.
The main interest of this class is that it is satisfied for both natural Haar measures (the
regular one and the inner regular one). -/
class InnerRegularCompactLTTop (μ : Measure α) : Prop where
  protected innerRegular : InnerRegularWRT μ IsCompact (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)
goal: Prop

full_name: MeasureTheory.Measure.Regular.weaklyRegular
code: /-- A regular measure is weakly regular in an R₁ space. -/
instance (priority := 100) Regular.weaklyRegular [R1Space α] [Regular μ] :
    WeaklyRegular μ 
goal: μ.WeaklyRegular

full_name: MeasureTheory.Measure.OuterRegular.zero
code: instance zero : OuterRegular (0 : Measure α) 
goal: MeasureTheory.Measure.OuterRegular 0

full_name: Set.exists_isOpen_lt_of_lt
code: /-- Given `r` larger than the measure of a set `A`, there exists an open superset of `A` with
measure less than `r`. -/
theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular μ] (A : Set α) (r : ℝ≥0∞) (hr : μ A < r) :
    ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < r 
goal: ∃ U ⊇ A, IsOpen U ∧ μ U < r

full_name: Set.measure_eq_iInf_isOpen
code: /-- For an outer regular measure, the measure of a set is the infimum of the measures of open sets
containing it. -/
theorem _root_.Set.measure_eq_iInf_isOpen (A : Set α) (μ : Measure α) [OuterRegular μ] :
    μ A = ⨅ (U : Set α) (_ : A ⊆ U) (_ : IsOpen U), μ U 
goal: μ A = ⨅ U, ⨅ (_ : A ⊆ U), ⨅ (_ : IsOpen U), μ U

full_name: Set.exists_isOpen_lt_add
code: theorem _root_.Set.exists_isOpen_lt_add [OuterRegular μ] (A : Set α) (hA : μ A ≠ ∞) {ε : ℝ≥0∞}
    (hε : ε ≠ 0) : ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < μ A + ε 
goal: ∃ U ⊇ A, IsOpen U ∧ μ U < μ A + ε

full_name: Set.exists_isOpen_le_add
code: theorem _root_.Set.exists_isOpen_le_add (A : Set α) (μ : Measure α) [OuterRegular μ] {ε : ℝ≥0∞}
    (hε : ε ≠ 0) : ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U ≤ μ A + ε 
goal: ∃ U ⊇ A, IsOpen U ∧ μ U ≤ μ A + ε

full_name: MeasurableSet.exists_isOpen_diff_lt
code: theorem _root_.MeasurableSet.exists_isOpen_diff_lt [OuterRegular μ] {A : Set α}
    (hA : MeasurableSet A) (hA' : μ A ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U < ∞ ∧ μ (U \ A) < ε 
goal: ∃ U ⊇ A, IsOpen U ∧ μ U < ⊤ ∧ μ (U \ A) < ε

full_name: MeasureTheory.Measure.OuterRegular.map
code: protected theorem map [OpensMeasurableSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) (μ : Measure α) [OuterRegular μ] :
    (Measure.map f μ).OuterRegular 
goal: (MeasureTheory.Measure.map (⇑f) μ).OuterRegular

full_name: MeasureTheory.Measure.OuterRegular.smul
code: protected theorem smul (μ : Measure α) [OuterRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) :
    (x • μ).OuterRegular 
goal: (x • μ).OuterRegular

full_name: MeasureTheory.Measure.OuterRegular.smul_nnreal
code: instance smul_nnreal (μ : Measure α) [OuterRegular μ] (c : ℝ≥0) :
    OuterRegular (c • μ) 
goal: (c • μ).OuterRegular

full_name: MeasureTheory.Measure.OuterRegular.of_restrict
code: /-- If the restrictions of a measure to countably many open sets covering the space are
outer regular, then the measure itself is outer regular. -/
lemma of_restrict [OpensMeasurableSpace α] {μ : Measure α} {s : ℕ → Set α}
    (h : ∀ n, OuterRegular (μ.restrict (s n))) (h' : ∀ n, IsOpen (s n)) (h'' : univ ⊆ ⋃ n, s n) :
    OuterRegular μ 
goal: μ.OuterRegular

full_name: MeasureTheory.Measure.OuterRegular.measure_closure_eq_of_isCompact
code: /-- See also `IsCompact.measure_closure` for a version
that assumes the `σ`-algebra to be the Borel `σ`-algebra but makes no assumptions on `μ`. -/
lemma measure_closure_eq_of_isCompact [R1Space α] [OuterRegular μ]
    {k : Set α} (hk : IsCompact k) : μ (closure k) = μ k 
goal: μ (closure k) = μ k

full_name: MeasureTheory.Measure.FiniteSpanningSetsIn.outerRegular
code: /-- If a measure `μ` admits finite spanning open sets such that the restriction of `μ` to each set
is outer regular, then the original measure is outer regular as well. -/
protected theorem FiniteSpanningSetsIn.outerRegular [OpensMeasurableSpace α] {μ : Measure α}
    (s : μ.FiniteSpanningSetsIn { U | IsOpen U ∧ OuterRegular (μ.restrict U) }) :
    OuterRegular μ 
goal: μ.OuterRegular

full_name: MeasureTheory.Measure.InnerRegularWRT.measurableSet_of_isOpen
code: /-- If a measure is inner regular (using closed or compact sets) for open sets, then every
measurable set of finite measure can be approximated by a (closed or compact) subset. -/
theorem measurableSet_of_isOpen [OuterRegular μ] (H : InnerRegularWRT μ p IsOpen)
    (hd : ∀ ⦃s U⦄, p s → IsOpen U → p (s \ U)) :
    InnerRegularWRT μ p fun s => MeasurableSet s ∧ μ s ≠ ∞ 
goal: μ.InnerRegularWRT p fun s => MeasurableSet s ∧ μ s ≠ ⊤

full_name: MeasureTheory.Measure.InnerRegularWRT.weaklyRegular_of_finite
code: /-- In a finite measure space, assume that any open set can be approximated from inside by closed
sets. Then the measure is weakly regular. -/
theorem weaklyRegular_of_finite [BorelSpace α] (μ : Measure α) [IsFiniteMeasure μ]
    (H : InnerRegularWRT μ IsClosed IsOpen) : WeaklyRegular μ 
goal: μ.WeaklyRegular

full_name: MeasureTheory.Measure.InnerRegularWRT.of_restrict
code: /-- If the restrictions of a measure to a monotone sequence of sets covering the space are
inner regular for some property `p` and all measurable sets, then the measure itself is
inner regular. -/
lemma of_restrict {μ : Measure α} {s : ℕ → Set α}
    (h : ∀ n, InnerRegularWRT (μ.restrict (s n)) p MeasurableSet)
    (hs : univ ⊆ ⋃ n, s n) (hmono : Monotone s) : InnerRegularWRT μ p MeasurableSet 
goal: μ.InnerRegularWRT p MeasurableSet

full_name: MeasureTheory.Measure.InnerRegularWRT.of_pseudoMetrizableSpace
code: /-- In a metrizable space (or even a pseudo metrizable space), an open set can be approximated from
inside by closed sets. -/
theorem of_pseudoMetrizableSpace {X : Type*} [TopologicalSpace X] [PseudoMetrizableSpace X]
    [MeasurableSpace X] (μ : Measure X) : InnerRegularWRT μ IsClosed IsOpen 
goal: μ.InnerRegularWRT IsClosed IsOpen

full_name: MeasureTheory.Measure.InnerRegularWRT.isCompact_isClosed
code: /-- In a `σ`-compact space, any closed set can be approximated by a compact subset. -/
theorem isCompact_isClosed {X : Type*} [TopologicalSpace X] [SigmaCompactSpace X]
    [MeasurableSpace X] (μ : Measure X) : InnerRegularWRT μ IsCompact IsClosed 
goal: μ.InnerRegularWRT IsCompact IsClosed

full_name: MeasureTheory.Measure.InnerRegularWRT.restrict
code: /-- If `μ` is inner regular for measurable finite measure sets with respect to some class of sets,
then its restriction to any set is also inner regular for measurable finite measure sets, with
respect to the same class of sets. -/
lemma restrict (h : InnerRegularWRT μ p (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞)) (A : Set α) :
    InnerRegularWRT (μ.restrict A) p (fun s ↦ MeasurableSet s ∧ μ.restrict A s ≠ ∞) 
goal: (μ.restrict A).InnerRegularWRT p fun s => MeasurableSet s ∧ (μ.restrict A) s ≠ ⊤

full_name: MeasureTheory.Measure.InnerRegularWRT.restrict_of_measure_ne_top
code: /-- If `μ` is inner regular for measurable finite measure sets with respect to some class of sets,
then its restriction to any finite measure set is also inner regular for measurable sets with
respect to the same class of sets. -/
lemma restrict_of_measure_ne_top (h : InnerRegularWRT μ p (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞))
    {A : Set α} (hA : μ A ≠ ∞) :
    InnerRegularWRT (μ.restrict A) p (fun s ↦ MeasurableSet s) 
goal: (μ.restrict A).InnerRegularWRT p fun s => MeasurableSet s

full_name: MeasureTheory.Measure.InnerRegularWRT.of_sigmaFinite
code: /-- Given a σ-finite measure, any measurable set can be approximated from inside by a measurable
set of finite measure. -/
lemma of_sigmaFinite [SigmaFinite μ] :
    InnerRegularWRT μ (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞) (fun s ↦ MeasurableSet s) 
goal: μ.InnerRegularWRT (fun s => MeasurableSet s ∧ μ s ≠ ⊤) fun s => MeasurableSet s

full_name: MeasurableSet.measure_eq_iSup_isCompact
code: /-- The measure of a measurable set is the supremum of the measures of compact sets it contains. -/
theorem _root_.MeasurableSet.measure_eq_iSup_isCompact ⦃U : Set α⦄ (hU : MeasurableSet U)
    (μ : Measure α) [InnerRegular μ] :
    μ U = ⨆ (K : Set α) (_ : K ⊆ U) (_ : IsCompact K), μ K 
goal: μ U = ⨆ K, ⨆ (_ : K ⊆ U), ⨆ (_ : IsCompact K), μ K

full_name: MeasureTheory.Measure.InnerRegular.zero
code: instance zero : InnerRegular (0 : Measure α) 
goal: MeasureTheory.Measure.InnerRegular 0

full_name: MeasureTheory.Measure.InnerRegular.smul
code: instance smul [h : InnerRegular μ] (c : ℝ≥0∞) : InnerRegular (c • μ) 
goal: (c • μ).InnerRegular

full_name: MeasureTheory.Measure.InnerRegular.smul_nnreal
code: instance smul_nnreal [InnerRegular μ] (c : ℝ≥0) : InnerRegular (c • μ) 
goal: (c • μ).InnerRegular

full_name: MeasureTheory.Measure.InnerRegular.instInnerRegularCompactLTTop
code: instance (priority := 100) [InnerRegular μ] : InnerRegularCompactLTTop μ 
goal: μ.InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.InnerRegular.innerRegularWRT_isClosed_isOpen
code: lemma innerRegularWRT_isClosed_isOpen [R1Space α] [OpensMeasurableSpace α] [h : InnerRegular μ] :
    InnerRegularWRT μ IsClosed IsOpen 
goal: μ.InnerRegularWRT IsClosed IsOpen

full_name: MeasureTheory.Measure.InnerRegular.exists_compact_not_null
code: theorem exists_compact_not_null [InnerRegular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0 
goal: (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0

full_name: MeasurableSet.exists_lt_isCompact
code: /-- If `μ` is inner regular, then any measurable set can be approximated by a compact subset.
See also `MeasurableSet.exists_isCompact_lt_add_of_ne_top`. -/
theorem _root_.MeasurableSet.exists_lt_isCompact [InnerRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) {r : ℝ≥0∞} (hr : r < μ A) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ r < μ K 
goal: ∃ K ⊆ A, IsCompact K ∧ r < μ K

full_name: MeasureTheory.Measure.InnerRegular.map_of_continuous
code: protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegular μ] {f : α → β} (hf : Continuous f) :
    InnerRegular (Measure.map f μ) 
goal: (MeasureTheory.Measure.map f μ).InnerRegular

full_name: MeasureTheory.Measure.InnerRegular.map
code: protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [InnerRegular μ] (f : α ≃ₜ β) : (Measure.map f μ).InnerRegular 
goal: (MeasureTheory.Measure.map (⇑f) μ).InnerRegular

full_name: MeasureTheory.Measure.InnerRegular.map_iff
code: protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    InnerRegular (Measure.map f μ) ↔ InnerRegular μ 
goal: (MeasureTheory.Measure.map (⇑f) μ).InnerRegular ↔ μ.InnerRegular

full_name: MeasurableSet.exists_isCompact_lt_add
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
then any measurable set of finite measure can be approximated by a
compact subset. See also `MeasurableSet.exists_lt_isCompact_of_ne_top`. -/
theorem _root_.MeasurableSet.exists_isCompact_lt_add [InnerRegularCompactLTTop μ]
    ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ μ A < μ K + ε 
goal: ∃ K ⊆ A, IsCompact K ∧ μ A < μ K + ε

full_name: MeasurableSet.exists_isCompact_isClosed_lt_add
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
then any measurable set of finite measure can be approximated by a compact closed subset.
Compared to `MeasurableSet.exists_isCompact_lt_add`,
this version additionally assumes that `α` is an R₁ space with Borel σ-algebra.
-/
theorem _root_.MeasurableSet.exists_isCompact_isClosed_lt_add
    [InnerRegularCompactLTTop μ] [R1Space α] [BorelSpace α]
    ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ IsClosed K ∧ μ A < μ K + ε 
goal: ∃ K ⊆ A, IsCompact K ∧ IsClosed K ∧ μ A < μ K + ε

full_name: MeasurableSet.exists_isCompact_diff_lt
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
then any measurable set of finite measure can be approximated by a
compact subset. See also `MeasurableSet.exists_isCompact_lt_add` and
`MeasurableSet.exists_lt_isCompact_of_ne_top`. -/
theorem _root_.MeasurableSet.exists_isCompact_diff_lt [OpensMeasurableSpace α] [T2Space α]
    [InnerRegularCompactLTTop μ]  ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞)
    {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ μ (A \ K) < ε 
goal: ∃ K ⊆ A, IsCompact K ∧ μ (A \ K) < ε

full_name: MeasurableSet.exists_isCompact_isClosed_diff_lt
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
then any measurable set of finite measure can be approximated by a compact closed subset.
Compared to `MeasurableSet.exists_isCompact_diff_lt`,
this lemma additionally assumes that `α` is an R₁ space with Borel σ-algebra. -/
theorem _root_.MeasurableSet.exists_isCompact_isClosed_diff_lt [BorelSpace α] [R1Space α]
    [InnerRegularCompactLTTop μ] ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞)
    {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ IsClosed K ∧ μ (A \ K) < ε 
goal: ∃ K ⊆ A, IsCompact K ∧ IsClosed K ∧ μ (A \ K) < ε

full_name: MeasurableSet.exists_lt_isCompact_of_ne_top
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
then any measurable set of finite measure can be approximated by a
compact subset. See also `MeasurableSet.exists_isCompact_lt_add`. -/
theorem _root_.MeasurableSet.exists_lt_isCompact_of_ne_top [InnerRegularCompactLTTop μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {r : ℝ≥0∞} (hr : r < μ A) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ r < μ K 
goal: ∃ K ⊆ A, IsCompact K ∧ r < μ K

full_name: MeasurableSet.measure_eq_iSup_isCompact_of_ne_top
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets,
any measurable set of finite mass can be approximated from inside by compact sets. -/
theorem _root_.MeasurableSet.measure_eq_iSup_isCompact_of_ne_top [InnerRegularCompactLTTop μ]
    ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞) :
    μ A = ⨆ (K) (_ : K ⊆ A) (_ : IsCompact K), μ K 
goal: μ A = ⨆ K, ⨆ (_ : K ⊆ A), ⨆ (_ : IsCompact K), μ K

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.restrict
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets, then its
restriction to any set also is. -/
instance restrict [h : InnerRegularCompactLTTop μ] (A : Set α) :
    InnerRegularCompactLTTop (μ.restrict A) 
goal: (μ.restrict A).InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.instInnerRegularOfIsFiniteMeasure
code: instance (priority := 50) [h : InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] :
    InnerRegular μ 
goal: μ.InnerRegular

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.instWeaklyRegularOfBorelSpaceOfR1SpaceOfIsFiniteMeasure
code: instance (priority := 50) [BorelSpace α] [R1Space α] [InnerRegularCompactLTTop μ]
    [IsFiniteMeasure μ] : WeaklyRegular μ 
goal: μ.WeaklyRegular

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.instRegularOfBorelSpaceOfR1SpaceOfIsFiniteMeasure
code: instance (priority := 50) [BorelSpace α] [R1Space α] [h : InnerRegularCompactLTTop μ]
    [IsFiniteMeasure μ] : Regular μ 
goal: μ.Regular

full_name: IsCompact.exists_isOpen_lt_of_lt
code: protected lemma _root_.IsCompact.exists_isOpen_lt_of_lt [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α] {K : Set α}
    (hK : IsCompact K) (r : ℝ≥0∞) (hr : μ K < r) :
    ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < r 
goal: ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < r

full_name: IsCompact.measure_eq_iInf_isOpen
code: /-- If `μ` is inner regular for finite measure sets with respect to compact sets
and is locally finite in an R₁ space,
then any compact set can be approximated from outside by open sets. -/
protected lemma _root_.IsCompact.measure_eq_iInf_isOpen [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α] {K : Set α} (hK : IsCompact K) :
    μ K = ⨅ (U : Set α) (_ : K ⊆ U) (_ : IsOpen U), μ U 
goal: μ K = ⨅ U, ⨅ (_ : K ⊆ U), ⨅ (_ : IsOpen U), μ U

full_name: IsCompact.exists_isOpen_lt_add
code: protected theorem _root_.IsCompact.exists_isOpen_lt_add [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α]
    {K : Set α} (hK : IsCompact K) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < μ K + ε 
goal: ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < μ K + ε

full_name: MeasurableSet.exists_isOpen_symmDiff_lt
code: /-- Let `μ` be a locally finite measure on an R₁ topological space with Borel σ-algebra.
If `μ` is inner regular for finite measure sets with respect to compact sets,
then any finite measurable set can be approximated in measure by an open set.
See also `Set.exists_isOpen_lt_of_lt` and `MeasurableSet.exists_isOpen_diff_lt`
for the case of an outer regular measure. -/
protected theorem _root_.MeasurableSet.exists_isOpen_symmDiff_lt [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α]
    {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ U, IsOpen U ∧ μ U < ∞ ∧ μ (U ∆ s) < ε 
goal: ∃ U, IsOpen U ∧ μ U < ⊤ ∧ μ (U ∆ s) < ε

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.smul
code: instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) 
goal: (c • μ).InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.smul_nnreal
code: instance smul_nnreal [InnerRegularCompactLTTop μ] (c : ℝ≥0) :
    InnerRegularCompactLTTop (c • μ) 
goal: (c • μ).InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.instInnerRegularOfSigmaFinite
code: instance (priority := 80) [InnerRegularCompactLTTop μ] [SigmaFinite μ] : InnerRegular μ 
goal: μ.InnerRegular

full_name: MeasureTheory.Measure.InnerRegularCompactLTTop.map_of_continuous
code: protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) 
goal: (MeasureTheory.Measure.map f μ).InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.WeaklyRegular.zero
code: instance zero : WeaklyRegular (0 : Measure α) 
goal: MeasureTheory.Measure.WeaklyRegular 0

full_name: IsOpen.exists_lt_isClosed
code: /-- If `μ` is a weakly regular measure, then any open set can be approximated by a closed subset. -/
theorem _root_.IsOpen.exists_lt_isClosed [WeaklyRegular μ] ⦃U : Set α⦄ (hU : IsOpen U) {r : ℝ≥0∞}
    (hr : r < μ U) : ∃ F, F ⊆ U ∧ IsClosed F ∧ r < μ F 
goal: ∃ F ⊆ U, IsClosed F ∧ r < μ F

full_name: IsOpen.measure_eq_iSup_isClosed
code: /-- If `μ` is a weakly regular measure, then any open set can be approximated by a closed subset. -/
theorem _root_.IsOpen.measure_eq_iSup_isClosed ⦃U : Set α⦄ (hU : IsOpen U) (μ : Measure α)
    [WeaklyRegular μ] : μ U = ⨆ (F) (_ : F ⊆ U) (_ : IsClosed F), μ F 
goal: μ U = ⨆ F, ⨆ (_ : F ⊆ U), ⨆ (_ : IsClosed F), μ F

full_name: MeasureTheory.Measure.WeaklyRegular.innerRegular_measurable
code: theorem innerRegular_measurable [WeaklyRegular μ] :
    InnerRegularWRT μ IsClosed fun s => MeasurableSet s ∧ μ s ≠ ∞ 
goal: μ.InnerRegularWRT IsClosed fun s => MeasurableSet s ∧ μ s ≠ ⊤

full_name: MeasurableSet.exists_isClosed_lt_add
code: /-- If `s` is a measurable set, a weakly regular measure `μ` is finite on `s`, and `ε` is a positive
number, then there exist a closed set `K ⊆ s` such that `μ s < μ K + ε`. -/
theorem _root_.MeasurableSet.exists_isClosed_lt_add [WeaklyRegular μ] {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ K, K ⊆ s ∧ IsClosed K ∧ μ s < μ K + ε 
goal: ∃ K ⊆ s, IsClosed K ∧ μ s < μ K + ε

full_name: MeasurableSet.exists_isClosed_diff_lt
code: theorem _root_.MeasurableSet.exists_isClosed_diff_lt [OpensMeasurableSpace α] [WeaklyRegular μ]
    ⦃A : Set α⦄ (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ F, F ⊆ A ∧ IsClosed F ∧ μ (A \ F) < ε 
goal: ∃ F ⊆ A, IsClosed F ∧ μ (A \ F) < ε

full_name: MeasurableSet.exists_lt_isClosed_of_ne_top
code: /-- Given a weakly regular measure, any measurable set of finite mass can be approximated from
inside by closed sets. -/
theorem _root_.MeasurableSet.exists_lt_isClosed_of_ne_top [WeaklyRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {r : ℝ≥0∞} (hr : r < μ A) :
    ∃ K, K ⊆ A ∧ IsClosed K ∧ r < μ K 
goal: ∃ K ⊆ A, IsClosed K ∧ r < μ K

full_name: MeasurableSet.measure_eq_iSup_isClosed_of_ne_top
code: /-- Given a weakly regular measure, any measurable set of finite mass can be approximated from
inside by closed sets. -/
theorem _root_.MeasurableSet.measure_eq_iSup_isClosed_of_ne_top [WeaklyRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) (h'A : μ A ≠ ∞) : μ A = ⨆ (K) (_ : K ⊆ A) (_ : IsClosed K), μ K 
goal: μ A = ⨆ K, ⨆ (_ : K ⊆ A), ⨆ (_ : IsClosed K), μ K

full_name: MeasureTheory.Measure.WeaklyRegular.restrict_of_measure_ne_top
code: /-- The restriction of a weakly regular measure to a measurable set of finite measure is
weakly regular. -/
theorem restrict_of_measure_ne_top [BorelSpace α] [WeaklyRegular μ] {A : Set α}
    (h'A : μ A ≠ ∞) : WeaklyRegular (μ.restrict A) 
goal: (μ.restrict A).WeaklyRegular

full_name: MeasureTheory.Measure.WeaklyRegular.of_pseudoMetrizableSpace_of_isFiniteMeasure
code: /-- Any finite measure on a metrizable space (or even a pseudo metrizable space)
is weakly regular. -/
instance (priority := 100) of_pseudoMetrizableSpace_of_isFiniteMeasure {X : Type*}
    [TopologicalSpace X] [PseudoMetrizableSpace X] [MeasurableSpace X] [BorelSpace X]
    (μ : Measure X) [IsFiniteMeasure μ] :
    WeaklyRegular μ 
goal: μ.WeaklyRegular

full_name: MeasureTheory.Measure.WeaklyRegular.of_pseudoMetrizableSpace_secondCountable_of_locallyFinite
code: /-- Any locally finite measure on a second countable metrizable space
(or even a pseudo metrizable space) is weakly regular. -/
instance (priority := 100) of_pseudoMetrizableSpace_secondCountable_of_locallyFinite {X : Type*}
    [TopologicalSpace X] [PseudoMetrizableSpace X] [SecondCountableTopology X] [MeasurableSpace X]
    [BorelSpace X] (μ : Measure X) [IsLocallyFiniteMeasure μ] : WeaklyRegular μ 
goal: μ.WeaklyRegular

full_name: MeasureTheory.Measure.WeaklyRegular.smul
code: protected theorem smul [WeaklyRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).WeaklyRegular 
goal: (x • μ).WeaklyRegular

full_name: MeasureTheory.Measure.WeaklyRegular.smul_nnreal
code: instance smul_nnreal [WeaklyRegular μ] (c : ℝ≥0) : WeaklyRegular (c • μ) 
goal: (c • μ).WeaklyRegular

full_name: MeasureTheory.Measure.Regular.zero
code: instance zero : Regular (0 : Measure α) 
goal: MeasureTheory.Measure.Regular 0

full_name: IsOpen.exists_lt_isCompact
code: /-- If `μ` is a regular measure, then any open set can be approximated by a compact subset. -/
theorem _root_.IsOpen.exists_lt_isCompact [Regular μ] ⦃U : Set α⦄ (hU : IsOpen U) {r : ℝ≥0∞}
    (hr : r < μ U) : ∃ K, K ⊆ U ∧ IsCompact K ∧ r < μ K 
goal: ∃ K ⊆ U, IsCompact K ∧ r < μ K

full_name: IsOpen.measure_eq_iSup_isCompact
code: /-- The measure of an open set is the supremum of the measures of compact sets it contains. -/
theorem _root_.IsOpen.measure_eq_iSup_isCompact ⦃U : Set α⦄ (hU : IsOpen U) (μ : Measure α)
    [Regular μ] : μ U = ⨆ (K : Set α) (_ : K ⊆ U) (_ : IsCompact K), μ K 
goal: μ U = ⨆ K, ⨆ (_ : K ⊆ U), ⨆ (_ : IsCompact K), μ K

full_name: MeasureTheory.Measure.Regular.exists_compact_not_null
code: theorem exists_compact_not_null [Regular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0 
goal: (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0

full_name: MeasureTheory.Measure.Regular.instInnerRegularCompactLTTop
code: /-- If `μ` is a regular measure, then any measurable set of finite measure can be approximated by a
compact subset. See also `MeasurableSet.exists_isCompact_lt_add` and
`MeasurableSet.exists_lt_isCompact_of_ne_top`. -/
instance (priority := 100) [Regular μ] : InnerRegularCompactLTTop μ 
goal: μ.InnerRegularCompactLTTop

full_name: MeasureTheory.Measure.Regular.map
code: protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular 
goal: (MeasureTheory.Measure.map (⇑f) μ).Regular

full_name: MeasureTheory.Measure.Regular.map_iff
code: protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ 
goal: (MeasureTheory.Measure.map (⇑f) μ).Regular ↔ μ.Regular

full_name: MeasureTheory.Measure.Regular.smul
code: protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular 
goal: (x • μ).Regular

full_name: MeasureTheory.Measure.Regular.smul_nnreal
code: instance smul_nnreal [Regular μ] (c : ℝ≥0) : Regular (c • μ) 
goal: (c • μ).Regular

full_name: MeasureTheory.Measure.Regular.restrict_of_measure_ne_top
code: /-- The restriction of a regular measure to a set of finite measure is regular. -/
theorem restrict_of_measure_ne_top [R1Space α] [BorelSpace α] [Regular μ]
    {A : Set α} (h'A : μ A ≠ ∞) : Regular (μ.restrict A) 
goal: (μ.restrict A).Regular

full_name: MeasureTheory.Measure.Regular.of_sigmaCompactSpace_of_isLocallyFiniteMeasure
code: /-- Any locally finite measure on a `σ`-compact pseudometrizable space is regular. -/
instance (priority := 100) Regular.of_sigmaCompactSpace_of_isLocallyFiniteMeasure {X : Type*}
    [TopologicalSpace X] [PseudoMetrizableSpace X] [SigmaCompactSpace X] [MeasurableSpace X]
    [BorelSpace X] (μ : Measure X) [IsLocallyFiniteMeasure μ] : Regular μ 
goal: μ.Regular

full_name: MeasureTheory.Measure.instInnerRegularOfPseudoMetrizableSpaceOfSigmaCompactSpaceOfBorelSpaceOfSigmaFinite
code: /-- Any sigma finite measure on a `σ`-compact pseudometrizable space is inner regular. -/
instance (priority := 100) {X : Type*}
    [TopologicalSpace X] [PseudoMetrizableSpace X] [SigmaCompactSpace X] [MeasurableSpace X]
    [BorelSpace X] (μ : Measure X) [SigmaFinite μ] : InnerRegular μ 
goal: μ.InnerRegular