Theorem: Embedding.comp_stronglyMeasurable_iff
File: Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean

tactic: letI := pseudoMetrizableSpacePseudoMetric γ
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
⊢ (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f

tactic: borelize β γ
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
⊢ (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f

tactic: refine'
  ⟨fun H => stronglyMeasurable_iff_measurable_separable.2 ⟨_, _⟩, fun H =>
    hg.continuous.comp_stronglyMeasurable H⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
⊢ (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f

tactic: let G : β → range g := codRestrict g (range g) mem_range_self
state_before: case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
⊢ Measurable f

tactic: have hG : ClosedEmbedding G :=
  { hg.codRestrict _ _ with
    closed_range := by
      convert isClosed_univ (α := ↥(range g))
      apply eq_univ_of_forall
      rintro ⟨-, ⟨x, rfl⟩⟩
      exact mem_range_self x }
state_before: case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
⊢ Measurable f

tactic: have : Measurable (G ∘ f) := Measurable.subtype_mk H.measurable
state_before: case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
hG : ClosedEmbedding G
⊢ Measurable f

tactic: exact hG.measurableEmbedding.measurable_comp_iff.1 this
state_before: case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this✝⁴ : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
hG : ClosedEmbedding G
this : Measurable (G ∘ f)
⊢ Measurable f

tactic: convert isClosed_univ (α := ↥(range g))
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
src✝ : _root_.Embedding (codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)) :=
  Embedding.codRestrict hg (range g) mem_range_self
⊢ IsClosed (range G)

tactic: apply eq_univ_of_forall
state_before: case h.e'_3
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
src✝ : _root_.Embedding (codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)) :=
  Embedding.codRestrict hg (range g) mem_range_self
⊢ range G = univ

tactic: rintro ⟨-, ⟨x, rfl⟩⟩
state_before: case h.e'_3.a
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
src✝ : _root_.Embedding (codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)) :=
  Embedding.codRestrict hg (range g) mem_range_self
⊢ ∀ (x : ↑(range g)), x ∈ range G

tactic: exact mem_range_self x
state_before: case h.e'_3.a.mk.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
G : β → ↑(range g) := codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)
src✝ : _root_.Embedding (codRestrict g (range g) (_ : ∀ (i : β), g i ∈ range fun x => g x)) :=
  Embedding.codRestrict hg (range g) mem_range_self
x : β
⊢ { val := g x, property := (_ : ∃ y, g y = g x) } ∈ range G

tactic: have : IsSeparable (g ⁻¹' range (g ∘ f)) := hg.isSeparable_preimage H.isSeparable_range
state_before: case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
⊢ IsSeparable (range f)

tactic: convert this
state_before: case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this✝⁴ : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
this : IsSeparable (g ⁻¹' range (g ∘ f))
⊢ IsSeparable (range f)

tactic: ext x
state_before: case h.e'_3
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this✝⁴ : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
this : IsSeparable (g ⁻¹' range (g ∘ f))
⊢ range f = g ⁻¹' range (g ∘ f)

tactic: simp [hg.inj.eq_iff]
state_before: case h.e'_3.h
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Type ?u.139878
inst✝⁴ : Countable ι
f✝ g✝ : α → β
m : MeasurableSpace α
inst✝³ : TopologicalSpace β
inst✝² : PseudoMetrizableSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : PseudoMetrizableSpace γ
g : β → γ
f : α → β
hg : _root_.Embedding g
this✝⁴ : PseudoMetricSpace γ := pseudoMetrizableSpacePseudoMetric γ
this✝³ : MeasurableSpace β := borel β
this✝² : BorelSpace β
this✝¹ : MeasurableSpace γ := borel γ
this✝ : BorelSpace γ
H : StronglyMeasurable fun x => g (f x)
this : IsSeparable (g ⁻¹' range (g ∘ f))
x : β
⊢ x ∈ range f ↔ x ∈ g ⁻¹' range (g ∘ f)