l3lab/ntp-mathlib huggingface dataset:
/-- Interpret a `Homeomorph` as a `PartialHomeomorph` by restricting it
to an open set `s` in the domain and to `t` in the codomain. -/
@[simps! (config := .asFn) apply symm_apply toPartialEquiv,
  simps! (config := .lemmasOnly) source target]
def _root_.Homeomorph.toPartialHomeomorphOfImageEq (e : α ≃ₜ β) (s : Set α) (hs : IsOpen s)
    (t : Set β) (h : e '' s = t) : PartialHomeomorph α β where
  toPartialEquiv := e.toPartialEquivOfImageEq s t h
  open_source := hs
  open_target := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : α ≃ₜ β
s : Set α
hs : IsOpen s
t : Set β
h : ⇑e '' s = t
⊢ IsOpen (Equiv.toPartialEquivOfImageEq e.toEquiv s t h).target

Next tactic:
simpa [← h]
/-- A homeomorphism induces a partial homeomorphism on the whole space -/
@[simps! (config := mfld_cfg)]
def _root_.Homeomorph.toPartialHomeomorph (e : α ≃ₜ β) : PartialHomeomorph α β :=
  e.toPartialHomeomorphOfImageEq univ isOpen_univ univ <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : α ≃ₜ β
⊢ ⇑e '' univ = univ

Next tactic:
rw [image_univ, e.surjective.range_eq]
theorem replaceEquiv_eq_self (e : PartialHomeomorph α β) (e' : PartialEquiv α β)
    (h : e.toPartialEquiv = e') : e.replaceEquiv e' h = e := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e'✝ : PartialHomeomorph β γ
e : PartialHomeomorph α β
e' : PartialEquiv α β
h : e.toPartialEquiv = e'
⊢ replaceEquiv e e' h = e

Next tactic:
cases e
theorem replaceEquiv_eq_self (e : PartialHomeomorph α β) (e' : PartialEquiv α β)
    (h : e.toPartialEquiv = e') : e.replaceEquiv e' h = e := by
  cases e
  

Proof state:
case mk
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e'✝ : PartialHomeomorph β γ
e' toPartialEquiv✝ : PartialEquiv α β
open_source✝ : IsOpen toPartialEquiv✝.source
open_target✝ : IsOpen toPartialEquiv✝.target
continuousOn_toFun✝ : ContinuousOn (↑toPartialEquiv✝) toPartialEquiv✝.source
continuousOn_invFun✝ : ContinuousOn toPartialEquiv✝.invFun toPartialEquiv✝.target
h :
  { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
        continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }.toPartialEquiv =
    e'
⊢ replaceEquiv
      { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
        continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }
      e' h =
    { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
      continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }

Next tactic:
subst e'
theorem replaceEquiv_eq_self (e : PartialHomeomorph α β) (e' : PartialEquiv α β)
    (h : e.toPartialEquiv = e') : e.replaceEquiv e' h = e := by
  cases e
  subst e'
  

Proof state:
case mk
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
toPartialEquiv✝ : PartialEquiv α β
open_source✝ : IsOpen toPartialEquiv✝.source
open_target✝ : IsOpen toPartialEquiv✝.target
continuousOn_toFun✝ : ContinuousOn (↑toPartialEquiv✝) toPartialEquiv✝.source
continuousOn_invFun✝ : ContinuousOn toPartialEquiv✝.invFun toPartialEquiv✝.target
⊢ replaceEquiv
      { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
        continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }
      { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
          continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }.toPartialEquiv
      (_ :
        { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
              continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }.toPartialEquiv =
          { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
              continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }.toPartialEquiv) =
    { toPartialEquiv := toPartialEquiv✝, open_source := open_source✝, open_target := open_target✝,
      continuousOn_toFun := continuousOn_toFun✝, continuousOn_invFun := continuousOn_invFun✝ }

Next tactic:
rfl
theorem eventually_ne_nhdsWithin (e : PartialHomeomorph α β) {x} (hx : x ∈ e.source) :
    ∀ᶠ x' in 𝓝[≠] x, e x' ≠ e x :=
  eventually_nhdsWithin_iff.2 <|
    (e.eventually_left_inverse hx).mono fun x' hx' =>
      mt fun h => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
hx : x ∈ e.source
x' : α
hx' : ↑(PartialHomeomorph.symm e) (↑e x') = x'
h : ↑e x' = ↑e x
⊢ x' ∈ {x}

Next tactic:
rw [mem_singleton_iff, ← e.left_inv hx, ← h, hx']
protected theorem ext_iff {e e' : PartialHomeomorph α β} :
    e = e' ↔ (∀ x, e x = e' x) ∧ (∀ x, e.symm x = e'.symm x) ∧ e.source = e'.source :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e'✝ : PartialHomeomorph β γ
e e' : PartialHomeomorph α β
⊢ e = e' →
    (∀ (x : α), ↑e x = ↑e' x) ∧
      (∀ (x : β), ↑(PartialHomeomorph.symm e) x = ↑(PartialHomeomorph.symm e') x) ∧ e.source = e'.source

Next tactic:
rintro rfl
protected theorem ext_iff {e e' : PartialHomeomorph α β} :
    e = e' ↔ (∀ x, e x = e' x) ∧ (∀ x, e.symm x = e'.symm x) ∧ e.source = e'.source :=
  ⟨by
    rintro rfl
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
⊢ (∀ (x : α), ↑e x = ↑e x) ∧
    (∀ (x : β), ↑(PartialHomeomorph.symm e) x = ↑(PartialHomeomorph.symm e) x) ∧ e.source = e.source

Next tactic:
exact ⟨fun x => rfl, fun x => rfl, rfl⟩
theorem tendsto_symm {x} (hx : x ∈ e.source) : Tendsto e.symm (𝓝 (e x)) (𝓝 x) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
x : α
hx : x ∈ e.source
⊢ Tendsto (↑(PartialHomeomorph.symm e)) (𝓝 (↑e x)) (𝓝 x)

Next tactic:
simpa only [ContinuousAt, e.left_inv hx] using e.continuousAt_symm (e.map_source hx)
theorem symm_map_nhds_eq {x} (hx : x ∈ e.source) : map e.symm (𝓝 (e x)) = 𝓝 x :=
  (e.symm.map_nhds_eq <| e.map_source hx).trans <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
x : α
hx : x ∈ e.source
⊢ 𝓝 (↑(PartialHomeomorph.symm e) (↑e x)) = 𝓝 x

Next tactic:
rw [e.left_inv hx]
theorem map_nhdsWithin_preimage_eq (e : PartialHomeomorph α β) {x} (hx : x ∈ e.source) (s : Set β) :
    map e (𝓝[e ⁻¹' s] x) = 𝓝[s] e x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
hx : x ∈ e.source
s : Set β
⊢ map (↑e) (𝓝[↑e ⁻¹' s] x) = 𝓝[s] ↑e x

Next tactic:
rw [e.map_nhdsWithin_eq hx, e.image_source_inter_eq', e.target_inter_inv_preimage_preimage,
    e.nhdsWithin_target_inter (e.map_source hx)]
theorem eventually_nhds (e : PartialHomeomorph α β) {x : α} (p : β → Prop) (hx : x ∈ e.source) :
    (∀ᶠ y in 𝓝 (e x), p y) ↔ ∀ᶠ x in 𝓝 x, p (e x) :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : β → Prop
hx : x ∈ e.source
⊢ (∀ᶠ (y : β) in 𝓝 (↑e x), p y) ↔ ∀ᶠ (b : β) in map (fun x => ↑e x) (𝓝 x), p b

Next tactic:
rw [e.map_nhds_eq hx]
theorem eventually_nhds' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) (hx : x ∈ e.source) :
    (∀ᶠ y in 𝓝 (e x), p (e.symm y)) ↔ ∀ᶠ x in 𝓝 x, p x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
hx : x ∈ e.source
⊢ (∀ᶠ (y : β) in 𝓝 (↑e x), p (↑(PartialHomeomorph.symm e) y)) ↔ ∀ᶠ (x : α) in 𝓝 x, p x

Next tactic:
rw [e.eventually_nhds _ hx]
theorem eventually_nhds' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) (hx : x ∈ e.source) :
    (∀ᶠ y in 𝓝 (e x), p (e.symm y)) ↔ ∀ᶠ x in 𝓝 x, p x := by
  rw [e.eventually_nhds _ hx]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
hx : x ∈ e.source
⊢ (∀ᶠ (x : α) in 𝓝 x, p (↑(PartialHomeomorph.symm e) (↑e x))) ↔ ∀ᶠ (x : α) in 𝓝 x, p x

Next tactic:
refine' eventually_congr ((e.eventually_left_inverse hx).mono fun y hy => _)
theorem eventually_nhds' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) (hx : x ∈ e.source) :
    (∀ᶠ y in 𝓝 (e x), p (e.symm y)) ↔ ∀ᶠ x in 𝓝 x, p x := by
  rw [e.eventually_nhds _ hx]
  refine' eventually_congr ((e.eventually_left_inverse hx).mono fun y hy => _)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
hx : x ∈ e.source
y : α
hy : ↑(PartialHomeomorph.symm e) (↑e y) = y
⊢ p (↑(PartialHomeomorph.symm e) (↑e y)) ↔ p y

Next tactic:
rw [hy]
theorem eventually_nhdsWithin (e : PartialHomeomorph α β) {x : α} (p : β → Prop) {s : Set α}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p y) ↔ ∀ᶠ x in 𝓝[s] x, p (e x) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : β → Prop
s : Set α
hx : x ∈ e.source
⊢ (∀ᶠ (y : β) in 𝓝[↑(PartialHomeomorph.symm e) ⁻¹' s] ↑e x, p y) ↔ ∀ᶠ (x : α) in 𝓝[s] x, p (↑e x)

Next tactic:
refine' Iff.trans _ eventually_map
theorem eventually_nhdsWithin (e : PartialHomeomorph α β) {x : α} (p : β → Prop) {s : Set α}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p y) ↔ ∀ᶠ x in 𝓝[s] x, p (e x) := by
  refine' Iff.trans _ eventually_map
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : β → Prop
s : Set α
hx : x ∈ e.source
⊢ (∀ᶠ (y : β) in 𝓝[↑(PartialHomeomorph.symm e) ⁻¹' s] ↑e x, p y) ↔ ∀ᶠ (b : β) in map (fun x => ↑e x) (𝓝[s] x), p b

Next tactic:
rw [e.map_nhdsWithin_eq hx, e.image_source_inter_eq', e.nhdsWithin_target_inter (e.mapsTo hx)]
theorem eventually_nhdsWithin' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) {s : Set α}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p (e.symm y)) ↔ ∀ᶠ x in 𝓝[s] x, p x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
s : Set α
hx : x ∈ e.source
⊢ (∀ᶠ (y : β) in 𝓝[↑(PartialHomeomorph.symm e) ⁻¹' s] ↑e x, p (↑(PartialHomeomorph.symm e) y)) ↔
    ∀ᶠ (x : α) in 𝓝[s] x, p x

Next tactic:
rw [e.eventually_nhdsWithin _ hx]
theorem eventually_nhdsWithin' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) {s : Set α}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p (e.symm y)) ↔ ∀ᶠ x in 𝓝[s] x, p x := by
  rw [e.eventually_nhdsWithin _ hx]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
s : Set α
hx : x ∈ e.source
⊢ (∀ᶠ (x : α) in 𝓝[s] x, p (↑(PartialHomeomorph.symm e) (↑e x))) ↔ ∀ᶠ (x : α) in 𝓝[s] x, p x

Next tactic:
refine eventually_congr <|
    (eventually_nhdsWithin_of_eventually_nhds <| e.eventually_left_inverse hx).mono fun y hy => ?_
theorem eventually_nhdsWithin' (e : PartialHomeomorph α β) {x : α} (p : α → Prop) {s : Set α}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p (e.symm y)) ↔ ∀ᶠ x in 𝓝[s] x, p x := by
  rw [e.eventually_nhdsWithin _ hx]
  refine eventually_congr <|
    (eventually_nhdsWithin_of_eventually_nhds <| e.eventually_left_inverse hx).mono fun y hy => ?_
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
x : α
p : α → Prop
s : Set α
hx : x ∈ e.source
y : α
hy : ↑(PartialHomeomorph.symm e) (↑e y) = y
⊢ p (↑(PartialHomeomorph.symm e) (↑e y)) ↔ p y

Next tactic:
rw [hy]
/-- This lemma is useful in the manifold library in the case that `e` is a chart. It states that
  locally around `e x` the set `e.symm ⁻¹' s` is the same as the set intersected with the target
  of `e` and some other neighborhood of `f x` (which will be the source of a chart on `γ`).  -/
theorem preimage_eventuallyEq_target_inter_preimage_inter {e : PartialHomeomorph α β} {s : Set α}
    {t : Set γ} {x : α} {f : α → γ} (hf : ContinuousWithinAt f s x) (hxe : x ∈ e.source)
    (ht : t ∈ 𝓝 (f x)) :
    e.symm ⁻¹' s =ᶠ[𝓝 (e x)] (e.target ∩ e.symm ⁻¹' (s ∩ f ⁻¹' t) : Set β) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
s : Set α
t : Set γ
x : α
f : α → γ
hf : ContinuousWithinAt f s x
hxe : x ∈ e.source
ht : t ∈ 𝓝 (f x)
⊢ ↑(PartialHomeomorph.symm e) ⁻¹' s =ᶠ[𝓝 (↑e x)] e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (s ∩ f ⁻¹' t)

Next tactic:
rw [eventuallyEq_set, e.eventually_nhds _ hxe]
/-- This lemma is useful in the manifold library in the case that `e` is a chart. It states that
  locally around `e x` the set `e.symm ⁻¹' s` is the same as the set intersected with the target
  of `e` and some other neighborhood of `f x` (which will be the source of a chart on `γ`).  -/
theorem preimage_eventuallyEq_target_inter_preimage_inter {e : PartialHomeomorph α β} {s : Set α}
    {t : Set γ} {x : α} {f : α → γ} (hf : ContinuousWithinAt f s x) (hxe : x ∈ e.source)
    (ht : t ∈ 𝓝 (f x)) :
    e.symm ⁻¹' s =ᶠ[𝓝 (e x)] (e.target ∩ e.symm ⁻¹' (s ∩ f ⁻¹' t) : Set β) := by
  rw [eventuallyEq_set, e.eventually_nhds _ hxe]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
s : Set α
t : Set γ
x : α
f : α → γ
hf : ContinuousWithinAt f s x
hxe : x ∈ e.source
ht : t ∈ 𝓝 (f x)
⊢ ∀ᶠ (x : α) in 𝓝 x,
    ↑e x ∈ ↑(PartialHomeomorph.symm e) ⁻¹' s ↔ ↑e x ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (s ∩ f ⁻¹' t)

Next tactic:
filter_upwards [e.open_source.mem_nhds hxe,
    mem_nhdsWithin_iff_eventually.mp (hf.preimage_mem_nhdsWithin ht)]
/-- This lemma is useful in the manifold library in the case that `e` is a chart. It states that
  locally around `e x` the set `e.symm ⁻¹' s` is the same as the set intersected with the target
  of `e` and some other neighborhood of `f x` (which will be the source of a chart on `γ`).  -/
theorem preimage_eventuallyEq_target_inter_preimage_inter {e : PartialHomeomorph α β} {s : Set α}
    {t : Set γ} {x : α} {f : α → γ} (hf : ContinuousWithinAt f s x) (hxe : x ∈ e.source)
    (ht : t ∈ 𝓝 (f x)) :
    e.symm ⁻¹' s =ᶠ[𝓝 (e x)] (e.target ∩ e.symm ⁻¹' (s ∩ f ⁻¹' t) : Set β) := by
  rw [eventuallyEq_set, e.eventually_nhds _ hxe]
  filter_upwards [e.open_source.mem_nhds hxe,
    mem_nhdsWithin_iff_eventually.mp (hf.preimage_mem_nhdsWithin ht)]
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
s : Set α
t : Set γ
x : α
f : α → γ
hf : ContinuousWithinAt f s x
hxe : x ∈ e.source
ht : t ∈ 𝓝 (f x)
⊢ ∀ a ∈ e.source,
    (a ∈ s → a ∈ f ⁻¹' t) →
      (↑e a ∈ ↑(PartialHomeomorph.symm e) ⁻¹' s ↔ ↑e a ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (s ∩ f ⁻¹' t))

Next tactic:
intro y hy hyu
/-- This lemma is useful in the manifold library in the case that `e` is a chart. It states that
  locally around `e x` the set `e.symm ⁻¹' s` is the same as the set intersected with the target
  of `e` and some other neighborhood of `f x` (which will be the source of a chart on `γ`).  -/
theorem preimage_eventuallyEq_target_inter_preimage_inter {e : PartialHomeomorph α β} {s : Set α}
    {t : Set γ} {x : α} {f : α → γ} (hf : ContinuousWithinAt f s x) (hxe : x ∈ e.source)
    (ht : t ∈ 𝓝 (f x)) :
    e.symm ⁻¹' s =ᶠ[𝓝 (e x)] (e.target ∩ e.symm ⁻¹' (s ∩ f ⁻¹' t) : Set β) := by
  rw [eventuallyEq_set, e.eventually_nhds _ hxe]
  filter_upwards [e.open_source.mem_nhds hxe,
    mem_nhdsWithin_iff_eventually.mp (hf.preimage_mem_nhdsWithin ht)]
  intro y hy hyu
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e✝ : PartialHomeomorph α β
e' : PartialHomeomorph β γ
e : PartialHomeomorph α β
s : Set α
t : Set γ
x : α
f : α → γ
hf : ContinuousWithinAt f s x
hxe : x ∈ e.source
ht : t ∈ 𝓝 (f x)
y : α
hy : y ∈ e.source
hyu : y ∈ s → y ∈ f ⁻¹' t
⊢ ↑e y ∈ ↑(PartialHomeomorph.symm e) ⁻¹' s ↔ ↑e y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (s ∩ f ⁻¹' t)

Next tactic:
simp_rw [mem_inter_iff, mem_preimage, mem_inter_iff, e.mapsTo hy, true_and_iff, iff_self_and,
    e.left_inv hy, iff_true_intro hyu]
/-- A partial homeomorphism is an open map on its source. -/
lemma isOpen_image_of_subset_source {s : Set α} (hs : IsOpen s) (hse : s ⊆ e.source) :
    IsOpen (e '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
hs : IsOpen s
hse : s ⊆ e.source
⊢ IsOpen (↑e '' s)

Next tactic:
rw [(image_eq_target_inter_inv_preimage (e := e) hse)]
/-- A partial homeomorphism is an open map on its source. -/
lemma isOpen_image_of_subset_source {s : Set α} (hs : IsOpen s) (hse : s ⊆ e.source) :
    IsOpen (e '' s) := by
  rw [(image_eq_target_inter_inv_preimage (e := e) hse)]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
hs : IsOpen s
hse : s ⊆ e.source
⊢ IsOpen (e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' s)

Next tactic:
exact e.continuousOn_invFun.isOpen_inter_preimage e.open_target hs
theorem iff_symm_preimage_eq' :
    e.IsImage s t ↔ e.target ∩ e.symm ⁻¹' (e.source ∩ s) = e.target ∩ t := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
t : Set β
x : α
y : β
⊢ IsImage e s t ↔ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (e.source ∩ s) = e.target ∩ t

Next tactic:
rw [iff_symm_preimage_eq, ← image_source_inter_eq, ← image_source_inter_eq']
theorem map_nhdsWithin_eq (h : e.IsImage s t) (hx : x ∈ e.source) : map e (𝓝[s] x) = 𝓝[t] e x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
t : Set β
x : α
y : β
h : IsImage e s t
hx : x ∈ e.source
⊢ map (↑e) (𝓝[s] x) = 𝓝[t] ↑e x

Next tactic:
rw [e.map_nhdsWithin_eq hx, h.image_eq, e.nhdsWithin_target_inter (e.map_source hx)]
protected theorem closure (h : e.IsImage s t) : e.IsImage (closure s) (closure t) := fun x hx => by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
t : Set β
x✝ : α
y : β
h : IsImage e s t
x : α
hx : x ∈ e.source
⊢ ↑e x ∈ closure t ↔ x ∈ closure s

Next tactic:
simp only [mem_closure_iff_nhdsWithin_neBot, ← h.map_nhdsWithin_eq hx, map_neBot_iff]
protected theorem interior (h : e.IsImage s t) : e.IsImage (interior s) (interior t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
t : Set β
x : α
y : β
h : IsImage e s t
⊢ IsImage e (interior s) (interior t)

Next tactic:
simpa only [closure_compl, compl_compl] using h.compl.closure.compl
/-- The image of an open set in the source is open. -/
theorem image_isOpen_of_isOpen {s : Set α} (hs : IsOpen s) (h : s ⊆ e.source) :
    IsOpen (e '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
hs : IsOpen s
h : s ⊆ e.source
⊢ IsOpen (↑e '' s)

Next tactic:
have : e '' s = e.target ∩ e.symm ⁻¹' s := e.toPartialEquiv.image_eq_target_inter_inv_preimage h
/-- The image of an open set in the source is open. -/
theorem image_isOpen_of_isOpen {s : Set α} (hs : IsOpen s) (h : s ⊆ e.source) :
    IsOpen (e '' s) := by
  have : e '' s = e.target ∩ e.symm ⁻¹' s := e.toPartialEquiv.image_eq_target_inter_inv_preimage h
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
s : Set α
hs : IsOpen s
h : s ⊆ e.source
this : ↑e '' s = e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' s
⊢ IsOpen (↑e '' s)

Next tactic:
rw [this]