Theorem: StructureGroupoid.compatible_of_mem_maximalAtlas
File: Mathlib/Geometry/Manifold/ChartedSpace.lean

tactic: refine' G.locality fun x hx ↦ _
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
⊢ LocalHomeomorph.symm e ≫ₕ e' ∈ G

tactic: set f := chartAt (H := H) (e.symm x)
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: let s := e.target ∩ e.symm ⁻¹' f.source
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have hs : IsOpen s := by
  apply e.symm.continuous_toFun.preimage_open_of_open <;> apply open_source
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have xs : x ∈ s := by
  simp only [mem_inter_iff, mem_preimage, mem_chart_source, and_true]
  exact ((mem_inter_iff _ _ _).1 hx).1
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: refine' ⟨s, hs, xs, _⟩
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
⊢ ∃ s, IsOpen s ∧ x ∈ s ∧ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have A : e.symm ≫ₕ f ∈ G := (mem_maximalAtlas_iff.1 he f (chart_mem_atlas _ _)).1
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have B : f.symm ≫ₕ e' ∈ G := (mem_maximalAtlas_iff.1 he' f (chart_mem_atlas _ _)).2
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have C : (e.symm ≫ₕ f) ≫ₕ f.symm ≫ₕ e' ∈ G := G.trans A B
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: have D : (e.symm ≫ₕ f) ≫ₕ f.symm ≫ₕ e' ≈ (e.symm ≫ₕ e').restr s := calc
  (e.symm ≫ₕ f) ≫ₕ f.symm ≫ₕ e' = e.symm ≫ₕ (f ≫ₕ f.symm) ≫ₕ e' := by simp only [trans_assoc]
  _ ≈ e.symm ≫ₕ ofSet f.source f.open_source ≫ₕ e' :=
    EqOnSource.trans' (refl _) (EqOnSource.trans' (trans_self_symm _) (refl _))
  _ ≈ (e.symm ≫ₕ ofSet f.source f.open_source) ≫ₕ e' := by rw [trans_assoc]
  _ ≈ e.symm.restr s ≫ₕ e' := by rw [trans_of_set']; apply refl
  _ ≈ (e.symm ≫ₕ e').restr s := by rw [restr_trans]
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: exact G.eq_on_source C (Setoid.symm D)
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
D :
  (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ≈ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s ∈ G

tactic: apply e.symm.continuous_toFun.preimage_open_of_open <;> apply open_source
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
⊢ IsOpen s

tactic: simp only [mem_inter_iff, mem_preimage, mem_chart_source, and_true]
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
⊢ x ∈ s

tactic: exact ((mem_inter_iff _ _ _).1 hx).1
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
⊢ x ∈ e.target

tactic: simp only [trans_assoc]
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' =
    LocalHomeomorph.symm e ≫ₕ (f ≫ₕ LocalHomeomorph.symm f) ≫ₕ e'

tactic: rw [trans_assoc]
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ LocalHomeomorph.symm e ≫ₕ ofSet f.source (_ : IsOpen f.source) ≫ₕ e' ≈
    (LocalHomeomorph.symm e ≫ₕ ofSet f.source (_ : IsOpen f.source)) ≫ₕ e'

tactic: rw [trans_of_set']
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ (LocalHomeomorph.symm e ≫ₕ ofSet f.source (_ : IsOpen f.source)) ≫ₕ e' ≈
    LocalHomeomorph.restr (LocalHomeomorph.symm e) s ≫ₕ e'

tactic: apply refl
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e)
        ((LocalHomeomorph.symm e).toLocalEquiv.source ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source) ≫ₕ
      e' ≈
    LocalHomeomorph.restr (LocalHomeomorph.symm e) s ≫ₕ e'

tactic: rw [restr_trans]
state_before: H : Type u
H' : Type ?u.67678
M : Type u_1
M' : Type ?u.67684
M'' : Type ?u.67687
inst✝² : TopologicalSpace H
inst✝¹ : TopologicalSpace M
inst✝ : ChartedSpace H M
G : StructureGroupoid H
e e' : LocalHomeomorph M H
he : e ∈ maximalAtlas M G
he' : e' ∈ maximalAtlas M G
x : H
hx : x ∈ (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source
f : LocalHomeomorph M H := chartAt H (↑(LocalHomeomorph.symm e) x)
s : Set H := e.target ∩ ↑(LocalHomeomorph.symm e) ⁻¹' f.source
hs : IsOpen s
xs : x ∈ s
A : LocalHomeomorph.symm e ≫ₕ f ∈ G
B : LocalHomeomorph.symm f ≫ₕ e' ∈ G
C : (LocalHomeomorph.symm e ≫ₕ f) ≫ₕ LocalHomeomorph.symm f ≫ₕ e' ∈ G
⊢ LocalHomeomorph.restr (LocalHomeomorph.symm e) s ≫ₕ e' ≈ LocalHomeomorph.restr (LocalHomeomorph.symm e ≫ₕ e') s