l3lab/ntp-mathlib huggingface dataset:
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
  constructor
  · intro hf h2x
    obtain ⟨e, he, hfe, hxe⟩ := hf h2x
    refine' ⟨e.restr f.source, closedUnderRestriction' he f.open_source, _, _, hxe, _⟩
    · simp_rw [PartialHomeomorph.restr_source]
      refine' (inter_subset_right _ _).trans interior_subset
    · intro x' hx'
      exact hfe ⟨hx'.1, hx'.2.1⟩
    · 

Proof state:
case mp.intro.intro.intro.refine'_3
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e✝ e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hx : x ∈ f.source ∪ sᶜ
hf : IsLocalStructomorphWithinAt G (↑f) s x
h2x : x ∈ s
e : PartialHomeomorph H H
he : e ∈ G
hfe : EqOn (↑f) (↑e.toPartialEquiv) (s ∩ e.source)
hxe : x ∈ e.source
⊢ x ∈ interior f.source

Next tactic:
rw [f.open_source.interior_eq]
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
  constructor
  · intro hf h2x
    obtain ⟨e, he, hfe, hxe⟩ := hf h2x
    refine' ⟨e.restr f.source, closedUnderRestriction' he f.open_source, _, _, hxe, _⟩
    · simp_rw [PartialHomeomorph.restr_source]
      refine' (inter_subset_right _ _).trans interior_subset
    · intro x' hx'
      exact hfe ⟨hx'.1, hx'.2.1⟩
    · rw [f.open_source.interior_eq]
      

Proof state:
case mp.intro.intro.intro.refine'_3
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e✝ e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hx : x ∈ f.source ∪ sᶜ
hf : IsLocalStructomorphWithinAt G (↑f) s x
h2x : x ∈ s
e : PartialHomeomorph H H
he : e ∈ G
hfe : EqOn (↑f) (↑e.toPartialEquiv) (s ∩ e.source)
hxe : x ∈ e.source
⊢ x ∈ f.source

Next tactic:
exact Or.resolve_right hx (not_not.mpr h2x)
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
  constructor
  · intro hf h2x
    obtain ⟨e, he, hfe, hxe⟩ := hf h2x
    refine' ⟨e.restr f.source, closedUnderRestriction' he f.open_source, _, _, hxe, _⟩
    · simp_rw [PartialHomeomorph.restr_source]
      refine' (inter_subset_right _ _).trans interior_subset
    · intro x' hx'
      exact hfe ⟨hx'.1, hx'.2.1⟩
    · rw [f.open_source.interior_eq]
      exact Or.resolve_right hx (not_not.mpr h2x)
  · 

Proof state:
case mpr
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hx : x ∈ f.source ∪ sᶜ
⊢ (x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source) →
    IsLocalStructomorphWithinAt G (↑f) s x

Next tactic:
intro hf hx
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
  constructor
  · intro hf h2x
    obtain ⟨e, he, hfe, hxe⟩ := hf h2x
    refine' ⟨e.restr f.source, closedUnderRestriction' he f.open_source, _, _, hxe, _⟩
    · simp_rw [PartialHomeomorph.restr_source]
      refine' (inter_subset_right _ _).trans interior_subset
    · intro x' hx'
      exact hfe ⟨hx'.1, hx'.2.1⟩
    · rw [f.open_source.interior_eq]
      exact Or.resolve_right hx (not_not.mpr h2x)
  · intro hf hx
    

Proof state:
case mpr
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hx✝ : x ∈ f.source ∪ sᶜ
hf : x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source
hx : x ∈ s
⊢ ∃ e ∈ G, EqOn (↑f) (↑e.toPartialEquiv) (s ∩ e.source) ∧ x ∈ e.source

Next tactic:
obtain ⟨e, he, _, hfe, hxe⟩ := hf hx
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source := by
  constructor
  · intro hf h2x
    obtain ⟨e, he, hfe, hxe⟩ := hf h2x
    refine' ⟨e.restr f.source, closedUnderRestriction' he f.open_source, _, _, hxe, _⟩
    · simp_rw [PartialHomeomorph.restr_source]
      refine' (inter_subset_right _ _).trans interior_subset
    · intro x' hx'
      exact hfe ⟨hx'.1, hx'.2.1⟩
    · rw [f.open_source.interior_eq]
      exact Or.resolve_right hx (not_not.mpr h2x)
  · intro hf hx
    obtain ⟨e, he, _, hfe, hxe⟩ := hf hx
    

Proof state:
case mpr.intro.intro.intro.intro
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e✝ e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hx✝ : x ∈ f.source ∪ sᶜ
hf : x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source
hx : x ∈ s
e : PartialHomeomorph H H
he : e ∈ G
left✝ : e.source ⊆ f.source
hfe : EqOn (↑f) (↑e) (s ∩ e.source)
hxe : x ∈ e.source
⊢ ∃ e ∈ G, EqOn (↑f) (↑e.toPartialEquiv) (s ∩ e.source) ∧ x ∈ e.source

Next tactic:
exact ⟨e, he, hfe, hxe⟩
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph and
  the set we're considering is a superset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff' {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hs : f.source ⊆ s)
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source := by
  

Proof state:
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hs : f.source ⊆ s
hx : x ∈ f.source ∪ sᶜ
⊢ IsLocalStructomorphWithinAt G (↑f) s x ↔ x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) e.source ∧ x ∈ e.source

Next tactic:
rw [f.isLocalStructomorphWithinAt_iff hx]
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph and
  the set we're considering is a superset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff' {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hs : f.source ⊆ s)
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source := by
  rw [f.isLocalStructomorphWithinAt_iff hx]
  

Proof state:
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hs : f.source ⊆ s
hx : x ∈ f.source ∪ sᶜ
⊢ (x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source) ↔
    x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ EqOn (↑f) (↑e) e.source ∧ x ∈ e.source

Next tactic:
refine' imp_congr_right fun _ ↦ exists_congr fun e ↦ and_congr_right fun _ ↦ _
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph and
  the set we're considering is a superset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff' {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hs : f.source ⊆ s)
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source := by
  rw [f.isLocalStructomorphWithinAt_iff hx]
  refine' imp_congr_right fun _ ↦ exists_congr fun e ↦ and_congr_right fun _ ↦ _
  

Proof state:
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e✝ e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝² : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hs : f.source ⊆ s
hx : x ∈ f.source ∪ sᶜ
x✝¹ : x ∈ s
e : PartialHomeomorph H H
x✝ : e ∈ G
⊢ e.source ⊆ f.source ∧ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source ↔
    e.source ⊆ f.source ∧ EqOn (↑f) (↑e) e.source ∧ x ∈ e.source

Next tactic:
refine' and_congr_right fun h2e ↦ _
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph and
  the set we're considering is a superset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff' {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H} (hs : f.source ⊆ s)
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source := by
  rw [f.isLocalStructomorphWithinAt_iff hx]
  refine' imp_congr_right fun _ ↦ exists_congr fun e ↦ and_congr_right fun _ ↦ _
  refine' and_congr_right fun h2e ↦ _
  

Proof state:
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e✝ e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s✝ t : Set M
x✝² : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
s : Set H
x : H
hs : f.source ⊆ s
hx : x ∈ f.source ∪ sᶜ
x✝¹ : x ∈ s
e : PartialHomeomorph H H
x✝ : e ∈ G
h2e : e.source ⊆ f.source
⊢ EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source ↔ EqOn (↑f) (↑e) e.source ∧ x ∈ e.source

Next tactic:
rw [inter_eq_right.mpr (h2e.trans hs)]
/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a local homeomorph and
  the set we're considering is `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_source_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {x : H} :
    G.IsLocalStructomorphWithinAt (⇑f) f.source x ↔
      x ∈ f.source → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) e.source ∧ x ∈ e.source :=
  haveI : x ∈ f.source ∪ f.sourceᶜ := by 

Proof state:
H : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝⁷ : TopologicalSpace H
inst✝⁶ : TopologicalSpace M
inst✝⁵ : ChartedSpace H M
inst✝⁴ : TopologicalSpace H'
inst✝³ : TopologicalSpace M'
inst✝² : ChartedSpace H' M'
inst✝¹ : TopologicalSpace X
G✝ : StructureGroupoid H
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H
f✝ f' : PartialHomeomorph M' H'
P : (H → H') → Set H → H → Prop
g g' : M → M'
s t : Set M
x✝ : M
Q : (H → H) → Set H → H → Prop
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
f : PartialHomeomorph H H
x : H
⊢ x ∈ f.source ∪ f.sourceᶜ

Next tactic:
simp_rw [union_compl_self, mem_univ]
theorem HasGroupoid.comp
    (H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (e : H₂ → H₂) e.source) :
    @HasGroupoid H₁ _ H₃ _ (ChartedSpace.comp H₁ H₂ H₃) G₁ :=
  let _ := ChartedSpace.comp H₁ H₂ H₃ -- Porting note: need this to synthesize `ChartedSpace H₁ H₃`
  { compatible := by
      

Proof state:
H✝ : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝¹⁴ : TopologicalSpace H✝
inst✝¹³ : TopologicalSpace M
inst✝¹² : ChartedSpace H✝ M
inst✝¹¹ : TopologicalSpace H'
inst✝¹⁰ : TopologicalSpace M'
inst✝⁹ : ChartedSpace H' M'
inst✝⁸ : TopologicalSpace X
G : StructureGroupoid H✝
G' : StructureGroupoid H'
e e' : PartialHomeomorph M H✝
f f' : PartialHomeomorph M' H'
P : (H✝ → H') → Set H✝ → H✝ → Prop
g g' : M → M'
s t : Set M
x : M
Q : (H✝ → H✝) → Set H✝ → H✝ → Prop
H₁ : Type u_6
inst✝⁷ : TopologicalSpace H₁
H₂ : Type u_7
inst✝⁶ : TopologicalSpace H₂
H₃ : Type u_8
inst✝⁵ : TopologicalSpace H₃
inst✝⁴ : ChartedSpace H₁ H₂
inst✝³ : ChartedSpace H₂ H₃
G₁ : StructureGroupoid H₁
inst✝² : HasGroupoid H₂ G₁
inst✝¹ : ClosedUnderRestriction G₁
G₂ : StructureGroupoid H₂
inst✝ : HasGroupoid H₃ G₂
H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (↑e) e.source
x✝ : ChartedSpace H₁ H₃ := ChartedSpace.comp H₁ H₂ H₃
⊢ ∀ {e e' : PartialHomeomorph H₃ H₁}, e ∈ atlas H₁ H₃ → e' ∈ atlas H₁ H₃ → PartialHomeomorph.symm e ≫ₕ e' ∈ G₁

Next tactic:
rintro _ _ ⟨e, f, he, hf, rfl⟩ ⟨e', f', he', hf', rfl⟩
theorem HasGroupoid.comp
    (H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (e : H₂ → H₂) e.source) :
    @HasGroupoid H₁ _ H₃ _ (ChartedSpace.comp H₁ H₂ H₃) G₁ :=
  let _ := ChartedSpace.comp H₁ H₂ H₃ -- Porting note: need this to synthesize `ChartedSpace H₁ H₃`
  { compatible := by
      rintro _ _ ⟨e, f, he, hf, rfl⟩ ⟨e', f', he', hf', rfl⟩
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
H✝ : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝¹⁴ : TopologicalSpace H✝
inst✝¹³ : TopologicalSpace M
inst✝¹² : ChartedSpace H✝ M
inst✝¹¹ : TopologicalSpace H'
inst✝¹⁰ : TopologicalSpace M'
inst✝⁹ : ChartedSpace H' M'
inst✝⁸ : TopologicalSpace X
G : StructureGroupoid H✝
G' : StructureGroupoid H'
e✝ e'✝ : PartialHomeomorph M H✝
f✝ f'✝ : PartialHomeomorph M' H'
P : (H✝ → H') → Set H✝ → H✝ → Prop
g g' : M → M'
s t : Set M
x : M
Q : (H✝ → H✝) → Set H✝ → H✝ → Prop
H₁ : Type u_6
inst✝⁷ : TopologicalSpace H₁
H₂ : Type u_7
inst✝⁶ : TopologicalSpace H₂
H₃ : Type u_8
inst✝⁵ : TopologicalSpace H₃
inst✝⁴ : ChartedSpace H₁ H₂
inst✝³ : ChartedSpace H₂ H₃
G₁ : StructureGroupoid H₁
inst✝² : HasGroupoid H₂ G₁
inst✝¹ : ClosedUnderRestriction G₁
G₂ : StructureGroupoid H₂
inst✝ : HasGroupoid H₃ G₂
H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (↑e) e.source
x✝ : ChartedSpace H₁ H₃ := ChartedSpace.comp H₁ H₂ H₃
e : PartialHomeomorph H₃ H₂
f : PartialHomeomorph H₂ H₁
he : e ∈ atlas H₂ H₃
hf : f ∈ atlas H₁ H₂
e' : PartialHomeomorph H₃ H₂
f' : PartialHomeomorph H₂ H₁
he' : e' ∈ atlas H₂ H₃
hf' : f' ∈ atlas H₁ H₂
⊢ PartialHomeomorph.symm (e ≫ₕ f) ≫ₕ e' ≫ₕ f' ∈ G₁

Next tactic:
apply G₁.locality
theorem HasGroupoid.comp
    (H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (e : H₂ → H₂) e.source) :
    @HasGroupoid H₁ _ H₃ _ (ChartedSpace.comp H₁ H₂ H₃) G₁ :=
  let _ := ChartedSpace.comp H₁ H₂ H₃ -- Porting note: need this to synthesize `ChartedSpace H₁ H₃`
  { compatible := by
      rintro _ _ ⟨e, f, he, hf, rfl⟩ ⟨e', f', he', hf', rfl⟩
      apply G₁.locality
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
H✝ : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝¹⁴ : TopologicalSpace H✝
inst✝¹³ : TopologicalSpace M
inst✝¹² : ChartedSpace H✝ M
inst✝¹¹ : TopologicalSpace H'
inst✝¹⁰ : TopologicalSpace M'
inst✝⁹ : ChartedSpace H' M'
inst✝⁸ : TopologicalSpace X
G : StructureGroupoid H✝
G' : StructureGroupoid H'
e✝ e'✝ : PartialHomeomorph M H✝
f✝ f'✝ : PartialHomeomorph M' H'
P : (H✝ → H') → Set H✝ → H✝ → Prop
g g' : M → M'
s t : Set M
x : M
Q : (H✝ → H✝) → Set H✝ → H✝ → Prop
H₁ : Type u_6
inst✝⁷ : TopologicalSpace H₁
H₂ : Type u_7
inst✝⁶ : TopologicalSpace H₂
H₃ : Type u_8
inst✝⁵ : TopologicalSpace H₃
inst✝⁴ : ChartedSpace H₁ H₂
inst✝³ : ChartedSpace H₂ H₃
G₁ : StructureGroupoid H₁
inst✝² : HasGroupoid H₂ G₁
inst✝¹ : ClosedUnderRestriction G₁
G₂ : StructureGroupoid H₂
inst✝ : HasGroupoid H₃ G₂
H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (↑e) e.source
x✝ : ChartedSpace H₁ H₃ := ChartedSpace.comp H₁ H₂ H₃
e : PartialHomeomorph H₃ H₂
f : PartialHomeomorph H₂ H₁
he : e ∈ atlas H₂ H₃
hf : f ∈ atlas H₁ H₂
e' : PartialHomeomorph H₃ H₂
f' : PartialHomeomorph H₂ H₁
he' : e' ∈ atlas H₂ H₃
hf' : f' ∈ atlas H₁ H₂
⊢ ∀ x ∈ (PartialHomeomorph.symm (e ≫ₕ f) ≫ₕ e' ≫ₕ f').toPartialEquiv.source,
    ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr (PartialHomeomorph.symm (e ≫ₕ f) ≫ₕ e' ≫ₕ f') s ∈ G₁

Next tactic:
intro x hx
theorem HasGroupoid.comp
    (H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (e : H₂ → H₂) e.source) :
    @HasGroupoid H₁ _ H₃ _ (ChartedSpace.comp H₁ H₂ H₃) G₁ :=
  let _ := ChartedSpace.comp H₁ H₂ H₃ -- Porting note: need this to synthesize `ChartedSpace H₁ H₃`
  { compatible := by
      rintro _ _ ⟨e, f, he, hf, rfl⟩ ⟨e', f', he', hf', rfl⟩
      apply G₁.locality
      intro x hx
      

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
H✝ : Type u_1
M : Type u_2
H' : Type u_3
M' : Type u_4
X : Type u_5
inst✝¹⁴ : TopologicalSpace H✝
inst✝¹³ : TopologicalSpace M
inst✝¹² : ChartedSpace H✝ M
inst✝¹¹ : TopologicalSpace H'
inst✝¹⁰ : TopologicalSpace M'
inst✝⁹ : ChartedSpace H' M'
inst✝⁸ : TopologicalSpace X
G : StructureGroupoid H✝
G' : StructureGroupoid H'
e✝ e'✝ : PartialHomeomorph M H✝
f✝ f'✝ : PartialHomeomorph M' H'
P : (H✝ → H') → Set H✝ → H✝ → Prop
g g' : M → M'
s t : Set M
x✝¹ : M
Q : (H✝ → H✝) → Set H✝ → H✝ → Prop
H₁ : Type u_6
inst✝⁷ : TopologicalSpace H₁
H₂ : Type u_7
inst✝⁶ : TopologicalSpace H₂
H₃ : Type u_8
inst✝⁵ : TopologicalSpace H₃
inst✝⁴ : ChartedSpace H₁ H₂
inst✝³ : ChartedSpace H₂ H₃
G₁ : StructureGroupoid H₁
inst✝² : HasGroupoid H₂ G₁
inst✝¹ : ClosedUnderRestriction G₁
G₂ : StructureGroupoid H₂
inst✝ : HasGroupoid H₃ G₂
H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (↑e) e.source
x✝ : ChartedSpace H₁ H₃ := ChartedSpace.comp H₁ H₂ H₃
e : PartialHomeomorph H₃ H₂
f : PartialHomeomorph H₂ H₁
he : e ∈ atlas H₂ H₃
hf : f ∈ atlas H₁ H₂
e' : PartialHomeomorph H₃ H₂
f' : PartialHomeomorph H₂ H₁
he' : e' ∈ atlas H₂ H₃
hf' : f' ∈ atlas H₁ H₂
x : H₁
hx : x ∈ (PartialHomeomorph.symm (e ≫ₕ f) ≫ₕ e' ≫ₕ f').toPartialEquiv.source
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr (PartialHomeomorph.symm (e ≫ₕ f) ≫ₕ e' ≫ₕ f') s ∈ G₁

Next tactic:
simp only [mfld_simps] at hx