l3lab/ntp-mathlib huggingface dataset:
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  

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

Next tactic:
constructor
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  constructor
  

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

Next tactic:
intro V hV r hr
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  constructor
  intro V hV r hr
  

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

Next tactic:
have R : restrict μ A V ≠ ∞ := by
    rw [restrict_apply hV.measurableSet]
    exact ((measure_mono (inter_subset_right _ _)).trans_lt h'A.lt_top).ne
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  constructor
  intro V hV r hr
  have R : restrict μ A V ≠ ∞ := 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 ≠ ⊤
this : WeaklyRegular (restrict μ A)
V : Set α
hV : IsOpen V
r : ℝ≥0∞
hr : r < ↑↑(restrict μ A) V
⊢ ↑↑(restrict μ A) V ≠ ⊤

Next tactic:
rw [restrict_apply hV.measurableSet]
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  constructor
  intro V hV r hr
  have R : restrict μ A V ≠ ∞ := by
    rw [restrict_apply hV.measurableSet]
    

Proof state:
α : Type u_1
β : Type u_2
inst✝⁴ : MeasurableSpace α
inst✝³ : TopologicalSpace α
μ : Measure α
inst✝² : ClosableCompactSubsetOpenSpace α
inst✝¹ : BorelSpace α
inst✝ : Regular μ
A : Set α
h'A : ↑↑μ A ≠ ⊤
this : WeaklyRegular (restrict μ A)
V : Set α
hV : IsOpen V
r : ℝ≥0∞
hr : r < ↑↑(restrict μ A) V
⊢ ↑↑μ (V ∩ A) ≠ ⊤

Next tactic:
exact ((measure_mono (inter_subset_right _ _)).trans_lt h'A.lt_top).ne
/-- 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
  have : WeaklyRegular (μ.restrict A) := WeaklyRegular.restrict_of_measure_ne_top h'A
  constructor
  intro V hV r hr
  have R : restrict μ A V ≠ ∞ := by
    rw [restrict_apply hV.measurableSet]
    exact ((measure_mono (inter_subset_right _ _)).trans_lt h'A.lt_top).ne
  

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

Next tactic:
exact MeasurableSet.exists_lt_isCompact_of_ne_top hV.measurableSet R hr
/-- 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 μ := 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✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : IsLocallyFiniteMeasure μ
⊢ Regular μ

Next tactic:
let A : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X
/-- 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 μ := by
  let A : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : IsLocallyFiniteMeasure μ
A : PseudoMetricSpace X := pseudoMetrizableSpacePseudoMetric X
⊢ Regular μ

Next tactic:
exact ⟨(InnerRegularWRT.isCompact_isClosed μ).trans (InnerRegularWRT.of_pseudoMetrizableSpace μ)⟩
/-- 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 μ := 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✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : SigmaFinite μ
⊢ InnerRegular μ

Next tactic:
refine ⟨(InnerRegularWRT.isCompact_isClosed μ).trans ?_⟩
/-- 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 μ := by
  refine ⟨(InnerRegularWRT.isCompact_isClosed μ).trans ?_⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : SigmaFinite μ
⊢ InnerRegularWRT μ IsClosed fun s => MeasurableSet s

Next tactic:
refine InnerRegularWRT.of_restrict (fun n ↦ ?_)
    (univ_subset_iff.2 (iUnion_spanningSets μ)) (monotone_spanningSets μ)
/-- 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 μ := by
  refine ⟨(InnerRegularWRT.isCompact_isClosed μ).trans ?_⟩
  refine InnerRegularWRT.of_restrict (fun n ↦ ?_)
    (univ_subset_iff.2 (iUnion_spanningSets μ)) (monotone_spanningSets μ)
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : SigmaFinite μ
n : ℕ
⊢ InnerRegularWRT (restrict μ (spanningSets μ n)) IsClosed MeasurableSet

Next tactic:
have : Fact (μ (spanningSets μ n) < ∞) := ⟨measure_spanningSets_lt_top μ n⟩
/-- 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 μ := by
  refine ⟨(InnerRegularWRT.isCompact_isClosed μ).trans ?_⟩
  refine InnerRegularWRT.of_restrict (fun n ↦ ?_)
    (univ_subset_iff.2 (iUnion_spanningSets μ)) (monotone_spanningSets μ)
  have : Fact (μ (spanningSets μ n) < ∞) := ⟨measure_spanningSets_lt_top μ n⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
μ✝ : Measure α
X : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : PseudoMetrizableSpace X
inst✝³ : SigmaCompactSpace X
inst✝² : MeasurableSpace X
inst✝¹ : BorelSpace X
μ : Measure X
inst✝ : SigmaFinite μ
n : ℕ
this : Fact (↑↑μ (spanningSets μ n) < ⊤)
⊢ InnerRegularWRT (restrict μ (spanningSets μ n)) IsClosed MeasurableSet

Next tactic:
exact WeaklyRegular.innerRegular_measurable.trans InnerRegularWRT.of_sigmaFinite
example [LocallyCompactSpace α] [RegularSpace α] [BorelSpace α] [SecondCountableTopology α]
    (μ : Measure α) [IsFiniteMeasureOnCompacts μ] : Regular μ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝⁶ : MeasurableSpace α
inst✝⁵ : TopologicalSpace α
μ✝ : Measure α
inst✝⁴ : LocallyCompactSpace α
inst✝³ : RegularSpace α
inst✝² : BorelSpace α
inst✝¹ : SecondCountableTopology α
μ : Measure α
inst✝ : IsFiniteMeasureOnCompacts μ
⊢ Regular μ

Next tactic:
infer_instance
example [LocallyCompactSpace α] [RegularSpace α] [BorelSpace α] [SecondCountableTopology α]
    (μ : Measure α) [IsFiniteMeasureOnCompacts μ] : InnerRegular μ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝⁶ : MeasurableSpace α
inst✝⁵ : TopologicalSpace α
μ✝ : Measure α
inst✝⁴ : LocallyCompactSpace α
inst✝³ : RegularSpace α
inst✝² : BorelSpace α
inst✝¹ : SecondCountableTopology α
μ : Measure α
inst✝ : IsFiniteMeasureOnCompacts μ
⊢ InnerRegular μ

Next tactic:
infer_instance
theorem comp_injOn {g : ι' → ι} (hf : LocallyFinite f) (hg : InjOn g { i | (f (g i)).Nonempty }) :
    LocallyFinite (f ∘ g) := fun x => by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : ι' → ι
hf : LocallyFinite f
hg : InjOn g {i | Set.Nonempty (f (g i))}
x : X
⊢ ∃ t ∈ 𝓝 x, Set.Finite {i | Set.Nonempty ((f ∘ g) i ∩ t)}

Next tactic:
let ⟨t, htx, htf⟩ := hf x
theorem comp_injOn {g : ι' → ι} (hf : LocallyFinite f) (hg : InjOn g { i | (f (g i)).Nonempty }) :
    LocallyFinite (f ∘ g) := fun x => by
  let ⟨t, htx, htf⟩ := hf x
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : ι' → ι
hf : LocallyFinite f
hg : InjOn g {i | Set.Nonempty (f (g i))}
x : X
t : Set X
htx : t ∈ 𝓝 x
htf : Set.Finite {i | Set.Nonempty (f i ∩ t)}
⊢ ∃ t ∈ 𝓝 x, Set.Finite {i | Set.Nonempty ((f ∘ g) i ∩ t)}

Next tactic:
refine ⟨t, htx, htf.preimage <| ?_⟩
theorem comp_injOn {g : ι' → ι} (hf : LocallyFinite f) (hg : InjOn g { i | (f (g i)).Nonempty }) :
    LocallyFinite (f ∘ g) := fun x => by
  let ⟨t, htx, htf⟩ := hf x
  refine ⟨t, htx, htf.preimage <| ?_⟩
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : ι' → ι
hf : LocallyFinite f
hg : InjOn g {i | Set.Nonempty (f (g i))}
x : X
t : Set X
htx : t ∈ 𝓝 x
htf : Set.Finite {i | Set.Nonempty (f i ∩ t)}
⊢ InjOn (fun i => g i) ((fun i => g i) ⁻¹' {i | Set.Nonempty (f i ∩ t)})

Next tactic:
exact hg.mono fun i (hi : Set.Nonempty _) => hi.left
protected theorem nhdsWithin_iUnion (hf : LocallyFinite f) (a : X) :
    𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
a : X
⊢ 𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a

Next tactic:
rcases hf a with ⟨U, haU, hfin⟩
protected theorem nhdsWithin_iUnion (hf : LocallyFinite f) (a : X) :
    𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a := by
  rcases hf a with ⟨U, haU, hfin⟩
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
a : X
U : Set X
haU : U ∈ 𝓝 a
hfin : Set.Finite {i | Set.Nonempty (f i ∩ U)}
⊢ 𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a

Next tactic:
refine le_antisymm ?_ (Monotone.le_map_iSup fun _ _ ↦ nhdsWithin_mono _)
protected theorem nhdsWithin_iUnion (hf : LocallyFinite f) (a : X) :
    𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a := by
  rcases hf a with ⟨U, haU, hfin⟩
  refine le_antisymm ?_ (Monotone.le_map_iSup fun _ _ ↦ nhdsWithin_mono _)
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
a : X
U : Set X
haU : U ∈ 𝓝 a
hfin : Set.Finite {i | Set.Nonempty (f i ∩ U)}
⊢ 𝓝[⋃ i, f i] a ≤ ⨆ i, 𝓝[f i] a

Next tactic:
calc
    𝓝[⋃ i, f i] a = 𝓝[⋃ i, f i ∩ U] a := by
      rw [← iUnion_inter, ← nhdsWithin_inter_of_mem' (nhdsWithin_le_nhds haU)]
    _ = 𝓝[⋃ i ∈ {j | (f j ∩ U).Nonempty}, (f i ∩ U)] a := by
      simp only [mem_setOf_eq, iUnion_nonempty_self]
    _ = ⨆ i ∈ {j | (f j ∩ U).Nonempty}, 𝓝[f i ∩ U] a := nhdsWithin_biUnion hfin _ _
    _ ≤ ⨆ i, 𝓝[f i ∩ U] a := iSup₂_le_iSup _ _
    _ ≤ ⨆ i, 𝓝[f i] a := iSup_mono fun i ↦ nhdsWithin_mono _ <| inter_subset_left _ _
protected theorem nhdsWithin_iUnion (hf : LocallyFinite f) (a : X) :
    𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a := by
  rcases hf a with ⟨U, haU, hfin⟩
  refine le_antisymm ?_ (Monotone.le_map_iSup fun _ _ ↦ nhdsWithin_mono _)
  calc
    𝓝[⋃ i, f i] a = 𝓝[⋃ i, f i ∩ U] a := by
      

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
a : X
U : Set X
haU : U ∈ 𝓝 a
hfin : Set.Finite {i | Set.Nonempty (f i ∩ U)}
⊢ 𝓝[⋃ i, f i] a = 𝓝[⋃ i, f i ∩ U] a

Next tactic:
rw [← iUnion_inter, ← nhdsWithin_inter_of_mem' (nhdsWithin_le_nhds haU)]
protected theorem nhdsWithin_iUnion (hf : LocallyFinite f) (a : X) :
    𝓝[⋃ i, f i] a = ⨆ i, 𝓝[f i] a := by
  rcases hf a with ⟨U, haU, hfin⟩
  refine le_antisymm ?_ (Monotone.le_map_iSup fun _ _ ↦ nhdsWithin_mono _)
  calc
    𝓝[⋃ i, f i] a = 𝓝[⋃ i, f i ∩ U] a := by
      rw [← iUnion_inter, ← nhdsWithin_inter_of_mem' (nhdsWithin_le_nhds haU)]
    _ = 𝓝[⋃ i ∈ {j | (f j ∩ U).Nonempty}, (f i ∩ U)] a := by
      

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
a : X
U : Set X
haU : U ∈ 𝓝 a
hfin : Set.Finite {i | Set.Nonempty (f i ∩ U)}
⊢ 𝓝[⋃ i, f i ∩ U] a = 𝓝[⋃ i ∈ {j | Set.Nonempty (f j ∩ U)}, f i ∩ U] a

Next tactic:
simp only [mem_setOf_eq, iUnion_nonempty_self]
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
⊢ ContinuousOn g (⋃ i, f i)

Next tactic:
rintro x -
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
⊢ ContinuousWithinAt g (⋃ i, f i) x

Next tactic:
rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
⊢ ∀ (i : ι), Tendsto g (𝓝[f i] x) (𝓝 (g x))

Next tactic:
intro i
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  intro i
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
i : ι
⊢ Tendsto g (𝓝[f i] x) (𝓝 (g x))

Next tactic:
by_cases hx : x ∈ closure (f i)
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  intro i
  by_cases hx : x ∈ closure (f i)
  · 

Proof state:
case pos
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
i : ι
hx : x ∈ closure (f i)
⊢ Tendsto g (𝓝[f i] x) (𝓝 (g x))

Next tactic:
exact hc i _ hx
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  intro i
  by_cases hx : x ∈ closure (f i)
  · exact hc i _ hx
  · 

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
i : ι
hx : x ∉ closure (f i)
⊢ Tendsto g (𝓝[f i] x) (𝓝 (g x))

Next tactic:
rw [mem_closure_iff_nhdsWithin_neBot, not_neBot] at hx
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  intro i
  by_cases hx : x ∈ closure (f i)
  · exact hc i _ hx
  · rw [mem_closure_iff_nhdsWithin_neBot, not_neBot] at hx
    

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
i : ι
hx : 𝓝[f i] x = ⊥
⊢ Tendsto g (𝓝[f i] x) (𝓝 (g x))

Next tactic:
rw [hx]
theorem continuousOn_iUnion' {g : X → Y} (hf : LocallyFinite f)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    ContinuousOn g (⋃ i, f i) := by
  rintro x -
  rw [ContinuousWithinAt, hf.nhdsWithin_iUnion, tendsto_iSup]
  intro i
  by_cases hx : x ∈ closure (f i)
  · exact hc i _ hx
  · rw [mem_closure_iff_nhdsWithin_neBot, not_neBot] at hx
    rw [hx]
    

Proof state:
case neg
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g✝ : ι → Set X
g : X → Y
hf : LocallyFinite f
hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x
x : X
i : ι
hx : 𝓝[f i] x = ⊥
⊢ Tendsto g ⊥ (𝓝 (g x))

Next tactic:
exact tendsto_bot
protected theorem closure (hf : LocallyFinite f) : LocallyFinite fun i => closure (f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
⊢ LocallyFinite fun i => closure (f i)

Next tactic:
intro x
protected theorem closure (hf : LocallyFinite f) : LocallyFinite fun i => closure (f i) := by
  intro x
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
x : X
⊢ ∃ t ∈ 𝓝 x, Set.Finite {i | Set.Nonempty ((fun i => closure (f i)) i ∩ t)}

Next tactic:
rcases hf x with ⟨s, hsx, hsf⟩
protected theorem closure (hf : LocallyFinite f) : LocallyFinite fun i => closure (f i) := by
  intro x
  rcases hf x with ⟨s, hsx, hsf⟩
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
x : X
s : Set X
hsx : s ∈ 𝓝 x
hsf : Set.Finite {i | Set.Nonempty (f i ∩ s)}
⊢ ∃ t ∈ 𝓝 x, Set.Finite {i | Set.Nonempty ((fun i => closure (f i)) i ∩ t)}

Next tactic:
refine' ⟨interior s, interior_mem_nhds.2 hsx, hsf.subset fun i hi => _⟩
protected theorem closure (hf : LocallyFinite f) : LocallyFinite fun i => closure (f i) := by
  intro x
  rcases hf x with ⟨s, hsx, hsf⟩
  refine' ⟨interior s, interior_mem_nhds.2 hsx, hsf.subset fun i hi => _⟩
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
x : X
s : Set X
hsx : s ∈ 𝓝 x
hsf : Set.Finite {i | Set.Nonempty (f i ∩ s)}
i : ι
hi : i ∈ {i | Set.Nonempty ((fun i => closure (f i)) i ∩ interior s)}
⊢ i ∈ {i | Set.Nonempty (f i ∩ s)}

Next tactic:
exact (hi.mono isOpen_interior.closure_inter).of_closure.mono
    (inter_subset_inter_right _ interior_subset)
theorem closure_iUnion (h : LocallyFinite f) : closure (⋃ i, f i) = ⋃ i, closure (f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
h : LocallyFinite f
⊢ closure (⋃ i, f i) = ⋃ i, closure (f i)

Next tactic:
ext x
theorem closure_iUnion (h : LocallyFinite f) : closure (⋃ i, f i) = ⋃ i, closure (f i) := by
  ext x
  

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
h : LocallyFinite f
x : X
⊢ x ∈ closure (⋃ i, f i) ↔ x ∈ ⋃ i, closure (f i)

Next tactic:
simp only [mem_closure_iff_nhdsWithin_neBot, h.nhdsWithin_iUnion, iSup_neBot, mem_iUnion]
theorem isClosed_iUnion (hf : LocallyFinite f) (hc : ∀ i, IsClosed (f i)) :
    IsClosed (⋃ i, f i) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
X : Type u_4
Y : Type u_5
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f g : ι → Set X
hf : LocallyFinite f
hc : ∀ (i : ι), IsClosed (f i)
⊢ IsClosed (⋃ i, f i)

Next tactic:
simp only [← closure_eq_iff_isClosed, hf.closure_iUnion, (hc _).closure_eq]