-- Mathlib/Geometry/Manifold/LocalInvariantProperties.lean
theorem isLocalStructomorphWithinAt_localInvariantProp [ClosedUnderRestriction G] :
    LocalInvariantProp G G (IsLocalStructomorphWithinAt G) :=
  { is_local

Proof state:
case intro.intro.intro.refine_1
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∈ ↑e'.symm ⁻¹' s ∩ (e'.symm ≫ₕ e).source
⊢ (f ∘ ↑e'.symm) y = ↑(e'.symm ≫ₕ e).toPartialEquiv y

Tactic:
simp only [mfld_simps] at hy

Result:
case intro.intro.intro.refine_1
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 : ↑e'.symm y ∈ s ∧ y ∈ e'.target ∧ ↑e'.symm y ∈ e.source
⊢ (f ∘ ↑e'.symm) y = ↑(e'.symm ≫ₕ e).toPartialEquiv y

Proof state:
case intro.intro.intro
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∘ ↑e'.symm) (↑e.toPartialEquiv) (↑e'.symm ⁻¹' s ∩ e.source) ∧ ↑e' x ∈ e.source

Tactic:
refine ⟨e'.symm.trans e, G.trans (G.symm he'G) heG, ?_, ?_⟩

Result:
case intro.intro.intro.refine_1
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∘ ↑e'.symm) (↑(e'.symm ≫ₕ e).toPartialEquiv) (↑e'.symm ⁻¹' s ∩ (e'.symm ≫ₕ e).source)

case intro.intro.intro.refine_2
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' s
hxs : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
⊢ ↑e' x ∈ (e'.symm ≫ₕ e).source

Proof state:
case mpr.intro.intro.intro.refine_3
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
h : G.IsLocalStructomorphWithinAt 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 ∈ (e.restr (interior u)).source

Tactic:
simp only [*, interior_interior, hu.interior_eq, mfld_simps]

Result:
no goals

Proof state:
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
⊢ ∀ {s : Set H} {x : H} {u : Set H} {f : H → H},
    IsOpen u → x ∈ u → (G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x)

Tactic:
intro s x u f hu hux

Result:
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
u : Set H
f : H → H
hu : IsOpen u
hux : x ∈ u
⊢ G.IsLocalStructomorphWithinAt f s x ↔ G.IsLocalStructomorphWithinAt f (s ∩ u) x

Proof state:
case intro.intro.intro.refine_1
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∘ ↑e'.symm) (↑(e'.symm ≫ₕ e).toPartialEquiv) (↑e'.symm ⁻¹' s ∩ (e'.symm ≫ₕ e).source)

Tactic:
intro y hy

Result:
case intro.intro.intro.refine_1
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∈ ↑e'.symm ⁻¹' s ∩ (e'.symm ≫ₕ e).source
⊢ (f ∘ ↑e'.symm) y = ↑(e'.symm ≫ₕ e).toPartialEquiv y

Proof state:
case intro.intro.intro.refine_2
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
a✝ : s ⊆ f ⁻¹' e'.source
hfx : f x ∈ e'.source
h : G.IsLocalStructomorphWithinAt f s x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
⊢ x ∈ (e ≫ₕ e').source

Tactic:
simpa only [hex, hef ⟨hx, hex⟩, mfld_simps] using hfx

Result:
no goals

Proof state:
case intro.intro.intro
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f g : H → H
hfgs : ∀ y ∈ s, f y = g y
a✝ : f x = g x
h : G.IsLocalStructomorphWithinAt f s x
hx : 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 ∈ s ∩ e.source
⊢ g y = ↑e.toPartialEquiv y

Tactic:
rw [← hef hy, hfgs y hy.1]

Result:
no goals

Proof state:
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
a✝ : s ⊆ f ⁻¹' e'.source
hfx : f x ∈ e'.source
h : G.IsLocalStructomorphWithinAt f s x
hx : x ∈ s
⊢ ∃ e ∈ G, EqOn (↑e' ∘ f) (↑e.toPartialEquiv) (s ∩ e.source) ∧ x ∈ e.source

Tactic:
rcases h hx with ⟨e, heG, hef, hex⟩

Result:
case intro.intro.intro
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
inst✝ : ClosedUnderRestriction G
s : Set H
x : H
f : H → H
e' : PartialHomeomorph H H
he'G : e' ∈ G
a✝ : s ⊆ f ⁻¹' e'.source
hfx : f x ∈ e'.source
h : G.IsLocalStructomorphWithinAt f s x
hx : x ∈ s
e : PartialHomeomorph H H
heG : e ∈ G
hef : EqOn f (↑e.toPartialEquiv) (s ∩ e.source)
hex : x ∈ e.source
⊢ ∃ e ∈ G, EqOn (↑e' ∘ f) (↑e.toPartialEquiv) (s ∩ e.source) ∧ x ∈ e.source

Proof state:
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' s
hxs : x ∈ s
⊢ ∃ e ∈ G, EqOn (f ∘ ↑e'.symm) (↑e.toPartialEquiv) (↑e'.symm ⁻¹' s ∩ e.source) ∧ ↑e' x ∈ e.source

Tactic:
rcases h hxs with ⟨e, heG, hef, hex⟩

Result:
case intro.intro.intro
H : Type u_1
inst✝¹ : TopologicalSpace H
G : StructureGroupoid H
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 : G.IsLocalStructomorphWithinAt f s x
hx : ↑e' x ∈ ↑e'.symm ⁻¹' 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 ∘ ↑e'.symm) (↑e.toPartialEquiv) (↑e'.symm ⁻¹' s ∩ e.source) ∧ ↑e' x ∈ e.source