l3lab/ntp-mathlib huggingface dataset:
/-- 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
      let f := (e.toHomeomorph.trans 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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      

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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let y := (c.symm ≫ₕ f₁) x
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) 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
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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let g := chartAt (H := H) y
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      

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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
have hg₁ := chart_mem_atlas (H := H) y
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      

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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
have hg₂ := mem_chart_source (H := H) y
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      have hg₂ := mem_chart_source (H := H) y
      

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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
hg₂ : y ∈ (chartAt H y).toPartialEquiv.source
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
let s := (c.symm ≫ₕ f₁).source ∩ c.symm ≫ₕ f₁ ⁻¹' g.source
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      have hg₂ := mem_chart_source (H := H) y
      let s := (c.symm ≫ₕ f₁).source ∩ c.symm ≫ₕ f₁ ⁻¹' g.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
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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
hg₂ : y ∈ (chartAt H y).toPartialEquiv.source
s : Set H := (PartialHomeomorph.symm c ≫ₕ f₁).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm c ≫ₕ f₁) ⁻¹' g.source
⊢ ∃ s,
    IsOpen s ∧
      x ∈ s ∧
        PartialHomeomorph.restr
            (PartialHomeomorph.symm c ≫ₕ Homeomorph.toPartialHomeomorph (Homeomorph.mk src✝.toEquiv) ≫ₕ c') s ∈
          G

Next tactic:
have open_s : IsOpen s := by
        apply (c.symm ≫ₕ f₁).continuousOn_toFun.isOpen_inter_preimage <;> apply open_source
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      have hg₂ := mem_chart_source (H := H) y
      let s := (c.symm ≫ₕ f₁).source ∩ c.symm ≫ₕ f₁ ⁻¹' g.source
      have open_s : IsOpen s := 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'
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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
hg₂ : y ∈ (chartAt H y).toPartialEquiv.source
s : Set H := (PartialHomeomorph.symm c ≫ₕ f₁).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm c ≫ₕ f₁) ⁻¹' g.source
⊢ IsOpen s

Next tactic:
apply (c.symm ≫ₕ f₁).continuousOn_toFun.isOpen_inter_preimage
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      have hg₂ := mem_chart_source (H := H) y
      let s := (c.symm ≫ₕ f₁).source ∩ c.symm ≫ₕ f₁ ⁻¹' g.source
      have open_s : IsOpen s := by
        apply (c.symm ≫ₕ f₁).continuousOn_toFun.isOpen_inter_preimage <;> 

Proof state:
case 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
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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
hg₂ : y ∈ (chartAt H y).toPartialEquiv.source
s : Set H := (PartialHomeomorph.symm c ≫ₕ f₁).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm c ≫ₕ f₁) ⁻¹' g.source
⊢ IsOpen (PartialHomeomorph.symm c ≫ₕ f₁).toPartialEquiv.source

Next tactic:
apply open_source
/-- 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
      let f := (e.toHomeomorph.trans e'.toHomeomorph).toPartialHomeomorph
      have feq : f = f₁ ≫ₕ f₂ := Homeomorph.trans_toPartialHomeomorph _ _
      -- define the atlas g around y
      let y := (c.symm ≫ₕ f₁) x
      let g := chartAt (H := H) y
      have hg₁ := chart_mem_atlas (H := H) y
      have hg₂ := mem_chart_source (H := H) y
      let s := (c.symm ≫ₕ f₁).source ∩ c.symm ≫ₕ f₁ ⁻¹' g.source
      have open_s : IsOpen s := by
        apply (c.symm ≫ₕ f₁).continuousOn_toFun.isOpen_inter_preimage <;> 

Proof state:
case ht
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
f : PartialHomeomorph M M'' := Homeomorph.toPartialHomeomorph (Homeomorph.trans e.toHomeomorph e'.toHomeomorph)
feq : f = f₁ ≫ₕ f₂
y : M' := ↑(PartialHomeomorph.symm c ≫ₕ f₁) x
g : PartialHomeomorph M' H := chartAt H y
hg₁ : chartAt H y ∈ atlas H M'
hg₂ : y ∈ (chartAt H y).toPartialEquiv.source
s : Set H := (PartialHomeomorph.symm c ≫ₕ f₁).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm c ≫ₕ f₁) ⁻¹' g.source
⊢ IsOpen g.source

Next tactic:
apply open_source