l3lab/ntp-mathlib huggingface dataset:
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      

Proof state:
case a
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
s : Set H
s_open : IsOpen s
⊢ ∃ i ∈ c.atlas, ∃ i_1, IsOpen i_1 ∧ ↑e ⁻¹' s ∩ e.source = ↑i ⁻¹' i_1 ∩ i.source

Next tactic:
exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      

Proof state:
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
⊢ ContinuousOn
    { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
        map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
        map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
        left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
        right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun
    { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
        map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
        map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
        left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
        right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target

Next tactic:
letI : TopologicalSpace M := c.toTopologicalSpace
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      

Proof state:
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
⊢ ContinuousOn
    { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
        map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
        map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
        left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
        right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun
    { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
        map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
        map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
        left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
        right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target

Next tactic:
apply continuousOn_isOpen_of_generateFrom
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      

Proof state:
case h
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
⊢ ∀ t ∈ ⋃ e ∈ c.atlas, ⋃ s, ⋃ (_ : IsOpen s), {↑e ⁻¹' s ∩ e.source},
    IsOpen
      ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
        { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
              map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
              map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
              left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
              right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
          t)

Next tactic:
intro t ht
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      

Proof state:
case h
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
ht : t ∈ ⋃ e ∈ c.atlas, ⋃ s, ⋃ (_ : IsOpen s), {↑e ⁻¹' s ∩ e.source}
⊢ IsOpen
    ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
          map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
          map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
          left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
          right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
      { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
        t)

Next tactic:
simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
      

Proof state:
case h
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
ht : ∃ i ∈ c.atlas, ∃ i_1, IsOpen i_1 ∧ t = ↑i ⁻¹' i_1 ∩ i.source
⊢ IsOpen
    ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
          map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
          map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
          left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
          right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
      { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
        t)

Next tactic:
rcases ht with ⟨e', e'_atlas, s, s_open, ts⟩
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
      rcases ht with ⟨e', e'_atlas, s, s_open, ts⟩
      

Proof state:
case h.intro.intro.intro.intro
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
e' : PartialEquiv M H
e'_atlas : e' ∈ c.atlas
s : Set H
s_open : IsOpen s
ts : t = ↑e' ⁻¹' s ∩ e'.source
⊢ IsOpen
    ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
          map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
          map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
          left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
          right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
      { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
        t)

Next tactic:
rw [ts]
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
      rcases ht with ⟨e', e'_atlas, s, s_open, ts⟩
      rw [ts]
      

Proof state:
case h.intro.intro.intro.intro
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
e' : PartialEquiv M H
e'_atlas : e' ∈ c.atlas
s : Set H
s_open : IsOpen s
ts : t = ↑e' ⁻¹' s ∩ e'.source
⊢ IsOpen
    ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
          map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
          map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
          left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
          right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
      { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
        (↑e' ⁻¹' s ∩ e'.source))

Next tactic:
let f := e.symm.trans e'
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
      rcases ht with ⟨e', e'_atlas, s, s_open, ts⟩
      rw [ts]
      let f := e.symm.trans e'
      

Proof state:
case h.intro.intro.intro.intro
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
e' : PartialEquiv M H
e'_atlas : e' ∈ c.atlas
s : Set H
s_open : IsOpen s
ts : t = ↑e' ⁻¹' s ∩ e'.source
f : PartialEquiv H H := PartialEquiv.symm e ≫ e'
⊢ IsOpen
    ({ toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
          map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
          map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
          left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
          right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.target ∩
      { toFun := ↑e, invFun := e.invFun, source := e.source, target := e.target,
            map_source' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → ↑e x ∈ e.target),
            map_target' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → PartialEquiv.invFun e x ∈ e.source),
            left_inv' := (_ : ∀ ⦃x : M⦄, x ∈ e.source → PartialEquiv.invFun e (↑e x) = x),
            right_inv' := (_ : ∀ ⦃x : H⦄, x ∈ e.target → ↑e (PartialEquiv.invFun e x) = x) }.invFun ⁻¹'
        (↑e' ⁻¹' s ∩ e'.source))

Next tactic:
have : IsOpen (f ⁻¹' s ∩ f.source) := by
        simpa [inter_comm] using (continuousOn_open_iff (c.open_source e e' he e'_atlas)).1
          (c.continuousOn_toFun e e' he e'_atlas) s s_open
/-- An element of the atlas in a charted space without topology becomes a local homeomorphism
for the topology constructed from this atlas. The `localHomeomorph` version is given in this
definition. -/
protected def localHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) :
    @PartialHomeomorph M H c.toTopologicalSpace _ :=
  { c.toTopologicalSpace, e with
    open_source := by convert c.open_source' he
    open_target := by convert c.open_target he
    continuousOn_toFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      rw [continuousOn_open_iff (c.open_source' he)]
      intro s s_open
      rw [inter_comm]
      apply TopologicalSpace.GenerateOpen.basic
      simp only [exists_prop, mem_iUnion, mem_singleton_iff]
      exact ⟨e, he, ⟨s, s_open, rfl⟩⟩
    continuousOn_invFun := by
      letI : TopologicalSpace M := c.toTopologicalSpace
      apply continuousOn_isOpen_of_generateFrom
      intro t ht
      simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht
      rcases ht with ⟨e', e'_atlas, s, s_open, ts⟩
      rw [ts]
      let f := e.symm.trans e'
      have : IsOpen (f ⁻¹' s ∩ f.source) := by
        

Proof state:
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝ : TopologicalSpace H
c : ChartedSpaceCore H M
e✝ e : PartialEquiv M H
he : e ∈ c.atlas
src✝ : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
this : TopologicalSpace M := ChartedSpaceCore.toTopologicalSpace c
t : Set M
e' : PartialEquiv M H
e'_atlas : e' ∈ c.atlas
s : Set H
s_open : IsOpen s
ts : t = ↑e' ⁻¹' s ∩ e'.source
f : PartialEquiv H H := PartialEquiv.symm e ≫ e'
⊢ IsOpen (↑f ⁻¹' s ∩ f.source)

Next tactic:
simpa [inter_comm] using (continuousOn_open_iff (c.open_source e e' he e'_atlas)).1
          (c.continuousOn_toFun e e' he e'_atlas) s s_open