l3lab/ntp-mathlib huggingface dataset:
/-- 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 ≠ ∞) := by
  rintro s ⟨s_meas, hs⟩ r hr
  rw [restrict_apply s_meas] at hs
  obtain ⟨K, K_subs, pK, rK⟩ : ∃ K, K ⊆ (toMeasurable μ (s ∩ A)) ∩ s ∧ p K ∧ r < μ K := by
    have : r < μ ((toMeasurable μ (s ∩ A)) ∩ s) := by
      apply hr.trans_le
      rw [restrict_apply s_meas]
      exact measure_mono <| subset_inter (subset_toMeasurable μ (s ∩ A)) (inter_subset_left _ _)
    refine h ⟨(measurableSet_toMeasurable _ _).inter s_meas, ?_⟩ _ this
    apply (lt_of_le_of_lt _ hs.lt_top).ne
    rw [← measure_toMeasurable (s ∩ A)]
    exact measure_mono (inter_subset_left _ _)
  refine ⟨K, K_subs.trans (inter_subset_right _ _), pK, ?_⟩
  calc
  r < μ K := rK
  _ = μ.restrict (toMeasurable μ (s ∩ A)) K := by
    rw [restrict_apply' (measurableSet_toMeasurable μ (s ∩ A))]
    congr
    apply (inter_eq_left.2 ?_).symm
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
h : InnerRegularWRT μ p fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤
A s : Set α
s_meas : MeasurableSet s
hs : ↑↑μ (s ∩ A) ≠ ⊤
r : ℝ≥0∞
hr : r < ↑↑(Measure.restrict μ A) s
K : Set α
K_subs : K ⊆ toMeasurable μ (s ∩ A) ∩ s
pK : p K
rK : r < ↑↑μ K
⊢ K ⊆ toMeasurable μ (s ∩ A)

Next tactic:
exact K_subs.trans (inter_subset_left _ _)
/-- 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 ≠ ∞) := by
  rintro s ⟨s_meas, hs⟩ r hr
  rw [restrict_apply s_meas] at hs
  obtain ⟨K, K_subs, pK, rK⟩ : ∃ K, K ⊆ (toMeasurable μ (s ∩ A)) ∩ s ∧ p K ∧ r < μ K := by
    have : r < μ ((toMeasurable μ (s ∩ A)) ∩ s) := by
      apply hr.trans_le
      rw [restrict_apply s_meas]
      exact measure_mono <| subset_inter (subset_toMeasurable μ (s ∩ A)) (inter_subset_left _ _)
    refine h ⟨(measurableSet_toMeasurable _ _).inter s_meas, ?_⟩ _ this
    apply (lt_of_le_of_lt _ hs.lt_top).ne
    rw [← measure_toMeasurable (s ∩ A)]
    exact measure_mono (inter_subset_left _ _)
  refine ⟨K, K_subs.trans (inter_subset_right _ _), pK, ?_⟩
  calc
  r < μ K := rK
  _ = μ.restrict (toMeasurable μ (s ∩ A)) K := by
    rw [restrict_apply' (measurableSet_toMeasurable μ (s ∩ A))]
    congr
    apply (inter_eq_left.2 ?_).symm
    exact K_subs.trans (inter_subset_left _ _)
  _ = μ.restrict (s ∩ A) K := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
h : InnerRegularWRT μ p fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤
A s : Set α
s_meas : MeasurableSet s
hs : ↑↑μ (s ∩ A) ≠ ⊤
r : ℝ≥0∞
hr : r < ↑↑(Measure.restrict μ A) s
K : Set α
K_subs : K ⊆ toMeasurable μ (s ∩ A) ∩ s
pK : p K
rK : r < ↑↑μ K
⊢ ↑↑(Measure.restrict μ (toMeasurable μ (s ∩ A))) K = ↑↑(Measure.restrict μ (s ∩ A)) K

Next tactic:
rwa [restrict_toMeasurable]
/-- 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) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s : Set α
ε r : ℝ≥0∞
h : InnerRegularWRT μ p fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤
A : Set α
hA : ↑↑μ A ≠ ⊤
⊢ InnerRegularWRT (Measure.restrict μ A) p fun s => MeasurableSet s

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

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : MeasurableSpace α
inst✝ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s : Set α
ε r : ℝ≥0∞
h : InnerRegularWRT μ p fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤
A : Set α
hA : ↑↑μ A ≠ ⊤
this : Fact (↑↑μ A < ⊤)
⊢ InnerRegularWRT (Measure.restrict μ A) p fun s => MeasurableSet s

Next tactic:
exact (restrict h A).trans (of_imp (fun s hs ↦ ⟨hs, measure_ne_top _ _⟩))
/-- 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) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s : Set α
ε r : ℝ≥0∞
inst✝ : SigmaFinite μ
⊢ InnerRegularWRT μ (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) fun s => MeasurableSet s

Next tactic:
intro s hs r hr
/-- 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) := by
  intro s hs r hr
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
set B : ℕ → Set α := spanningSets μ
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
⊢ ⋃ n, s ∩ B n = s

Next tactic:
rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
hBU : ⋃ n, s ∩ B n = s
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
hBU : ⋃ n, s ∩ B n = s
⊢ ↑↑μ s = ⨆ n, ↑↑μ (s ∩ B n)

Next tactic:
rw [← measure_iUnion_eq_iSup, hBU]
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
hBU : ⋃ n, s ∩ B n = s
⊢ Directed (fun x x_1 => x ⊆ x_1) fun n => s ∩ B n

Next tactic:
exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
hr : r < ↑↑μ s
B : ℕ → Set α := spanningSets μ
hBU : ⋃ n, s ∩ B n = s
this : ↑↑μ s = ⨆ n, ↑↑μ (s ∩ B n)
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
rw [this] at hr
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
  rw [this] at hr
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
B : ℕ → Set α := spanningSets μ
hr : r < ⨆ n, ↑↑μ (s ∩ B n)
hBU : ⋃ n, s ∩ B n = s
this : ↑↑μ s = ⨆ n, ↑↑μ (s ∩ B n)
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
rcases lt_iSup_iff.1 hr with ⟨n, hn⟩
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
  rw [this] at hr
  rcases lt_iSup_iff.1 hr with ⟨n, hn⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
B : ℕ → Set α := spanningSets μ
hr : r < ⨆ n, ↑↑μ (s ∩ B n)
hBU : ⋃ n, s ∩ B n = s
this : ↑↑μ s = ⨆ n, ↑↑μ (s ∩ B n)
n : ℕ
hn : r < ↑↑μ (s ∩ B n)
⊢ ∃ K ⊆ s, (fun s => MeasurableSet s ∧ ↑↑μ s ≠ ⊤) K ∧ r < ↑↑μ K

Next tactic:
refine ⟨s ∩ B n, inter_subset_left _ _, ⟨hs.inter (measurable_spanningSets μ n), ?_⟩, hn⟩
/-- 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) := by
  intro s hs r hr
  set B : ℕ → Set α := spanningSets μ
  have hBU : ⋃ n, s ∩ B n = s := by rw [← inter_iUnion, iUnion_spanningSets, inter_univ]
  have : μ s = ⨆ n, μ (s ∩ B n) := by
    rw [← measure_iUnion_eq_iSup, hBU]
    exact Monotone.directed_le fun m n h => inter_subset_inter_right _ (monotone_spanningSets μ h)
  rw [this] at hr
  rcases lt_iSup_iff.1 hr with ⟨n, hn⟩
  refine ⟨s ∩ B n, inter_subset_left _ _, ⟨hs.inter (measurable_spanningSets μ n), ?_⟩, hn⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
p q : Set α → Prop
U s✝ : Set α
ε r✝ : ℝ≥0∞
inst✝ : SigmaFinite μ
s : Set α
hs : MeasurableSet s
r : ℝ≥0∞
B : ℕ → Set α := spanningSets μ
hr : r < ⨆ n, ↑↑μ (s ∩ B n)
hBU : ⋃ n, s ∩ B n = s
this : ↑↑μ s = ⨆ n, ↑↑μ (s ∩ B n)
n : ℕ
hn : r < ↑↑μ (s ∩ B n)
⊢ ↑↑μ (s ∩ B n) ≠ ⊤

Next tactic:
exact ((measure_mono (inter_subset_right _ _)).trans_lt (measure_spanningSets_lt_top μ n)).ne
lemma innerRegularWRT_isClosed_isOpen [ClosableCompactSubsetOpenSpace α] [OpensMeasurableSpace α]
    [h : InnerRegular μ] : InnerRegularWRT μ IsClosed IsOpen := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
U : Set α
ε : ℝ≥0∞
inst✝¹ : ClosableCompactSubsetOpenSpace α
inst✝ : OpensMeasurableSpace α
h : InnerRegular μ
⊢ InnerRegularWRT μ IsClosed IsOpen

Next tactic:
intro U hU r hr
lemma innerRegularWRT_isClosed_isOpen [ClosableCompactSubsetOpenSpace α] [OpensMeasurableSpace α]
    [h : InnerRegular μ] : InnerRegularWRT μ IsClosed IsOpen := by
  intro U hU r hr
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
U✝ : Set α
ε : ℝ≥0∞
inst✝¹ : ClosableCompactSubsetOpenSpace α
inst✝ : OpensMeasurableSpace α
h : InnerRegular μ
U : Set α
hU : IsOpen U
r : ℝ≥0∞
hr : r < ↑↑μ U
⊢ ∃ K ⊆ U, IsClosed K ∧ r < ↑↑μ K

Next tactic:
rcases h.innerRegular hU.measurableSet r hr with ⟨K, KU, K_comp, hK⟩
lemma innerRegularWRT_isClosed_isOpen [ClosableCompactSubsetOpenSpace α] [OpensMeasurableSpace α]
    [h : InnerRegular μ] : InnerRegularWRT μ IsClosed IsOpen := by
  intro U hU r hr
  rcases h.innerRegular hU.measurableSet r hr with ⟨K, KU, K_comp, hK⟩
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝³ : MeasurableSpace α
inst✝² : TopologicalSpace α
μ : Measure α
U✝ : Set α
ε : ℝ≥0∞
inst✝¹ : ClosableCompactSubsetOpenSpace α
inst✝ : OpensMeasurableSpace α
h : InnerRegular μ
U : Set α
hU : IsOpen U
r : ℝ≥0∞
hr : r < ↑↑μ U
K : Set α
KU : K ⊆ U
K_comp : IsCompact K
hK : r < ↑↑μ K
⊢ ∃ K ⊆ U, IsClosed K ∧ r < ↑↑μ K

Next tactic:
exact ⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure,
    hK.trans_le (measure_mono subset_closure)⟩
theorem exists_compact_not_null [InnerRegular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
U : Set α
ε : ℝ≥0∞
inst✝ : InnerRegular μ
⊢ (∃ K, IsCompact K ∧ ↑↑μ K ≠ 0) ↔ μ ≠ 0

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

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
U : Set α
ε : ℝ≥0∞
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
⊢ InnerRegular (map (⇑f) μ) ↔ InnerRegular μ

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

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
U : Set α
ε : ℝ≥0∞
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : InnerRegular (map (⇑f) μ)
⊢ InnerRegular μ

Next tactic:
convert h.map f.symm
protected theorem map_iff [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) :
    InnerRegular (Measure.map f μ) ↔ InnerRegular μ := 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 α
U : Set α
ε : ℝ≥0∞
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : InnerRegular (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 : α ≃ₜ β) :
    InnerRegular (Measure.map f μ) ↔ InnerRegular μ := 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 α
U : Set α
ε : ℝ≥0∞
inst✝³ : BorelSpace α
inst✝² : MeasurableSpace β
inst✝¹ : TopologicalSpace β
inst✝ : BorelSpace β
f : α ≃ₜ β
h : InnerRegular (map (⇑f) μ)
⊢ μ = map (⇑(Homeomorph.symm f) ∘ ⇑f) μ

Next tactic:
simp
/-- 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) < ε := by
  

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

Next tactic:
rcases hA.exists_isCompact_lt_add h'A hε with ⟨K, hKA, hKc, hK⟩
/-- 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) < ε := by
  rcases hA.exists_isCompact_lt_add h'A hε with ⟨K, hKA, hKc, hK⟩
  

Proof state:
case intro.intro.intro
α : Type u_1
β : Type u_2
inst✝⁴ : MeasurableSpace α
inst✝³ : TopologicalSpace α
μ : Measure α
inst✝² : OpensMeasurableSpace α
inst✝¹ : T2Space α
inst✝ : InnerRegularCompactLTTop μ
A : Set α
hA : MeasurableSet A
h'A : ↑↑μ A ≠ ⊤
ε : ℝ≥0∞
hε : ε ≠ 0
K : Set α
hKA : K ⊆ A
hKc : IsCompact K
hK : ↑↑μ A < ↑↑μ K + ε
⊢ ∃ K ⊆ A, IsCompact K ∧ ↑↑μ (A \ K) < ε

Next tactic:
exact
    ⟨K, hKA, hKc,
      measure_diff_lt_of_lt_add hKc.measurableSet hKA (ne_top_of_le_ne_top h'A <| measure_mono hKA)
        hK⟩
instance (priority := 50) [h : InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] :
    InnerRegular μ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
⊢ InnerRegular μ

Next tactic:
constructor
instance (priority := 50) [h : InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] :
    InnerRegular μ := by
  constructor
  

Proof state:
case innerRegular
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
⊢ InnerRegularWRT μ IsCompact fun s => MeasurableSet s

Next tactic:
convert h.innerRegular with s
instance (priority := 50) [h : InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] :
    InnerRegular μ := by
  constructor
  convert h.innerRegular with s
  

Proof state:
case h.e'_5.h.a
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : TopologicalSpace α
μ : Measure α
h : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
s : Set α
⊢ MeasurableSet s ↔ MeasurableSet s ∧ ↑↑μ s ≠ ⊤

Next tactic:
simp [measure_ne_top μ s]
instance (priority := 50) [BorelSpace α] [ClosableCompactSubsetOpenSpace α]
    [InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] : WeaklyRegular μ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : ClosableCompactSubsetOpenSpace α
inst✝¹ : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
⊢ WeaklyRegular μ

Next tactic:
apply InnerRegularWRT.weaklyRegular_of_finite
instance (priority := 50) [BorelSpace α] [ClosableCompactSubsetOpenSpace α]
    [InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] : WeaklyRegular μ := by
  apply InnerRegularWRT.weaklyRegular_of_finite
  

Proof state:
case H
α : Type u_1
β : Type u_2
inst✝⁵ : MeasurableSpace α
inst✝⁴ : TopologicalSpace α
μ : Measure α
inst✝³ : BorelSpace α
inst✝² : ClosableCompactSubsetOpenSpace α
inst✝¹ : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
⊢ InnerRegularWRT μ IsClosed IsOpen

Next tactic:
exact InnerRegular.innerRegularWRT_isClosed_isOpen
instance (priority := 50) [BorelSpace α] [ClosableCompactSubsetOpenSpace α]
    [h : InnerRegularCompactLTTop μ] [IsFiniteMeasure μ] : Regular μ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁴ : MeasurableSpace α
inst✝³ : TopologicalSpace α
μ : Measure α
inst✝² : BorelSpace α
inst✝¹ : ClosableCompactSubsetOpenSpace α
h : InnerRegularCompactLTTop μ
inst✝ : IsFiniteMeasure μ
⊢ Regular μ

Next tactic:
constructor