Theorem: IsCoveringMapOn.isLocallyHomeomorphOn
File: Mathlib/Topology/Covering.lean

tactic: refine' IsLocallyHomeomorphOn.mk f (f ⁻¹' s) fun x hx => _
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
⊢ IsLocallyHomeomorphOn f (f ⁻¹' s)

tactic: let e := (hf (f x) hx).toTrivialization
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
x : E
hx : x ∈ f ⁻¹' s
⊢ ∃ e, x ∈ e.source ∧ ∀ (y : E), y ∈ e.source → f y = ↑e y

tactic: have h := (hf (f x) hx).mem_toTrivialization_baseSet
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
x : E
hx : x ∈ f ⁻¹' s
e : Trivialization (↑(f ⁻¹' {f x})) f := IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))
⊢ ∃ e, x ∈ e.source ∧ ∀ (y : E), y ∈ e.source → f y = ↑e y

tactic: let he := e.mem_source.2 h
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
x : E
hx : x ∈ f ⁻¹' s
e : Trivialization (↑(f ⁻¹' {f x})) f := IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))
h : f x ∈ (IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))).baseSet
⊢ ∃ e, x ∈ e.source ∧ ∀ (y : E), y ∈ e.source → f y = ↑e y

tactic: refine'
  ⟨e.toLocalHomeomorph.trans
      { toFun := fun p => p.1
        invFun := fun p => ⟨p, x, rfl⟩
        source := e.baseSet ×ˢ ({⟨x, rfl⟩} : Set (f ⁻¹' {f x}))
        target := e.baseSet
        open_source :=
          e.open_baseSet.prod (singletons_open_iff_discrete.2 (hf (f x) hx).1 ⟨x, rfl⟩)
        open_target := e.open_baseSet
        map_source' := fun p => And.left
        map_target' := fun p hp => ⟨hp, rfl⟩
        left_inv' := fun p hp => Prod.ext rfl hp.2.symm
        right_inv' := fun p _ => rfl
        continuous_toFun := continuous_fst.continuousOn
        continuous_invFun := (continuous_id'.prod_mk continuous_const).continuousOn },
    ⟨he, by rwa [e.toLocalHomeomorph.symm_symm, e.proj_toFun x he],
      (hf (f x) hx).toTrivialization_apply⟩,
    fun p h => (e.proj_toFun p h.1).symm⟩
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
x : E
hx : x ∈ f ⁻¹' s
e : Trivialization (↑(f ⁻¹' {f x})) f := IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))
h : f x ∈ (IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))).baseSet
he : x ∈ e.source := Iff.mpr (Trivialization.mem_source e) h
⊢ ∃ e, x ∈ e.source ∧ ∀ (y : E), y ∈ e.source → f y = ↑e y

tactic: rwa [e.toLocalHomeomorph.symm_symm, e.proj_toFun x he]
state_before: E : Type u_1
X : Type u_2
inst✝¹ : TopologicalSpace E
inst✝ : TopologicalSpace X
f : E → X
s : Set X
hf : IsCoveringMapOn f s
x : E
hx : x ∈ f ⁻¹' s
e : Trivialization (↑(f ⁻¹' {f x})) f := IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))
h : f x ∈ (IsEvenlyCovered.toTrivialization (_ : IsEvenlyCovered f (f x) ↑(f ⁻¹' {f x}))).baseSet
he : x ∈ e.source := Iff.mpr (Trivialization.mem_source e) h
⊢ (↑(LocalHomeomorph.symm (LocalHomeomorph.symm e.toLocalHomeomorph)) x).fst ∈ e.baseSet