-- Mathlib/Geometry/Manifold/PartitionOfUnity.lean
theorem exists_smooth_zero_one_nhds_of_isClosed [T2Space M] [NormalSpace M] [SigmaCompactSpace M]
    {s t : Set M} (hs : IsClosed s) (ht : IsClosed t) (hd : Disjoint s t) :
    ∃ f : C^∞⟮I, M; 𝓘(ℝ), ℝ⟯, (∀ᶠ x in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ x in 𝓝ˢ t, f x = 1) ∧
      ∀ x, f x ∈ Icc 0 1

Proof state:
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
⊢ ∃ f, (∀ᶠ (x : M) in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ (x : M) in 𝓝ˢ t, f x = 1) ∧ ∀ (x : M), f x ∈ Icc 0 1

Tactic:
obtain ⟨u, u_op, hsu, hut⟩ := normal_exists_closure_subset hs ht.isOpen_compl
  (subset_compl_iff_disjoint_left.mpr hd.symm)

Result:
case intro.intro.intro
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
⊢ ∃ f, (∀ᶠ (x : M) in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ (x : M) in 𝓝ˢ t, f x = 1) ∧ ∀ (x : M), f x ∈ Icc 0 1

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∃ f, (∀ᶠ (x : M) in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ (x : M) in 𝓝ˢ t, f x = 1) ∧ ∀ (x : M), f x ∈ Icc 0 1

Tactic:
refine ⟨f, ?_, ?_, hf⟩

Result:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∀ᶠ (x : M) in 𝓝ˢ s, f x = 0

case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∀ᶠ (x : M) in 𝓝ˢ t, f x = 1

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∀ᶠ (x : M) in 𝓝ˢ s, f x = 0

Tactic:
exact eventually_of_mem (mem_of_superset (u_op.mem_nhdsSet.mpr hsu) subset_closure) hfu

Result:
no goals

Proof state:
case intro.intro.intro.intro.intro.intro
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
⊢ ∃ f, (∀ᶠ (x : M) in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ (x : M) in 𝓝ˢ t, f x = 1) ∧ ∀ (x : M), f x ∈ Icc 0 1

Tactic:
obtain ⟨f, hfu, hfv, hf⟩ := exists_smooth_zero_one_of_isClosed I isClosed_closure isClosed_closure
  (subset_compl_iff_disjoint_left.mp hvu)

Result:
case intro.intro.intro.intro.intro.intro.intro.intro.intro
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∃ f, (∀ᶠ (x : M) in 𝓝ˢ s, f x = 0) ∧ (∀ᶠ (x : M) in 𝓝ˢ t, f x = 1) ∧ ∀ (x : M), f x ∈ Icc 0 1

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
E : Type uE
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace ℝ E
H : Type uH
inst✝⁷ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : FiniteDimensional ℝ E
inst✝³ : IsManifold I ∞ M
inst✝² : T2Space M
inst✝¹ : NormalSpace M
inst✝ : SigmaCompactSpace M
s t : Set M
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
u : Set M
u_op : IsOpen u
hsu : s ⊆ u
hut : closure u ⊆ tᶜ
v : Set M
v_op : IsOpen v
htv : t ⊆ v
hvu : closure v ⊆ (closure u)ᶜ
f : C^∞⟮I, M; 𝓘(ℝ, ℝ), ℝ⟯
hfu : EqOn (⇑f) 0 (closure u)
hfv : EqOn (⇑f) 1 (closure v)
hf : ∀ (x : M), f x ∈ Icc 0 1
⊢ ∀ᶠ (x : M) in 𝓝ˢ t, f x = 1

Tactic:
exact eventually_of_mem (mem_of_superset (v_op.mem_nhdsSet.mpr htv) subset_closure) hfv

Result:
no goals