l3lab/ntp-mathlib huggingface dataset:
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : c = ⊤
s : Set α
hs : MeasurableSet s ∧ ↑↑(c • μ) s ≠ ⊤
r : ℝ≥0∞
hr : r < ⊤ * ↑↑μ s
h's : ¬↑↑μ s = 0
⊢ ∃ K ⊆ s, IsCompact K ∧ r < ↑↑(c • μ) K

Next tactic:
simp [h'c, ENNReal.mul_eq_top, h's] at hs
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · simp [h'c, ENNReal.mul_eq_top, h's] at hs
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : ¬c = ⊤
⊢ InnerRegularCompactLTTop (c • μ)

Next tactic:
constructor
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · simp [h'c, ENNReal.mul_eq_top, h's] at hs
  · constructor
    

Proof state:
case neg.innerRegular
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : ¬c = ⊤
⊢ InnerRegularWRT (c • μ) IsCompact fun s => MeasurableSet s ∧ ↑↑(c • μ) s ≠ ⊤

Next tactic:
convert InnerRegularWRT.smul h.innerRegular c using 2 with s
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · simp [h'c, ENNReal.mul_eq_top, h's] at hs
  · constructor
    convert InnerRegularWRT.smul h.innerRegular c using 2 with s
    

Proof state:
case h.e'_5.h.a
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : ¬c = ⊤
s : Set α
⊢ MeasurableSet s ∧ ↑↑(c • μ) s ≠ ⊤ ↔ MeasurableSet s ∧ ↑↑μ s ≠ ⊤

Next tactic:
have : (c • μ) s ≠ ∞ ↔ μ s ≠ ∞ := by simp [not_iff_not, ENNReal.mul_eq_top, hc, h'c]
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · simp [h'c, ENNReal.mul_eq_top, h's] at hs
  · constructor
    convert InnerRegularWRT.smul h.innerRegular c using 2 with s
    have : (c • μ) s ≠ ∞ ↔ μ s ≠ ∞ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : ¬c = ⊤
s : Set α
⊢ ↑↑(c • μ) s ≠ ⊤ ↔ ↑↑μ s ≠ ⊤

Next tactic:
simp [not_iff_not, ENNReal.mul_eq_top, hc, h'c]
instance smul [h : InnerRegularCompactLTTop μ] (c : ℝ≥0∞) : InnerRegularCompactLTTop (c • μ) := by
  by_cases hc : c = 0
  · simp only [hc, zero_smul]
    infer_instance
  by_cases h'c : c = ∞
  · constructor
    intro s hs r hr
    simp only [h'c, smul_toOuterMeasure, OuterMeasure.coe_smul, Pi.smul_apply, smul_eq_mul] at hr
    by_cases h's : μ s = 0
    · simp [h's] at hr
    · simp [h'c, ENNReal.mul_eq_top, h's] at hs
  · constructor
    convert InnerRegularWRT.smul h.innerRegular c using 2 with s
    have : (c • μ) s ≠ ∞ ↔ μ s ≠ ∞ := by simp [not_iff_not, ENNReal.mul_eq_top, hc, h'c]
    

Proof state:
case h.e'_5.h.a
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
c : ℝ≥0∞
hc : ¬c = 0
h'c : ¬c = ⊤
s : Set α
this : ↑↑(c • μ) s ≠ ⊤ ↔ ↑↑μ s ≠ ⊤
⊢ MeasurableSet s ∧ ↑↑(c • μ) s ≠ ⊤ ↔ MeasurableSet s ∧ ↑↑μ s ≠ ⊤

Next tactic:
simp only [this]
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
⊢ InnerRegularCompactLTTop (map f μ)

Next tactic:
constructor
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  

Proof state:
case innerRegular
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
⊢ InnerRegularWRT (map f μ) IsCompact fun s => MeasurableSet s ∧ ↑↑(map f μ) s ≠ ⊤

Next tactic:
refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
  · 

Proof state:
case innerRegular.refine_1
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
⊢ ∀ (U : Set β), MeasurableSet U ∧ ↑↑(map f μ) U ≠ ⊤ → MeasurableSet (f ⁻¹' U) ∧ ↑↑μ (f ⁻¹' U) ≠ ⊤

Next tactic:
rintro s ⟨hs, h's⟩
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
  · rintro s ⟨hs, h's⟩
    

Proof state:
case innerRegular.refine_1.intro
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
s : Set β
hs : MeasurableSet s
h's : ↑↑(map f μ) s ≠ ⊤
⊢ MeasurableSet (f ⁻¹' s) ∧ ↑↑μ (f ⁻¹' s) ≠ ⊤

Next tactic:
exact ⟨hf.measurable hs, by rwa [map_apply hf.measurable hs] at h's⟩
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
  · rintro s ⟨hs, h's⟩
    exact ⟨hf.measurable hs, by 

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
s : Set β
hs : MeasurableSet s
h's : ↑↑(map f μ) s ≠ ⊤
⊢ ↑↑μ (f ⁻¹' s) ≠ ⊤

Next tactic:
rwa [map_apply hf.measurable hs] at h's
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
  · rintro s ⟨hs, h's⟩
    exact ⟨hf.measurable hs, by rwa [map_apply hf.measurable hs] at h's⟩
  · 

Proof state:
case innerRegular.refine_2
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
⊢ ∀ (U : Set β), MeasurableSet U ∧ ↑↑(map f μ) U ≠ ⊤ → MeasurableSet U

Next tactic:
rintro s ⟨hs, -⟩
protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ) := by
  constructor
  refine InnerRegularWRT.map h.innerRegular hf.aemeasurable ?_ (fun K hK ↦ hK.image hf) ?_
  · rintro s ⟨hs, h's⟩
    exact ⟨hf.measurable hs, by rwa [map_apply hf.measurable hs] at h's⟩
  · rintro s ⟨hs, -⟩
    

Proof state:
case innerRegular.refine_2.intro
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
h : InnerRegularCompactLTTop μ
f : α → β
hf : Continuous f
s : Set β
hs : MeasurableSet s
⊢ MeasurableSet s

Next tactic:
exact hs
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) < ε := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : OpensMeasurableSpace α
inst✝ : WeaklyRegular μ
A : Set α
hA : MeasurableSet A
h'A : ↑↑μ A ≠ ⊤
ε : ℝ≥0∞
hε : ε ≠ 0
⊢ ∃ F ⊆ A, IsClosed F ∧ ↑↑μ (A \ F) < ε

Next tactic:
rcases hA.exists_isClosed_lt_add h'A hε with ⟨F, hFA, hFc, hF⟩
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) < ε := by
  rcases hA.exists_isClosed_lt_add h'A hε with ⟨F, hFA, hFc, hF⟩
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : OpensMeasurableSpace α
inst✝ : WeaklyRegular μ
A : Set α
hA : MeasurableSet A
h'A : ↑↑μ A ≠ ⊤
ε : ℝ≥0∞
hε : ε ≠ 0
F : Set α
hFA : F ⊆ A
hFc : IsClosed F
hF : ↑↑μ A < ↑↑μ F + ε
⊢ ∃ F ⊆ A, IsClosed F ∧ ↑↑μ (A \ F) < ε

Next tactic:
exact
    ⟨F, hFA, hFc,
      measure_diff_lt_of_lt_add hFc.measurableSet hFA (ne_top_of_le_ne_top h'A <| measure_mono hFA)
        hF⟩
/-- 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) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : BorelSpace α
inst✝ : WeaklyRegular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
⊢ WeaklyRegular (restrict μ A)

Next tactic:
haveI : Fact (μ A < ∞) := ⟨h'A.lt_top⟩
/-- 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) := by
  haveI : Fact (μ A < ∞) := ⟨h'A.lt_top⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : BorelSpace α
inst✝ : WeaklyRegular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
this : Fact (↑↑μ A < ⊤)
⊢ WeaklyRegular (restrict μ A)

Next tactic:
refine InnerRegularWRT.weaklyRegular_of_finite (μ.restrict A) (fun V V_open r hr ↦ ?_)
/-- 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) := by
  haveI : Fact (μ A < ∞) := ⟨h'A.lt_top⟩
  refine InnerRegularWRT.weaklyRegular_of_finite (μ.restrict A) (fun V V_open r hr ↦ ?_)
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : BorelSpace α
inst✝ : WeaklyRegular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
this : Fact (↑↑μ A < ⊤)
V : Set α
V_open : IsOpen V
r : ℝ≥0∞
hr : r < ↑↑(restrict μ A) V
⊢ ∃ K ⊆ V, IsClosed K ∧ r < ↑↑(restrict μ A) K

Next tactic:
have : InnerRegularWRT (μ.restrict A) IsClosed (fun s ↦ MeasurableSet s) :=
    InnerRegularWRT.restrict_of_measure_ne_top innerRegular_measurable h'A
/-- 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) := by
  haveI : Fact (μ A < ∞) := ⟨h'A.lt_top⟩
  refine InnerRegularWRT.weaklyRegular_of_finite (μ.restrict A) (fun V V_open r hr ↦ ?_)
  have : InnerRegularWRT (μ.restrict A) IsClosed (fun s ↦ MeasurableSet s) :=
    InnerRegularWRT.restrict_of_measure_ne_top innerRegular_measurable h'A
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
inst✝¹ : BorelSpace α
inst✝ : WeaklyRegular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
this✝ : Fact (↑↑μ A < ⊤)
V : Set α
V_open : IsOpen V
r : ℝ≥0∞
hr : r < ↑↑(restrict μ A) V
this : InnerRegularWRT (restrict μ A) IsClosed fun s => MeasurableSet s
⊢ ∃ K ⊆ V, IsClosed K ∧ r < ↑↑(restrict μ A) K

Next tactic:
exact this V_open.measurableSet r hr
/-- 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 μ :=
  have : OuterRegular μ := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SecondCountableTopology X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : IsLocallyFiniteMeasure μ
⊢ OuterRegular μ

Next tactic:
refine' (μ.finiteSpanningSetsInOpen'.mono' fun U hU => _).outerRegular
/-- 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 μ :=
  have : OuterRegular μ := by
    refine' (μ.finiteSpanningSetsInOpen'.mono' fun U hU => _).outerRegular
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SecondCountableTopology X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : IsLocallyFiniteMeasure μ
U : Set X
hU : U ∈ {K | IsOpen K} ∩ {s | ↑↑μ s < ⊤}
⊢ U ∈ {U | IsOpen U ∧ OuterRegular (restrict μ U)}

Next tactic:
have : Fact (μ U < ∞) := ⟨hU.2⟩
/-- 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 μ :=
  have : OuterRegular μ := by
    refine' (μ.finiteSpanningSetsInOpen'.mono' fun U hU => _).outerRegular
    have : Fact (μ U < ∞) := ⟨hU.2⟩
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SecondCountableTopology X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : IsLocallyFiniteMeasure μ
U : Set X
hU : U ∈ {K | IsOpen K} ∩ {s | ↑↑μ s < ⊤}
this : Fact (↑↑μ U < ⊤)
⊢ U ∈ {U | IsOpen U ∧ OuterRegular (restrict μ U)}

Next tactic:
exact ⟨hU.1, inferInstance⟩
protected theorem smul [WeaklyRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).WeaklyRegular := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
x : ℝ≥0∞
hx : x ≠ ⊤
⊢ WeaklyRegular (x • μ)

Next tactic:
haveI := OuterRegular.smul μ hx
protected theorem smul [WeaklyRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).WeaklyRegular := by
  haveI := OuterRegular.smul μ hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : WeaklyRegular μ
x : ℝ≥0∞
hx : x ≠ ⊤
this : OuterRegular (x • μ)
⊢ WeaklyRegular (x • μ)

Next tactic:
exact ⟨WeaklyRegular.innerRegular.smul x⟩
theorem exists_compact_not_null [Regular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : Regular μ
⊢ (∃ K, IsCompact K ∧ ↑↑μ K ≠ 0) ↔ μ ≠ 0

Next tactic:
simp_rw [Ne.def, ← measure_univ_eq_zero, isOpen_univ.measure_eq_iSup_isCompact,
    ENNReal.iSup_eq_zero, not_forall, exists_prop, subset_univ, true_and_iff]
protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁶ : MeasurableSpace α
inst✝⁵ : TopologicalSpace α
μ : Measure α
inst✝⁴ : BorelSpace α
inst✝³ : MeasurableSpace β
inst✝² : TopologicalSpace β
inst✝¹ : BorelSpace β
inst✝ : Regular μ
f : α ≃ₜ β
⊢ Regular (map (⇑f) μ)

Next tactic:
haveI := OuterRegular.map f μ
protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular := by
  haveI := OuterRegular.map f μ
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁶ : MeasurableSpace α
inst✝⁵ : TopologicalSpace α
μ : Measure α
inst✝⁴ : BorelSpace α
inst✝³ : MeasurableSpace β
inst✝² : TopologicalSpace β
inst✝¹ : BorelSpace β
inst✝ : Regular μ
f : α ≃ₜ β
this : OuterRegular (map (⇑f) μ)
⊢ Regular (map (⇑f) μ)

Next tactic:
haveI := IsFiniteMeasureOnCompacts.map μ f
protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular := by
  haveI := OuterRegular.map f μ
  haveI := IsFiniteMeasureOnCompacts.map μ f
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁶ : MeasurableSpace α
inst✝⁵ : TopologicalSpace α
μ : Measure α
inst✝⁴ : BorelSpace α
inst✝³ : MeasurableSpace β
inst✝² : TopologicalSpace β
inst✝¹ : BorelSpace β
inst✝ : Regular μ
f : α ≃ₜ β
this✝ : OuterRegular (map (⇑f) μ)
this : IsFiniteMeasureOnCompacts (map (⇑f) μ)
⊢ Regular (map (⇑f) μ)

Next tactic:
exact
    ⟨Regular.innerRegular.map' f.toMeasurableEquiv
        (fun U hU => hU.preimage f.continuous)
        (fun K hK => hK.image f.continuous)⟩
protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
⊢ Regular (map (⇑f) μ) ↔ Regular μ

Next tactic:
refine ⟨fun h ↦ ?_, fun h ↦ h.map f⟩
protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.map f⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : Regular (map (⇑f) μ)
⊢ Regular μ

Next tactic:
convert h.map f.symm
protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.map f⟩
  convert h.map f.symm
  

Proof state:
case h.e'_4
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : Regular (map (⇑f) μ)
⊢ μ = map (⇑(Homeomorph.symm f)) (map (⇑f) μ)

Next tactic:
rw [map_map f.symm.continuous.measurable f.continuous.measurable]
protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    Regular (Measure.map f μ) ↔ Regular μ := by
  refine ⟨fun h ↦ ?_, fun h ↦ h.map f⟩
  convert h.map f.symm
  rw [map_map f.symm.continuous.measurable f.continuous.measurable]
  

Proof state:
case h.e'_4
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : Regular (map (⇑f) μ)
⊢ μ = map (⇑(Homeomorph.symm f) ∘ ⇑f) μ

Next tactic:
simp
protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : Regular μ
x : ℝ≥0∞
hx : x ≠ ⊤
⊢ Regular (x • μ)

Next tactic:
haveI := OuterRegular.smul μ hx
protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular := by
  haveI := OuterRegular.smul μ hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : Regular μ
x : ℝ≥0∞
hx : x ≠ ⊤
this : OuterRegular (x • μ)
⊢ Regular (x • μ)

Next tactic:
haveI := IsFiniteMeasureOnCompacts.smul μ hx
protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular := by
  haveI := OuterRegular.smul μ hx
  haveI := IsFiniteMeasureOnCompacts.smul μ hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
inst✝ : Regular μ
x : ℝ≥0∞
hx : x ≠ ⊤
this✝ : OuterRegular (x • μ)
this : IsFiniteMeasureOnCompacts (x • μ)
⊢ Regular (x • μ)

Next tactic:
exact ⟨Regular.innerRegular.smul x⟩
/-- The restriction of a regular measure to a set of finite measure is regular. -/
theorem restrict_of_measure_ne_top [ClosableCompactSubsetOpenSpace α] [BorelSpace α] [Regular μ]
    {A : Set α} (h'A : μ A ≠ ∞) : Regular (μ.restrict A) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁴ : MeasurableSpace α
inst✝³ : TopologicalSpace α
μ : Measure α
inst✝² : ClosableCompactSubsetOpenSpace α
inst✝¹ : BorelSpace α
inst✝ : Regular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
⊢ Regular (restrict μ A)

Next tactic:
have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A