l3lab/ntp-mathlib huggingface dataset:
/-- If a topological space admits an atlas with locally connected charts, then the space itself is
locally connected. -/
theorem ChartedSpace.locallyConnectedSpace [LocallyConnectedSpace H] : LocallyConnectedSpace M := by
  let e : M → PartialHomeomorph M H := chartAt H
  refine' locallyConnectedSpace_of_connected_bases (fun x s ↦ (e x).symm '' s)
      (fun x s ↦ (IsOpen s ∧ e x x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) _ _
  · 

Proof state:
case refine'_1
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝³ : TopologicalSpace H
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : LocallyConnectedSpace H
e : M → PartialHomeomorph M H := chartAt H
⊢ ∀ (x : M),
    HasBasis (𝓝 x) ((fun x s => (IsOpen s ∧ ↑(e x) x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) x)
      ((fun x s => ↑(PartialHomeomorph.symm (e x)) '' s) x)

Next tactic:
intro x
/-- If a topological space admits an atlas with locally connected charts, then the space itself is
locally connected. -/
theorem ChartedSpace.locallyConnectedSpace [LocallyConnectedSpace H] : LocallyConnectedSpace M := by
  let e : M → PartialHomeomorph M H := chartAt H
  refine' locallyConnectedSpace_of_connected_bases (fun x s ↦ (e x).symm '' s)
      (fun x s ↦ (IsOpen s ∧ e x x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) _ _
  · intro x
    

Proof state:
case refine'_1
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝³ : TopologicalSpace H
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : LocallyConnectedSpace H
e : M → PartialHomeomorph M H := chartAt H
x : M
⊢ HasBasis (𝓝 x) ((fun x s => (IsOpen s ∧ ↑(e x) x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) x)
    ((fun x s => ↑(PartialHomeomorph.symm (e x)) '' s) x)

Next tactic:
simpa only [PartialHomeomorph.symm_map_nhds_eq, mem_chart_source] using
      ((LocallyConnectedSpace.open_connected_basis (e x x)).restrict_subset
        ((e x).open_target.mem_nhds (mem_chart_target H x))).map (e x).symm
/-- If a topological space admits an atlas with locally connected charts, then the space itself is
locally connected. -/
theorem ChartedSpace.locallyConnectedSpace [LocallyConnectedSpace H] : LocallyConnectedSpace M := by
  let e : M → PartialHomeomorph M H := chartAt H
  refine' locallyConnectedSpace_of_connected_bases (fun x s ↦ (e x).symm '' s)
      (fun x s ↦ (IsOpen s ∧ e x x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) _ _
  · intro x
    simpa only [PartialHomeomorph.symm_map_nhds_eq, mem_chart_source] using
      ((LocallyConnectedSpace.open_connected_basis (e x x)).restrict_subset
        ((e x).open_target.mem_nhds (mem_chart_target H x))).map (e x).symm
  · 

Proof state:
case refine'_2
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝³ : TopologicalSpace H
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : LocallyConnectedSpace H
e : M → PartialHomeomorph M H := chartAt H
⊢ ∀ (x : M) (i : Set H),
    (fun x s => (IsOpen s ∧ ↑(e x) x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) x i →
      IsPreconnected ((fun x s => ↑(PartialHomeomorph.symm (e x)) '' s) x i)

Next tactic:
rintro x s ⟨⟨-, -, hsconn⟩, hssubset⟩
/-- If a topological space admits an atlas with locally connected charts, then the space itself is
locally connected. -/
theorem ChartedSpace.locallyConnectedSpace [LocallyConnectedSpace H] : LocallyConnectedSpace M := by
  let e : M → PartialHomeomorph M H := chartAt H
  refine' locallyConnectedSpace_of_connected_bases (fun x s ↦ (e x).symm '' s)
      (fun x s ↦ (IsOpen s ∧ e x x ∈ s ∧ IsConnected s) ∧ s ⊆ (e x).target) _ _
  · intro x
    simpa only [PartialHomeomorph.symm_map_nhds_eq, mem_chart_source] using
      ((LocallyConnectedSpace.open_connected_basis (e x x)).restrict_subset
        ((e x).open_target.mem_nhds (mem_chart_target H x))).map (e x).symm
  · rintro x s ⟨⟨-, -, hsconn⟩, hssubset⟩
    

Proof state:
case refine'_2.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
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : LocallyConnectedSpace H
e : M → PartialHomeomorph M H := chartAt H
x : M
s : Set H
hssubset : s ⊆ (e x).target
hsconn : IsConnected s
⊢ IsPreconnected ((fun x s => ↑(PartialHomeomorph.symm (e x)) '' s) x s)

Next tactic:
exact hsconn.isPreconnected.image _ ((e x).continuousOn_symm.mono hssubset)
/-- If `M` is modelled on `H'` and `H'` is itself modelled on `H`, then we can consider `M` as being
modelled on `H`. -/
def ChartedSpace.comp (H : Type*) [TopologicalSpace H] (H' : Type*) [TopologicalSpace H']
    (M : Type*) [TopologicalSpace M] [ChartedSpace H H'] [ChartedSpace H' M] :
    ChartedSpace H M where
  atlas := image2 PartialHomeomorph.trans (atlas H' M) (atlas H H')
  chartAt p := (chartAt H' p).trans (chartAt H (chartAt H' p p))
  mem_chart_source p := 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✝
inst✝⁶ : TopologicalSpace M✝
inst✝⁵ : ChartedSpace H✝ M✝
H : Type u_5
inst✝⁴ : TopologicalSpace H
H' : Type u_6
inst✝³ : TopologicalSpace H'
M : Type u_7
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H H'
inst✝ : ChartedSpace H' M
p : M
⊢ p ∈ ((fun p => chartAt H' p ≫ₕ chartAt H (↑(chartAt H' p) p)) p).source

Next tactic:
simp only [mfld_simps]
@[simp, mfld_simps, nolint simpNF]
theorem modelProd_range_prod_id {H : Type*} {H' : Type*} {α : Type*} (f : H → α) :
    (range fun p : ModelProd H H' ↦ (f p.1, p.2)) = range f ×ˢ (univ : Set H') := by
  

Proof state:
H✝ : Type u
H'✝ : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
H : Type u_5
H' : Type u_6
α : Type u_7
f : H → α
⊢ (range fun p => (f p.1, p.2)) = range f ×ˢ univ

Next tactic:
rw [prod_range_univ_eq]
@[simp, mfld_simps, nolint simpNF]
theorem modelProd_range_prod_id {H : Type*} {H' : Type*} {α : Type*} (f : H → α) :
    (range fun p : ModelProd H H' ↦ (f p.1, p.2)) = range f ×ˢ (univ : Set H') := by
  rw [prod_range_univ_eq]
  

Proof state:
H✝ : Type u
H'✝ : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
H : Type u_5
H' : Type u_6
α : Type u_7
f : H → α
⊢ (range fun p => (f p.1, p.2)) = range fun p => (f p.1, p.2)

Next tactic:
rfl
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := 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
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : TopologicalSpace H'
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
x : M × M'
⊢ prodChartedSpace H H H' H' = chartedSpaceSelf (H × H')

Next tactic:
ext1
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := by
  ext1
  · 

Proof state:
case atlas
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝⁵ : TopologicalSpace H
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : TopologicalSpace H'
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
x : M × M'
⊢ ChartedSpace.atlas = ChartedSpace.atlas

Next tactic:
simp [prodChartedSpace, atlas, ChartedSpace.atlas]
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := by
  ext1
  · simp [prodChartedSpace, atlas, ChartedSpace.atlas]
  · 

Proof state:
case chartAt
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝⁵ : TopologicalSpace H
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : TopologicalSpace H'
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
x : M × M'
⊢ ChartedSpace.chartAt = ChartedSpace.chartAt

Next tactic:
ext1
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := by
  ext1
  · simp [prodChartedSpace, atlas, ChartedSpace.atlas]
  · ext1
    

Proof state:
case chartAt.h
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝⁵ : TopologicalSpace H
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : TopologicalSpace H'
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
x : M × M'
x✝ : H × H'
⊢ ChartedSpace.chartAt x✝ = ChartedSpace.chartAt x✝

Next tactic:
simp only [prodChartedSpace_chartAt, chartAt_self_eq, refl_prod_refl]
theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H') := by
  ext1
  · simp [prodChartedSpace, atlas, ChartedSpace.atlas]
  · ext1
    simp only [prodChartedSpace_chartAt, chartAt_self_eq, refl_prod_refl]
    

Proof state:
case chartAt.h
H : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝⁵ : TopologicalSpace H
inst✝⁴ : TopologicalSpace M
inst✝³ : ChartedSpace H M
inst✝² : TopologicalSpace H'
inst✝¹ : TopologicalSpace M'
inst✝ : ChartedSpace H' M'
x : M × M'
x✝ : H × H'
⊢ PartialHomeomorph.refl (H × H') = PartialHomeomorph.refl (ModelProd H H')

Next tactic:
rfl
theorem open_source' (he : e ∈ c.atlas) : IsOpen[c.toTopologicalSpace] e.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 : PartialEquiv M H
he : e ∈ c.atlas
⊢ IsOpen e.source

Next tactic:
apply TopologicalSpace.GenerateOpen.basic
theorem open_source' (he : e ∈ c.atlas) : IsOpen[c.toTopologicalSpace] e.source := by
  apply TopologicalSpace.GenerateOpen.basic
  

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 : PartialEquiv M H
he : e ∈ c.atlas
⊢ e.source ∈ ⋃ e ∈ c.atlas, ⋃ s, ⋃ (_ : IsOpen s), {↑e ⁻¹' s ∩ e.source}

Next tactic:
simp only [exists_prop, mem_iUnion, mem_singleton_iff]
theorem open_source' (he : e ∈ c.atlas) : IsOpen[c.toTopologicalSpace] e.source := by
  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 : PartialEquiv M H
he : e ∈ c.atlas
⊢ ∃ i ∈ c.atlas, ∃ i_1, IsOpen i_1 ∧ e.source = ↑i ⁻¹' i_1 ∩ i.source

Next tactic:
refine' ⟨e, he, univ, isOpen_univ, _⟩
theorem open_source' (he : e ∈ c.atlas) : IsOpen[c.toTopologicalSpace] e.source := by
  apply TopologicalSpace.GenerateOpen.basic
  simp only [exists_prop, mem_iUnion, mem_singleton_iff]
  refine' ⟨e, he, univ, isOpen_univ, _⟩
  

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 : PartialEquiv M H
he : e ∈ c.atlas
⊢ e.source = ↑e ⁻¹' univ ∩ e.source

Next tactic:
simp only [Set.univ_inter, Set.preimage_univ]
theorem open_target (he : e ∈ c.atlas) : IsOpen e.target := 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 : PartialEquiv M H
he : e ∈ c.atlas
⊢ IsOpen e.target

Next tactic:
have E : e.target ∩ e.symm ⁻¹' e.source = e.target :=
    Subset.antisymm (inter_subset_left _ _) fun x hx ↦
      ⟨hx, PartialEquiv.target_subset_preimage_source _ hx⟩
theorem open_target (he : e ∈ c.atlas) : IsOpen e.target := by
  have E : e.target ∩ e.symm ⁻¹' e.source = e.target :=
    Subset.antisymm (inter_subset_left _ _) fun x hx ↦
      ⟨hx, PartialEquiv.target_subset_preimage_source _ hx⟩
  

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 : PartialEquiv M H
he : e ∈ c.atlas
E : e.target ∩ ↑(PartialEquiv.symm e) ⁻¹' e.source = e.target
⊢ IsOpen e.target

Next tactic:
simpa [PartialEquiv.trans_source, E] using c.open_source e e he he
/-- 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 

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
⊢ 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) }.source

Next tactic:
convert c.open_source' he
/-- 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 

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
⊢ 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

Next tactic:
convert c.open_target he
/-- 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
      

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) }
    { 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) }.source

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
      

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) }
    { 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) }.source

Next tactic:
rw [continuousOn_open_iff (c.open_source' he)]
/-- 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)]
      

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 H),
    IsOpen t →
      IsOpen
        (e.source ∩
          ↑{ 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) } ⁻¹'
            t)

Next tactic:
intro 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
      

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
s : Set H
s_open : IsOpen s
⊢ IsOpen
    (e.source ∩
      ↑{ 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) } ⁻¹'
        s)

Next tactic:
rw [inter_comm]
/-- 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]
      

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
s : Set H
s_open : IsOpen s
⊢ 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) } ⁻¹'
        s ∩
      e.source)

Next tactic:
apply TopologicalSpace.GenerateOpen.basic
/-- 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
      

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
⊢ ↑{ 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) } ⁻¹'
        s ∩
      e.source ∈
    ⋃ e ∈ c.atlas, ⋃ s, ⋃ (_ : IsOpen s), {↑e ⁻¹' s ∩ e.source}

Next tactic:
simp only [exists_prop, mem_iUnion, mem_singleton_iff]