Theorem: Measurable.exists_continuous
File: Mathlib/MeasureTheory/Constructions/Polish.lean

tactic: obtain ⟨b, b_count, -, hb⟩ : ∃ b : Set (Set β), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b :=
  exists_countable_basis β
state_before: α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: haveI : Encodable b := b_count.toEncodable
state_before: case intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: have : ∀ s : b, IsClopenable (f ⁻¹' s) := by
  intro s
  apply MeasurableSet.isClopenable
  exact hf (hb.isOpen s.2).measurableSet
state_before: case intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: choose T Tt Tpolish _ Topen using this
state_before: case intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this✝ : Encodable ↑b
this : ∀ (s : ↑b), IsClopenable (f ⁻¹' ↑s)
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: obtain ⟨t', t'T, t't, t'_polish⟩ :
  ∃ t' : TopologicalSpace α, (∀ i, t' ≤ T i) ∧ t' ≤ t ∧ @PolishSpace α t' :=
  exists_polishSpace_forall_le T Tt Tpolish
state_before: case intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
T : ↑b → TopologicalSpace α
Tt : ∀ (s : ↑b), T s ≤ t
Tpolish : ∀ (s : ↑b), PolishSpace α
h✝ : ∀ (s : ↑b), IsClosed (f ⁻¹' ↑s)
Topen : ∀ (s : ↑b), IsOpen (f ⁻¹' ↑s)
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: refine' ⟨t', t't, _, t'_polish⟩
state_before: case intro.intro.intro.intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
T : ↑b → TopologicalSpace α
Tt : ∀ (s : ↑b), T s ≤ t
Tpolish : ∀ (s : ↑b), PolishSpace α
h✝ : ∀ (s : ↑b), IsClosed (f ⁻¹' ↑s)
Topen : ∀ (s : ↑b), IsOpen (f ⁻¹' ↑s)
t' : TopologicalSpace α
t'T : ∀ (i : ↑b), t' ≤ T i
t't : t' ≤ t
t'_polish : PolishSpace α
⊢ ∃ t', t' ≤ t ∧ Continuous f ∧ PolishSpace α

tactic: refine hb.continuous _ fun s hs => ?_
state_before: case intro.intro.intro.intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
T : ↑b → TopologicalSpace α
Tt : ∀ (s : ↑b), T s ≤ t
Tpolish : ∀ (s : ↑b), PolishSpace α
h✝ : ∀ (s : ↑b), IsClosed (f ⁻¹' ↑s)
Topen : ∀ (s : ↑b), IsOpen (f ⁻¹' ↑s)
t' : TopologicalSpace α
t'T : ∀ (i : ↑b), t' ≤ T i
t't : t' ≤ t
t'_polish : PolishSpace α
⊢ Continuous f

tactic: exact t'T ⟨s, hs⟩ _ (Topen ⟨s, hs⟩)
state_before: case intro.intro.intro.intro.intro.intro
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
T : ↑b → TopologicalSpace α
Tt : ∀ (s : ↑b), T s ≤ t
Tpolish : ∀ (s : ↑b), PolishSpace α
h✝ : ∀ (s : ↑b), IsClosed (f ⁻¹' ↑s)
Topen : ∀ (s : ↑b), IsOpen (f ⁻¹' ↑s)
t' : TopologicalSpace α
t'T : ∀ (i : ↑b), t' ≤ T i
t't : t' ≤ t
t'_polish : PolishSpace α
s : Set β
hs : s ∈ b
⊢ IsOpen (f ⁻¹' s)

tactic: intro s
state_before: α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
⊢ ∀ (s : ↑b), IsClopenable (f ⁻¹' ↑s)

tactic: apply MeasurableSet.isClopenable
state_before: α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
s : ↑b
⊢ IsClopenable (f ⁻¹' ↑s)

tactic: exact hf (hb.isOpen s.2).measurableSet
state_before: case hs
α✝ : Type ?u.65771
inst✝⁶ : TopologicalSpace α✝
ι : Type ?u.65777
α : Type u_1
β : Type u_2
t : TopologicalSpace α
inst✝⁵ : PolishSpace α
inst✝⁴ : MeasurableSpace α
inst✝³ : BorelSpace α
tβ : TopologicalSpace β
inst✝² : SecondCountableTopology β
inst✝¹ : MeasurableSpace β
inst✝ : BorelSpace β
f : α → β
hf : Measurable f
b : Set (Set β)
b_count : Set.Countable b
hb : IsTopologicalBasis b
this : Encodable ↑b
s : ↑b
⊢ MeasurableSet (f ⁻¹' ↑s)