l3lab/ntp-mathlib huggingface dataset:
/-- If a single local homeomorphism `e` from a space `α` into `H` has source covering the whole
space `α`, then that local homeomorphism induces an `H`-charted space structure on `α`.
(This condition is equivalent to `e` being an open embedding of `α` into `H`; see
`OpenEmbedding.singletonChartedSpace`.) -/
def singletonChartedSpace (h : e.source = Set.univ) : ChartedSpace H α where
  atlas := {e}
  chartAt _ := e
  mem_chart_source _ := by rw [h]; 

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
α : Type u_5
inst✝ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
x✝ : α
⊢ x✝ ∈ univ

Next tactic:
apply mem_univ
/-- If a single local homeomorphism `e` from a space `α` into `H` has source covering the whole
space `α`, then that local homeomorphism induces an `H`-charted space structure on `α`.
(This condition is equivalent to `e` being an open embedding of `α` into `H`; see
`OpenEmbedding.singletonChartedSpace`.) -/
def singletonChartedSpace (h : e.source = Set.univ) : ChartedSpace H α where
  atlas := {e}
  chartAt _ := e
  mem_chart_source _ := by rw [h]; apply mem_univ
  chart_mem_atlas _ := 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
α : Type u_5
inst✝ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
x✝ : α
⊢ (fun x => e) x✝ ∈ {e}

Next tactic:
tauto
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := 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
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
⊢ ∀ {e_1 e' : PartialHomeomorph α H}, e_1 ∈ atlas H α → e' ∈ atlas H α → PartialHomeomorph.symm e_1 ≫ₕ e' ∈ G

Next tactic:
intro e' e'' he' he''
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := by
      intro e' e'' he' 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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
e' e'' : PartialHomeomorph α H
he' : e' ∈ atlas H α
he'' : e'' ∈ atlas H α
⊢ PartialHomeomorph.symm e' ≫ₕ e'' ∈ G

Next tactic:
rw [e.singletonChartedSpace_mem_atlas_eq h e' he',
        e.singletonChartedSpace_mem_atlas_eq h e'' he'']
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := by
      intro e' e'' he' he''
      rw [e.singletonChartedSpace_mem_atlas_eq h e' he',
        e.singletonChartedSpace_mem_atlas_eq h e'' 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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
e' e'' : PartialHomeomorph α H
he' : e' ∈ atlas H α
he'' : e'' ∈ atlas H α
⊢ PartialHomeomorph.symm e ≫ₕ e ∈ G

Next tactic:
refine' G.eq_on_source _ e.trans_symm_self
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := by
      intro e' e'' he' he''
      rw [e.singletonChartedSpace_mem_atlas_eq h e' he',
        e.singletonChartedSpace_mem_atlas_eq h e'' he'']
      refine' G.eq_on_source _ e.trans_symm_self
      

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
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
e' e'' : PartialHomeomorph α H
he' : e' ∈ atlas H α
he'' : e'' ∈ atlas H α
⊢ ofSet e.target (_ : IsOpen e.target) ∈ G

Next tactic:
have hle : idRestrGroupoid ≤ G := (closedUnderRestriction_iff_id_le G).mp (by assumption)
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := by
      intro e' e'' he' he''
      rw [e.singletonChartedSpace_mem_atlas_eq h e' he',
        e.singletonChartedSpace_mem_atlas_eq h e'' he'']
      refine' G.eq_on_source _ e.trans_symm_self
      have hle : idRestrGroupoid ≤ G := (closedUnderRestriction_iff_id_le G).mp (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
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
e' e'' : PartialHomeomorph α H
he' : e' ∈ atlas H α
he'' : e'' ∈ atlas H α
⊢ ClosedUnderRestriction G

Next tactic:
assumption
/-- Given a local homeomorphism `e` from a space `α` into `H`, if its source covers the whole
space `α`, then the induced charted space structure on `α` is `HasGroupoid G` for any structure
groupoid `G` which is closed under restrictions. -/
theorem singleton_hasGroupoid (h : e.source = Set.univ) (G : StructureGroupoid H)
    [ClosedUnderRestriction G] : @HasGroupoid _ _ _ _ (e.singletonChartedSpace h) G :=
  { e.singletonChartedSpace h with
    compatible := by
      intro e' e'' he' he''
      rw [e.singletonChartedSpace_mem_atlas_eq h e' he',
        e.singletonChartedSpace_mem_atlas_eq h e'' he'']
      refine' G.eq_on_source _ e.trans_symm_self
      have hle : idRestrGroupoid ≤ G := (closedUnderRestriction_iff_id_le G).mp (by assumption)
      

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
α : Type u_5
inst✝¹ : TopologicalSpace α
e : PartialHomeomorph α H
h : e.source = univ
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
src✝ : ChartedSpace H α := singletonChartedSpace e h
e' e'' : PartialHomeomorph α H
he' : e' ∈ atlas H α
he'' : e'' ∈ atlas H α
hle : idRestrGroupoid ≤ G
⊢ ofSet e.target (_ : IsOpen e.target) ∈ G

Next tactic:
exact StructureGroupoid.le_iff.mp hle _ (idRestrGroupoid_mem _)
/-- An open subset of a charted space is naturally a charted space. -/
protected instance instChartedSpace : ChartedSpace H s where
  atlas := ⋃ x : s, {@PartialHomeomorph.subtypeRestr _ _ _ _ (chartAt H x.1) s ⟨x⟩}
  chartAt x := @PartialHomeomorph.subtypeRestr _ _ _ _ (chartAt H x.1) s ⟨x⟩
  mem_chart_source x := ⟨trivial, mem_chart_source H x.1⟩
  chart_mem_atlas x := 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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s : Opens M
x : ↥s
⊢ (fun x => subtypeRestr (chartAt H ↑x) s) x ∈ ⋃ x, {subtypeRestr (chartAt H ↑x) s}

Next tactic:
simp only [mem_iUnion, mem_singleton_iff]
/-- An open subset of a charted space is naturally a charted space. -/
protected instance instChartedSpace : ChartedSpace H s where
  atlas := ⋃ x : s, {@PartialHomeomorph.subtypeRestr _ _ _ _ (chartAt H x.1) s ⟨x⟩}
  chartAt x := @PartialHomeomorph.subtypeRestr _ _ _ _ (chartAt H x.1) s ⟨x⟩
  mem_chart_source x := ⟨trivial, mem_chart_source H x.1⟩
  chart_mem_atlas x := by
    simp only [mem_iUnion, mem_singleton_iff]
    

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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s : Opens M
x : ↥s
⊢ ∃ i, subtypeRestr (chartAt H ↑x) s = subtypeRestr (chartAt H ↑i) s

Next tactic:
use x
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := 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
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
⊢ ∀ {e e' : PartialHomeomorph (↥s) H}, e ∈ atlas H ↥s → e' ∈ atlas H ↥s → PartialHomeomorph.symm e ≫ₕ e' ∈ G

Next tactic:
rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
he : e ∈ w✝¹
x : ↥s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
he' : e' ∈ w✝
x' : ↥s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
⊢ PartialHomeomorph.symm e ≫ₕ e' ∈ G

Next tactic:
haveI : Nonempty s := ⟨x⟩
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
he : e ∈ w✝¹
x : ↥s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
he' : e' ∈ w✝
x' : ↥s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.symm e ≫ₕ e' ∈ G

Next tactic:
rw [hc.symm, mem_singleton_iff] at he
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
he' : e' ∈ w✝
x' : ↥s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.symm e ≫ₕ e' ∈ G

Next tactic:
rw [hc'.symm, mem_singleton_iff] at he'
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    rw [hc'.symm, mem_singleton_iff] at he'
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
x' : ↥s
he' : e' = subtypeRestr (chartAt H ↑x') s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.symm e ≫ₕ e' ∈ G

Next tactic:
rw [he, he']
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    rw [hc'.symm, mem_singleton_iff] at he'
    rw [he, he']
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
x' : ↥s
he' : e' = subtypeRestr (chartAt H ↑x') s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.symm (subtypeRestr (chartAt H ↑x) s) ≫ₕ subtypeRestr (chartAt H ↑x') s ∈ G

Next tactic:
refine' G.eq_on_source _ (subtypeRestr_symm_trans_subtypeRestr s (chartAt H x) (chartAt H x'))
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    rw [hc'.symm, mem_singleton_iff] at he'
    rw [he, he']
    refine' G.eq_on_source _ (subtypeRestr_symm_trans_subtypeRestr s (chartAt H x) (chartAt H x'))
    

Proof state:
case intro.intro.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
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
x' : ↥s
he' : e' = subtypeRestr (chartAt H ↑x') s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.restr (PartialHomeomorph.symm (chartAt H ↑x) ≫ₕ chartAt H ↑x')
      ((chartAt H ↑x).toPartialEquiv.target ∩ ↑(PartialHomeomorph.symm (chartAt H ↑x)) ⁻¹' ↑s) ∈
    G

Next tactic:
apply closedUnderRestriction'
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    rw [hc'.symm, mem_singleton_iff] at he'
    rw [he, he']
    refine' G.eq_on_source _ (subtypeRestr_symm_trans_subtypeRestr s (chartAt H x) (chartAt H x'))
    apply closedUnderRestriction'
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.he
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
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
x' : ↥s
he' : e' = subtypeRestr (chartAt H ↑x') s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ PartialHomeomorph.symm (chartAt H ↑x) ≫ₕ chartAt H ↑x' ∈ G

Next tactic:
exact G.compatible (chart_mem_atlas _ _) (chart_mem_atlas _ _)
/-- If a groupoid `G` is `ClosedUnderRestriction`, then an open subset of a space which is
`HasGroupoid G` is naturally `HasGroupoid G`. -/
protected instance instHasGroupoid [ClosedUnderRestriction G] : HasGroupoid s G where
  compatible := by
    rintro e e' ⟨_, ⟨x, hc⟩, he⟩ ⟨_, ⟨x', hc'⟩, he'⟩
    haveI : Nonempty s := ⟨x⟩
    rw [hc.symm, mem_singleton_iff] at he
    rw [hc'.symm, mem_singleton_iff] at he'
    rw [he, he']
    refine' G.eq_on_source _ (subtypeRestr_symm_trans_subtypeRestr s (chartAt H x) (chartAt H x'))
    apply closedUnderRestriction'
    · exact G.compatible (chart_mem_atlas _ _) (chart_mem_atlas _ _)
    · 

Proof state:
case intro.intro.intro.intro.intro.intro.hs
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
G : StructureGroupoid H
inst✝¹ : HasGroupoid M G
s : Opens M
inst✝ : ClosedUnderRestriction G
e e' : PartialHomeomorph (↥s) H
w✝¹ : Set (PartialHomeomorph (↥s) H)
x : ↥s
he : e = subtypeRestr (chartAt H ↑x) s
hc : (fun x => {subtypeRestr (chartAt H ↑x) s}) x = w✝¹
w✝ : Set (PartialHomeomorph (↥s) H)
x' : ↥s
he' : e' = subtypeRestr (chartAt H ↑x') s
hc' : (fun x => {subtypeRestr (chartAt H ↑x) s}) x' = w✝
this : Nonempty ↥s
⊢ IsOpen ((chartAt H ↑x).toPartialEquiv.target ∩ ↑(PartialHomeomorph.symm (chartAt H ↑x)) ⁻¹' ↑s)

Next tactic:
exact isOpen_inter_preimage_symm (chartAt _ _) s.2
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
    (chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := 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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s U : Opens M
x : ↥U
⊢ ↑(PartialHomeomorph.symm (chartAt H ↑x)) =ᶠ[𝓝 (↑(chartAt H ↑x) ↑x)]
    Subtype.val ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
set i : U → M := Subtype.val
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
    (chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := by
  set i : U → M := Subtype.val
  

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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s U : Opens M
x : ↥U
i : ↥U → M := Subtype.val
⊢ ↑(PartialHomeomorph.symm (chartAt H (i x))) =ᶠ[𝓝 (↑(chartAt H (i x)) (i x))]
    i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
set e := chartAt H x.val
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
    (chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := by
  set i : U → M := Subtype.val
  set e := chartAt H x.val
  

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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s U : Opens M
x : ↥U
i : ↥U → M := Subtype.val
e : PartialHomeomorph M H := chartAt H ↑x
⊢ ↑(PartialHomeomorph.symm e) =ᶠ[𝓝 (↑e (i x))] i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
haveI : Nonempty U := ⟨x⟩
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
    (chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := by
  set i : U → M := Subtype.val
  set e := chartAt H x.val
  haveI : Nonempty U := ⟨x⟩
  

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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s U : Opens M
x : ↥U
i : ↥U → M := Subtype.val
e : PartialHomeomorph M H := chartAt H ↑x
this : Nonempty ↥U
⊢ ↑(PartialHomeomorph.symm e) =ᶠ[𝓝 (↑e (i x))] i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
haveI : Nonempty M := ⟨i x⟩
theorem chartAt_subtype_val_symm_eventuallyEq (U : Opens M) {x : U} :
    (chartAt H x.val).symm =ᶠ[𝓝 (chartAt H x.val x.val)] Subtype.val ∘ (chartAt H x).symm := by
  set i : U → M := Subtype.val
  set e := chartAt H x.val
  haveI : Nonempty U := ⟨x⟩
  haveI : Nonempty M := ⟨i x⟩
  

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
G : StructureGroupoid H
inst✝ : HasGroupoid M G
s U : Opens M
x : ↥U
i : ↥U → M := Subtype.val
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty M
⊢ ↑(PartialHomeomorph.symm e) =ᶠ[𝓝 (↑e (i x))] i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
have heUx_nhds : (e.subtypeRestr U).target ∈ 𝓝 (e x) := by
    apply (e.subtypeRestr U).open_target.mem_nhds
    exact e.map_subtype_source (mem_chart_source _ _)