l3lab/ntp-mathlib huggingface dataset:
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · 

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e e' : PartialHomeomorph H H
he' : e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
he : e ∈ {e | e.source = ∅}
⊢ e ≫ₕ e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e e' : PartialHomeomorph H H
he' : e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
he : e ∈ {e | e.source = ∅}
this : (e ≫ₕ e').toPartialEquiv.source ⊆ e.source
⊢ e ≫ₕ e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
rw [he] at this
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e e' : PartialHomeomorph H H
he' : e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
he : e ∈ {e | e.source = ∅}
this : (e ≫ₕ e').toPartialEquiv.source ⊆ ∅
⊢ e ≫ₕ e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e e' : PartialHomeomorph H H
he' : e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
he : e ∈ {e | e.source = ∅}
this✝ : (e ≫ₕ e').toPartialEquiv.source ⊆ ∅
this : e ≫ₕ e' ∈ {e | e.source = ∅}
⊢ e ≫ₕ e' ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
exact (mem_union _ _ _).2 (Or.inr this)
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := 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✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he : e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
⊢ PartialHomeomorph.symm e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
cases' (mem_union _ _ _).1 he with E E
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · 

Proof state:
case inl
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he : e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
E : e ∈ {PartialHomeomorph.refl H}
⊢ PartialHomeomorph.symm e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
simp [mem_singleton_iff.mp E]
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · 

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he : e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
E : e ∈ {e | e.source = ∅}
⊢ PartialHomeomorph.symm e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
right
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      

Proof state:
case inr.h
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he : e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
E : e ∈ {e | e.source = ∅}
⊢ PartialHomeomorph.symm e ∈ {e | e.source = ∅}

Next tactic:
simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := 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✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
⊢ e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
rcases e.source.eq_empty_or_nonempty with h | h
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · 

Proof state:
case inl
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
h : e.source = ∅
⊢ e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
right
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      

Proof state:
case inl.h
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
h : e.source = ∅
⊢ e ∈ {e | e.source = ∅}

Next tactic:
exact h
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · 

Proof state:
case inr
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
h : Set.Nonempty e.source
⊢ e ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}

Next tactic:
left
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      

Proof state:
case inr.h
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
h : Set.Nonempty e.source
⊢ e ∈ {PartialHomeomorph.refl H}

Next tactic:
rcases h with ⟨x, hx⟩
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      rcases h with ⟨x, hx⟩
      

Proof state:
case inr.h.intro
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x : H
hx : x ∈ e.source
⊢ e ∈ {PartialHomeomorph.refl H}

Next tactic:
rcases he x hx with ⟨s, open_s, xs, hs⟩
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      rcases h with ⟨x, hx⟩
      rcases he x hx with ⟨s, open_s, xs, hs⟩
      

Proof state:
case inr.h.intro.intro.intro.intro
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x : H
hx : x ∈ e.source
s : Set H
open_s : IsOpen s
xs : x ∈ s
hs : PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
⊢ e ∈ {PartialHomeomorph.refl H}

Next tactic:
have x's : x ∈ (e.restr s).source := by
        rw [restr_source, open_s.interior_eq]
        exact ⟨hx, xs⟩
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      rcases h with ⟨x, hx⟩
      rcases he x hx with ⟨s, open_s, xs, hs⟩
      have x's : x ∈ (e.restr s).source := 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✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x : H
hx : x ∈ e.source
s : Set H
open_s : IsOpen s
xs : x ∈ s
hs : PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
⊢ x ∈ (PartialHomeomorph.restr e s).toPartialEquiv.source

Next tactic:
rw [restr_source, open_s.interior_eq]
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      rcases h with ⟨x, hx⟩
      rcases he x hx with ⟨s, open_s, xs, hs⟩
      have x's : x ∈ (e.restr s).source := by
        rw [restr_source, open_s.interior_eq]
        

Proof state:
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x : H
hx : x ∈ e.source
s : Set H
open_s : IsOpen s
xs : x ∈ s
hs : PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
⊢ x ∈ e.source ∩ s

Next tactic:
exact ⟨hx, xs⟩
/-- The trivial groupoid, containing only the identity (and maps with empty source, as this is
necessary from the definition). -/
def idGroupoid (H : Type u) [TopologicalSpace H] : StructureGroupoid H where
  members := {PartialHomeomorph.refl H} ∪ { e : PartialHomeomorph H H | e.source = ∅ }
  trans' e e' he he' := by
    cases' he with he he
    · simpa only [mem_singleton_iff.1 he, refl_trans]
    · have : (e ≫ₕ e').source ⊆ e.source := sep_subset _ _
      rw [he] at this
      have : e ≫ₕ e' ∈ { e : PartialHomeomorph H H | e.source = ∅ } := eq_bot_iff.2 this
      exact (mem_union _ _ _).2 (Or.inr this)
  symm' e he := by
    cases' (mem_union _ _ _).1 he with E E
    · simp [mem_singleton_iff.mp E]
    · right
      simpa only [e.toPartialEquiv.image_source_eq_target.symm, mfld_simps] using E
  id_mem' := mem_union_left _ rfl
  locality' e he := by
    rcases e.source.eq_empty_or_nonempty with h | h
    · right
      exact h
    · left
      rcases h with ⟨x, hx⟩
      rcases he x hx with ⟨s, open_s, xs, hs⟩
      have x's : x ∈ (e.restr s).source := by
        rw [restr_source, open_s.interior_eq]
        exact ⟨hx, xs⟩
      

Proof state:
case inr.h.intro.intro.intro.intro
H✝ : Type u
H' : Type u_1
M : Type u_2
M' : Type u_3
M'' : Type u_4
inst✝¹ : TopologicalSpace H✝
H : Type u
inst✝ : TopologicalSpace H
e : PartialHomeomorph H H
he :
  ∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x : H
hx : x ∈ e.source
s : Set H
open_s : IsOpen s
xs : x ∈ s
hs : PartialHomeomorph.restr e s ∈ {PartialHomeomorph.refl H} ∪ {e | e.source = ∅}
x's : x ∈ (PartialHomeomorph.restr e s).toPartialEquiv.source
⊢ e ∈ {PartialHomeomorph.refl H}

Next tactic:
cases' hs with hs hs