l3lab/ntp-mathlib huggingface dataset:
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        

Proof state:
case mpr.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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
⊢ ∃ e ∈ G, EqOn f (↑e.toPartialEquiv) (s ∩ e.source) ∧ x ∈ e.source

Next tactic:
refine' ⟨e.restr (interior u), _, _, _⟩
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · 

Proof state:
case mpr.intro.intro.intro.refine'_1
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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
⊢ PartialHomeomorph.restr e (interior u) ∈ G

Next tactic:
exact closedUnderRestriction' heG isOpen_interior
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · 

Proof state:
case mpr.intro.intro.intro.refine'_2
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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
⊢ EqOn f (↑(PartialHomeomorph.restr e (interior u)).toPartialEquiv)
    (s ∩ (PartialHomeomorph.restr e (interior u)).toPartialEquiv.source)

Next tactic:
have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := 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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
⊢ s ∩ u ∩ e.source = s ∩ (e.source ∩ u)

Next tactic:
mfld_set_tac
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          

Proof state:
case mpr.intro.intro.intro.refine'_2
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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
this : s ∩ u ∩ e.source = s ∩ (e.source ∩ u)
⊢ EqOn f (↑(PartialHomeomorph.restr e (interior u)).toPartialEquiv)
    (s ∩ (PartialHomeomorph.restr e (interior u)).toPartialEquiv.source)

Next tactic:
simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · 

Proof state:
case mpr.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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : IsLocalStructomorphWithinAt G f (s ∩ u) x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ u ∩ e.source)
hex : x ∈ e.source
⊢ x ∈ (PartialHomeomorph.restr e (interior u)).toPartialEquiv.source

Next tactic:
simp only [*, interior_interior, hu.interior_eq, mfld_simps]
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := 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
inst✝ : ClosedUnderRestriction G
⊢ ∀ {s : Set H} {x : H} {f : H → H} {e : PartialHomeomorph H H},
    e ∈ G →
      x ∈ e.source →
        IsLocalStructomorphWithinAt G f s x →
          IsLocalStructomorphWithinAt G (f ∘ ↑(PartialHomeomorph.symm e)) (↑(PartialHomeomorph.symm e) ⁻¹' s) (↑e x)

Next tactic:
intro s x f e' he'G he'x h hx
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h 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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
⊢ ∃ e ∈ G,
    EqOn (f ∘ ↑(PartialHomeomorph.symm e')) (↑e.toPartialEquiv) (↑(PartialHomeomorph.symm e') ⁻¹' s ∩ e.source) ∧
      ↑e' x ∈ e.source

Next tactic:
have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h hx
      have hxs : x ∈ s := 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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
⊢ x ∈ s

Next tactic:
simpa only [e'.left_inv he'x, mfld_simps] using hx
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h hx
      have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using 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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
hxs : x ∈ s
⊢ ∃ e ∈ G,
    EqOn (f ∘ ↑(PartialHomeomorph.symm e')) (↑e.toPartialEquiv) (↑(PartialHomeomorph.symm e') ⁻¹' s ∩ e.source) ∧
      ↑e' x ∈ e.source

Next tactic:
rcases h hxs with ⟨e, heG, hef, hex⟩
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h hx
      have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx
      rcases h hxs with ⟨e, heG, hef, hex⟩
      

Proof state:
case 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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
hxs : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
⊢ ∃ e ∈ G,
    EqOn (f ∘ ↑(PartialHomeomorph.symm e')) (↑e.toPartialEquiv) (↑(PartialHomeomorph.symm e') ⁻¹' s ∩ e.source) ∧
      ↑e' x ∈ e.source

Next tactic:
refine' ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, _, _⟩
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h hx
      have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx
      rcases h hxs with ⟨e, heG, hef, hex⟩
      refine' ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, _, _⟩
      · 

Proof state:
case intro.intro.intro.refine'_1
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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
hxs : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
⊢ EqOn (f ∘ ↑(PartialHomeomorph.symm e')) (↑(PartialHomeomorph.symm e' ≫ₕ e).toPartialEquiv)
    (↑(PartialHomeomorph.symm e') ⁻¹' s ∩ (PartialHomeomorph.symm e' ≫ₕ e).toPartialEquiv.source)

Next tactic:
intro y hy
/-- For a groupoid `G` which is `ClosedUnderRestriction`, being a local structomorphism is a local
invariant property. -/
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local := by
      intro s x u f hu hux
      constructor
      · rintro h hx
        rcases h hx.1 with ⟨e, heG, hef, hex⟩
        have : s ∩ u ∩ e.source ⊆ s ∩ e.source := by mfld_set_tac
        exact ⟨e, heG, hef.mono this, hex⟩
      · rintro h hx
        rcases h ⟨hx, hux⟩ with ⟨e, heG, hef, hex⟩
        refine' ⟨e.restr (interior u), _, _, _⟩
        · exact closedUnderRestriction' heG isOpen_interior
        · have : s ∩ u ∩ e.source = s ∩ (e.source ∩ u) := by mfld_set_tac
          simpa only [this, interior_interior, hu.interior_eq, mfld_simps] using hef
        · simp only [*, interior_interior, hu.interior_eq, mfld_simps]
    right_invariance' := by
      intro s x f e' he'G he'x h hx
      have hxs : x ∈ s := by simpa only [e'.left_inv he'x, mfld_simps] using hx
      rcases h hxs with ⟨e, heG, hef, hex⟩
      refine' ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, _, _⟩
      · intro y hy
        

Proof state:
case intro.intro.intro.refine'_1
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
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
he'x : x ∈ e'.source
h : IsLocalStructomorphWithinAt G f s x
hx : ↑e' x ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s
hxs : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
y : H
hy : y ∈ ↑(PartialHomeomorph.symm e') ⁻¹' s ∩ (PartialHomeomorph.symm e' ≫ₕ e).toPartialEquiv.source
⊢ (f ∘ ↑(PartialHomeomorph.symm e')) y = ↑(PartialHomeomorph.symm e' ≫ₕ e).toPartialEquiv y

Next tactic:
simp only [mfld_simps] at hy