l3lab/ntp-mathlib huggingface dataset:
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⟩
  have heUx_nhds : (e.subtypeRestr U).target ∈ 𝓝 (e 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 U : Opens M
x : ↥U
i : ↥U → M := Subtype.val
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty M
⊢ (subtypeRestr e U).toPartialEquiv.target ∈ 𝓝 (↑e ↑x)

Next tactic:
apply (e.subtypeRestr U).open_target.mem_nhds
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⟩
  have heUx_nhds : (e.subtypeRestr U).target ∈ 𝓝 (e x) := by
    apply (e.subtypeRestr U).open_target.mem_nhds
    

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
⊢ ↑e ↑x ∈ (subtypeRestr e U).toPartialEquiv.target

Next tactic:
exact e.map_subtype_source (mem_chart_source _ _)
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⟩
  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 _ _)
  

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
heUx_nhds : (subtypeRestr e U).toPartialEquiv.target ∈ 𝓝 (↑e ↑x)
⊢ ↑(PartialHomeomorph.symm e) =ᶠ[𝓝 (↑e (i x))] i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
exact Filter.eventuallyEq_of_mem heUx_nhds (e.subtypeRestr_symm_eqOn U)
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (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 V : Opens M
hUV : U ≤ V
x : ↥U
⊢ ↑(PartialHomeomorph.symm (chartAt H (inclusion hUV x))) =ᶠ[𝓝 (↑(chartAt H (inclusion hUV x)) (inclusion hUV x))]
    inclusion hUV ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
set i := Set.inclusion hUV
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  

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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
⊢ ↑(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 : M)
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  

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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
⊢ ↑(PartialHomeomorph.symm (chartAt H (i x))) =ᶠ[𝓝 (↑(chartAt H (i x)) (i x))]
    i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
haveI : Nonempty U := ⟨x⟩
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
this : Nonempty ↥U
⊢ ↑(PartialHomeomorph.symm (chartAt H (i x))) =ᶠ[𝓝 (↑(chartAt H (i x)) (i x))]
    i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
haveI : Nonempty V := ⟨i x⟩
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  haveI : Nonempty U := ⟨x⟩
  haveI : Nonempty V := ⟨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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty ↥V
⊢ ↑(PartialHomeomorph.symm (chartAt H (i x))) =ᶠ[𝓝 (↑(chartAt H (i x)) (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 _ _)
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  haveI : Nonempty U := ⟨x⟩
  haveI : Nonempty V := ⟨i x⟩
  have heUx_nhds : (e.subtypeRestr U).target ∈ 𝓝 (e 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 U V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty ↥V
⊢ (subtypeRestr e U).toPartialEquiv.target ∈ 𝓝 (↑e ↑x)

Next tactic:
apply (e.subtypeRestr U).open_target.mem_nhds
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  haveI : Nonempty U := ⟨x⟩
  haveI : Nonempty V := ⟨i x⟩
  have heUx_nhds : (e.subtypeRestr U).target ∈ 𝓝 (e x) := by
    apply (e.subtypeRestr U).open_target.mem_nhds
    

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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty ↥V
⊢ ↑e ↑x ∈ (subtypeRestr e U).toPartialEquiv.target

Next tactic:
exact e.map_subtype_source (mem_chart_source _ _)
theorem chartAt_inclusion_symm_eventuallyEq {U V : Opens M} (hUV : U ≤ V) {x : U} :
    (chartAt H (Set.inclusion hUV x)).symm
    =ᶠ[𝓝 (chartAt H (Set.inclusion hUV x) (Set.inclusion hUV x))]
    Set.inclusion hUV ∘ (chartAt H x).symm := by
  set i := Set.inclusion hUV
  set e := chartAt H (x : M)
  haveI : Nonempty U := ⟨x⟩
  haveI : Nonempty V := ⟨i x⟩
  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 _ _)
  

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 V : Opens M
hUV : U ≤ V
x : ↥U
i : ↑↑U → ↑↑V := inclusion hUV
e : PartialHomeomorph M H := chartAt H ↑x
this✝ : Nonempty ↥U
this : Nonempty ↥V
heUx_nhds : (subtypeRestr e U).toPartialEquiv.target ∈ 𝓝 (↑e ↑x)
⊢ ↑(PartialHomeomorph.symm (chartAt H (i x))) =ᶠ[𝓝 (↑(chartAt H (i x)) (i x))]
    i ∘ ↑(PartialHomeomorph.symm (chartAt H x))

Next tactic:
exact Filter.eventuallyEq_of_mem heUx_nhds (e.subtypeRestr_symm_eqOn_of_le hUV)
/-- The identity is a diffeomorphism of any charted space, for any groupoid. -/
def Structomorph.refl (M : Type*) [TopologicalSpace M] [ChartedSpace H M] [HasGroupoid M G] :
    Structomorph G M M :=
  { Homeomorph.refl M with
    mem_groupoid := fun c c' hc hc' ↦ 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 M'
inst✝⁵ : TopologicalSpace M''
G : StructureGroupoid H
inst✝⁴ : ChartedSpace H M'
inst✝³ : ChartedSpace H M''
M : Type u_5
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : HasGroupoid M G
src✝ : M ≃ₜ M := Homeomorph.refl M
c c' : PartialHomeomorph M H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M
⊢ PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
change PartialHomeomorph.symm c ≫ₕ PartialHomeomorph.refl M ≫ₕ c' ∈ G
/-- The identity is a diffeomorphism of any charted space, for any groupoid. -/
def Structomorph.refl (M : Type*) [TopologicalSpace M] [ChartedSpace H M] [HasGroupoid M G] :
    Structomorph G M M :=
  { Homeomorph.refl M with
    mem_groupoid := fun c c' hc hc' ↦ by
      change PartialHomeomorph.symm c ≫ₕ PartialHomeomorph.refl M ≫ₕ c' ∈ G
      

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 M'
inst✝⁵ : TopologicalSpace M''
G : StructureGroupoid H
inst✝⁴ : ChartedSpace H M'
inst✝³ : ChartedSpace H M''
M : Type u_5
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : HasGroupoid M G
src✝ : M ≃ₜ M := Homeomorph.refl M
c c' : PartialHomeomorph M H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M
⊢ PartialHomeomorph.symm c ≫ₕ PartialHomeomorph.refl M ≫ₕ c' ∈ G

Next tactic:
rw [PartialHomeomorph.refl_trans]
/-- The identity is a diffeomorphism of any charted space, for any groupoid. -/
def Structomorph.refl (M : Type*) [TopologicalSpace M] [ChartedSpace H M] [HasGroupoid M G] :
    Structomorph G M M :=
  { Homeomorph.refl M with
    mem_groupoid := fun c c' hc hc' ↦ by
      change PartialHomeomorph.symm c ≫ₕ PartialHomeomorph.refl M ≫ₕ c' ∈ G
      rw [PartialHomeomorph.refl_trans]
      

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 M'
inst✝⁵ : TopologicalSpace M''
G : StructureGroupoid H
inst✝⁴ : ChartedSpace H M'
inst✝³ : ChartedSpace H M''
M : Type u_5
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : HasGroupoid M G
src✝ : M ≃ₜ M := Homeomorph.refl M
c c' : PartialHomeomorph M H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M
⊢ PartialHomeomorph.symm c ≫ₕ c' ∈ G

Next tactic:
exact G.compatible hc hc'
/-- The inverse of a structomorphism is a structomorphism. -/
def Structomorph.symm (e : Structomorph G M M') : Structomorph G M' M :=
  { e.toHomeomorph.symm with
    mem_groupoid := 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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
src✝ : M' ≃ₜ M := Homeomorph.symm e.toHomeomorph
⊢ ∀ (c : PartialHomeomorph M' H) (c' : PartialHomeomorph M H),
    c ∈ atlas H M' →
      c' ∈ atlas H M → PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
intro c c' hc hc'
/-- The inverse of a structomorphism is a structomorphism. -/
def Structomorph.symm (e : Structomorph G M M') : Structomorph G M' M :=
  { e.toHomeomorph.symm with
    mem_groupoid := by
      intro c c' hc hc'
      

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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
src✝ : M' ≃ₜ M := Homeomorph.symm e.toHomeomorph
c : PartialHomeomorph M' H
c' : PartialHomeomorph M H
hc : c ∈ atlas H M'
hc' : c' ∈ atlas H M
⊢ PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
have : (c'.symm ≫ₕ e.toHomeomorph.toPartialHomeomorph ≫ₕ c).symm ∈ G :=
        G.symm (e.mem_groupoid c' c hc' hc)
/-- The inverse of a structomorphism is a structomorphism. -/
def Structomorph.symm (e : Structomorph G M M') : Structomorph G M' M :=
  { e.toHomeomorph.symm with
    mem_groupoid := by
      intro c c' hc hc'
      have : (c'.symm ≫ₕ e.toHomeomorph.toPartialHomeomorph ≫ₕ c).symm ∈ G :=
        G.symm (e.mem_groupoid c' c hc' hc)
      

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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
src✝ : M' ≃ₜ M := Homeomorph.symm e.toHomeomorph
c : PartialHomeomorph M' H
c' : PartialHomeomorph M H
hc : c ∈ atlas H M'
hc' : c' ∈ atlas H M
this : PartialHomeomorph.symm (PartialHomeomorph.symm c' ≫ₕ Homeomorph.toPartialHomeomorph e.toHomeomorph ≫ₕ c) ∈ G
⊢ PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
rwa [trans_symm_eq_symm_trans_symm, trans_symm_eq_symm_trans_symm, symm_symm, trans_assoc]
        at this
/-- The composition of structomorphisms is a structomorphism. -/
def Structomorph.trans (e : Structomorph G M M') (e' : Structomorph G M' M'') :
    Structomorph G M M'' :=
  { Homeomorph.trans e.toHomeomorph e'.toHomeomorph with
    mem_groupoid := by
      /- Let c and c' be two charts in M and M''. We want to show that e' ∘ e is smooth in these
      charts, around any point x. For this, let y = e (c⁻¹ x), and consider a chart g around y.
      Then g ∘ e ∘ c⁻¹ and c' ∘ e' ∘ g⁻¹ are both smooth as e and e' are structomorphisms, so
      their composition is smooth, and it coincides with c' ∘ e' ∘ e ∘ c⁻¹ around 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
inst✝³ : TopologicalSpace M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
e' : Structomorph G M' M''
src✝ : M ≃ₜ M'' := Homeomorph.trans e.toHomeomorph e'.toHomeomorph
⊢ ∀ (c : PartialHomeomorph M H) (c' : PartialHomeomorph M'' H),
    c ∈ atlas H M →
      c' ∈ atlas H M'' →
        PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
intro c c' hc hc'
/-- The composition of structomorphisms is a structomorphism. -/
def Structomorph.trans (e : Structomorph G M M') (e' : Structomorph G M' M'') :
    Structomorph G M M'' :=
  { Homeomorph.trans e.toHomeomorph e'.toHomeomorph with
    mem_groupoid := by
      /- Let c and c' be two charts in M and M''. We want to show that e' ∘ e is smooth in these
      charts, around any point x. For this, let y = e (c⁻¹ x), and consider a chart g around y.
      Then g ∘ e ∘ c⁻¹ and c' ∘ e' ∘ g⁻¹ are both smooth as e and e' are structomorphisms, so
      their composition is smooth, and it coincides with c' ∘ e' ∘ e ∘ c⁻¹ around x. -/
      intro c c' hc hc'
      

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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
e' : Structomorph G M' M''
src✝ : M ≃ₜ M'' := Homeomorph.trans e.toHomeomorph e'.toHomeomorph
c : PartialHomeomorph M H
c' : PartialHomeomorph M'' H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M''
⊢ PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c' ∈ G

Next tactic:
refine' G.locality fun x hx ↦ _
/-- The composition of structomorphisms is a structomorphism. -/
def Structomorph.trans (e : Structomorph G M M') (e' : Structomorph G M' M'') :
    Structomorph G M M'' :=
  { Homeomorph.trans e.toHomeomorph e'.toHomeomorph with
    mem_groupoid := by
      /- Let c and c' be two charts in M and M''. We want to show that e' ∘ e is smooth in these
      charts, around any point x. For this, let y = e (c⁻¹ x), and consider a chart g around y.
      Then g ∘ e ∘ c⁻¹ and c' ∘ e' ∘ g⁻¹ are both smooth as e and e' are structomorphisms, so
      their composition is smooth, and it coincides with c' ∘ e' ∘ e ∘ c⁻¹ around x. -/
      intro c c' hc hc'
      refine' G.locality fun x 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
inst✝⁵ : TopologicalSpace M
inst✝⁴ : ChartedSpace H M
inst✝³ : TopologicalSpace M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
e' : Structomorph G M' M''
src✝ : M ≃ₜ M'' := Homeomorph.trans e.toHomeomorph e'.toHomeomorph
c : PartialHomeomorph M H
c' : PartialHomeomorph M'' H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M''
x : H
hx :
  x ∈
    (PartialHomeomorph.symm c ≫ₕ
          Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c').toPartialEquiv.source
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let f₁ := e.toHomeomorph.toPartialHomeomorph
/-- The composition of structomorphisms is a structomorphism. -/
def Structomorph.trans (e : Structomorph G M M') (e' : Structomorph G M' M'') :
    Structomorph G M M'' :=
  { Homeomorph.trans e.toHomeomorph e'.toHomeomorph with
    mem_groupoid := by
      /- Let c and c' be two charts in M and M''. We want to show that e' ∘ e is smooth in these
      charts, around any point x. For this, let y = e (c⁻¹ x), and consider a chart g around y.
      Then g ∘ e ∘ c⁻¹ and c' ∘ e' ∘ g⁻¹ are both smooth as e and e' are structomorphisms, so
      their composition is smooth, and it coincides with c' ∘ e' ∘ e ∘ c⁻¹ around x. -/
      intro c c' hc hc'
      refine' G.locality fun x hx ↦ _
      let f₁ := e.toHomeomorph.toPartialHomeomorph
      

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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
e' : Structomorph G M' M''
src✝ : M ≃ₜ M'' := Homeomorph.trans e.toHomeomorph e'.toHomeomorph
c : PartialHomeomorph M H
c' : PartialHomeomorph M'' H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M''
x : H
hx :
  x ∈
    (PartialHomeomorph.symm c ≫ₕ
          Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c').toPartialEquiv.source
f₁ : PartialHomeomorph M M' := Homeomorph.toPartialHomeomorph e.toHomeomorph
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let f₂ := e'.toHomeomorph.toPartialHomeomorph
/-- The composition of structomorphisms is a structomorphism. -/
def Structomorph.trans (e : Structomorph G M M') (e' : Structomorph G M' M'') :
    Structomorph G M M'' :=
  { Homeomorph.trans e.toHomeomorph e'.toHomeomorph with
    mem_groupoid := by
      /- Let c and c' be two charts in M and M''. We want to show that e' ∘ e is smooth in these
      charts, around any point x. For this, let y = e (c⁻¹ x), and consider a chart g around y.
      Then g ∘ e ∘ c⁻¹ and c' ∘ e' ∘ g⁻¹ are both smooth as e and e' are structomorphisms, so
      their composition is smooth, and it coincides with c' ∘ e' ∘ e ∘ c⁻¹ around x. -/
      intro c c' hc hc'
      refine' G.locality fun x hx ↦ _
      let f₁ := e.toHomeomorph.toPartialHomeomorph
      let f₂ := e'.toHomeomorph.toPartialHomeomorph
      

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 M'
inst✝² : TopologicalSpace M''
G : StructureGroupoid H
inst✝¹ : ChartedSpace H M'
inst✝ : ChartedSpace H M''
e : Structomorph G M M'
e' : Structomorph G M' M''
src✝ : M ≃ₜ M'' := Homeomorph.trans e.toHomeomorph e'.toHomeomorph
c : PartialHomeomorph M H
c' : PartialHomeomorph M'' H
hc : c ∈ atlas H M
hc' : c' ∈ atlas H M''
x : H
hx :
  x ∈
    (PartialHomeomorph.symm c ≫ₕ
          Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c').toPartialEquiv.source
f₁ : PartialHomeomorph M M' := Homeomorph.toPartialHomeomorph e.toHomeomorph
f₂ : PartialHomeomorph M' M'' := Homeomorph.toPartialHomeomorph e'.toHomeomorph
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph