l3lab/ntp-mathlib huggingface dataset:
/-- If a partial homeomorphism has source and target equal to univ, then it induces a homeomorphism
between the whole spaces, expressed in this definition. -/
@[simps (config := mfld_cfg) apply symm_apply] -- porting note: todo: add a `PartialEquiv` version
def toHomeomorphOfSourceEqUnivTargetEqUniv (h : e.source = (univ : Set α)) (h' : e.target = univ) :
    α ≃ₜ β where
  toFun := e
  invFun := e.symm
  left_inv x :=
    e.left_inv <| by
      rw [h]
      exact mem_univ _
  right_inv x :=
    e.right_inv <| by
      rw [h']
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
h : e.source = univ
h' : e.target = univ
x : β
⊢ x ∈ univ

Next tactic:
exact mem_univ _
/-- If a partial homeomorphism has source and target equal to univ, then it induces a homeomorphism
between the whole spaces, expressed in this definition. -/
@[simps (config := mfld_cfg) apply symm_apply] -- porting note: todo: add a `PartialEquiv` version
def toHomeomorphOfSourceEqUnivTargetEqUniv (h : e.source = (univ : Set α)) (h' : e.target = univ) :
    α ≃ₜ β where
  toFun := e
  invFun := e.symm
  left_inv x :=
    e.left_inv <| by
      rw [h]
      exact mem_univ _
  right_inv x :=
    e.right_inv <| by
      rw [h']
      exact mem_univ _
  continuous_toFun := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
h : e.source = univ
h' : e.target = univ
⊢ Continuous
    { toFun := ↑e, invFun := ↑(PartialHomeomorph.symm e),
        left_inv := (_ : ∀ (x : α), ↑(PartialHomeomorph.symm e) (↑e x) = x),
        right_inv := (_ : ∀ (x : β), ↑e (↑(PartialHomeomorph.symm e) x) = x) }.toFun

Next tactic:
simpa only [continuous_iff_continuousOn_univ, h] using e.continuousOn
/-- If a partial homeomorphism has source and target equal to univ, then it induces a homeomorphism
between the whole spaces, expressed in this definition. -/
@[simps (config := mfld_cfg) apply symm_apply] -- porting note: todo: add a `PartialEquiv` version
def toHomeomorphOfSourceEqUnivTargetEqUniv (h : e.source = (univ : Set α)) (h' : e.target = univ) :
    α ≃ₜ β where
  toFun := e
  invFun := e.symm
  left_inv x :=
    e.left_inv <| by
      rw [h]
      exact mem_univ _
  right_inv x :=
    e.right_inv <| by
      rw [h']
      exact mem_univ _
  continuous_toFun := by
    simpa only [continuous_iff_continuousOn_univ, h] using e.continuousOn
  continuous_invFun := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
h : e.source = univ
h' : e.target = univ
⊢ Continuous
    { toFun := ↑e, invFun := ↑(PartialHomeomorph.symm e),
        left_inv := (_ : ∀ (x : α), ↑(PartialHomeomorph.symm e) (↑e x) = x),
        right_inv := (_ : ∀ (x : β), ↑e (↑(PartialHomeomorph.symm e) x) = x) }.invFun

Next tactic:
simpa only [continuous_iff_continuousOn_univ, h'] using e.continuousOn_symm
theorem openEmbedding_restrict : OpenEmbedding (e.source.restrict e) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
⊢ OpenEmbedding (restrict e.source ↑e)

Next tactic:
refine openEmbedding_of_continuous_injective_open (e.continuousOn.comp_continuous
    continuous_subtype_val Subtype.prop) e.injOn.injective fun V hV ↦ ?_
theorem openEmbedding_restrict : OpenEmbedding (e.source.restrict e) := by
  refine openEmbedding_of_continuous_injective_open (e.continuousOn.comp_continuous
    continuous_subtype_val Subtype.prop) e.injOn.injective fun V hV ↦ ?_
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
V : Set ↑e.source
hV : IsOpen V
⊢ IsOpen (restrict e.source ↑e '' V)

Next tactic:
rw [Set.restrict_eq, Set.image_comp]
theorem openEmbedding_restrict : OpenEmbedding (e.source.restrict e) := by
  refine openEmbedding_of_continuous_injective_open (e.continuousOn.comp_continuous
    continuous_subtype_val Subtype.prop) e.injOn.injective fun V hV ↦ ?_
  rw [Set.restrict_eq, Set.image_comp]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : TopologicalSpace γ
inst✝ : TopologicalSpace δ
e : PartialHomeomorph α β
e' : PartialHomeomorph β γ
V : Set ↑e.source
hV : IsOpen V
⊢ IsOpen (↑e '' (Subtype.val '' V))

Next tactic:
exact e.image_isOpen_of_isOpen (e.open_source.isOpenMap_subtype_val V hV)
    fun _ ⟨x, _, h⟩ ↦ h ▸ x.2
lemma toPartialHomeomorph_left_inv {x : α} : (h.toPartialHomeomorph f).symm (f x) = x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
f : α → β
h : OpenEmbedding f
inst✝ : Nonempty α
x : α
⊢ ↑(PartialHomeomorph.symm (toPartialHomeomorph f h)) (f x) = x

Next tactic:
rw [← congr_fun (h.toPartialHomeomorph_apply f), PartialHomeomorph.left_inv]
lemma toPartialHomeomorph_left_inv {x : α} : (h.toPartialHomeomorph f).symm (f x) = x := by
  rw [← congr_fun (h.toPartialHomeomorph_apply f), PartialHomeomorph.left_inv]
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
f : α → β
h : OpenEmbedding f
inst✝ : Nonempty α
x : α
⊢ x ∈ (toPartialHomeomorph f h).toPartialEquiv.source

Next tactic:
exact Set.mem_univ _
lemma toPartialHomeomorph_right_inv {x : β} (hx : x ∈ Set.range f) :
    f ((h.toPartialHomeomorph f).symm x) = x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
f : α → β
h : OpenEmbedding f
inst✝ : Nonempty α
x : β
hx : x ∈ range f
⊢ f (↑(PartialHomeomorph.symm (toPartialHomeomorph f h)) x) = x

Next tactic:
rw [← congr_fun (h.toPartialHomeomorph_apply f), PartialHomeomorph.right_inv]
lemma toPartialHomeomorph_right_inv {x : β} (hx : x ∈ Set.range f) :
    f ((h.toPartialHomeomorph f).symm x) = x := by
  rw [← congr_fun (h.toPartialHomeomorph_apply f), PartialHomeomorph.right_inv]
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
f : α → β
h : OpenEmbedding f
inst✝ : Nonempty α
x : β
hx : x ∈ range f
⊢ x ∈ (toPartialHomeomorph f h).toPartialEquiv.target

Next tactic:
rwa [toPartialHomeomorph_target]
@[simp, mfld_simps]
theorem localHomeomorphSubtypeCoe_target : s.localHomeomorphSubtypeCoe.target = s := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
s : Opens α
inst✝ : Nonempty ↥s
⊢ (localHomeomorphSubtypeCoe s).toPartialEquiv.target = ↑s

Next tactic:
simp only [localHomeomorphSubtypeCoe, Subtype.range_coe_subtype, mfld_simps]
@[simp, mfld_simps]
theorem localHomeomorphSubtypeCoe_target : s.localHomeomorphSubtypeCoe.target = s := by
  simp only [localHomeomorphSubtypeCoe, Subtype.range_coe_subtype, mfld_simps]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
s : Opens α
inst✝ : Nonempty ↥s
⊢ {x | x ∈ s.carrier} = ↑s

Next tactic:
rfl
@[simp, mfld_simps]
theorem subtypeRestr_source : (e.subtypeRestr s).source = (↑) ⁻¹' e.source := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
⊢ (subtypeRestr e s).toPartialEquiv.source = Subtype.val ⁻¹' e.source

Next tactic:
simp only [subtypeRestr_def, mfld_simps]
theorem map_subtype_source {x : s} (hxe : (x : α) ∈ e.source): e x ∈ (e.subtypeRestr s).target := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
x : ↥s
hxe : ↑x ∈ e.source
⊢ ↑e ↑x ∈ (subtypeRestr e s).toPartialEquiv.target

Next tactic:
refine' ⟨e.map_source hxe, _⟩
theorem map_subtype_source {x : s} (hxe : (x : α) ∈ e.source): e x ∈ (e.subtypeRestr s).target := by
  refine' ⟨e.map_source hxe, _⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
x : ↥s
hxe : ↑x ∈ e.source
⊢ ↑e ↑x ∈ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe s).toPartialEquiv.target

Next tactic:
rw [s.localHomeomorphSubtypeCoe_target, mem_preimage, e.leftInvOn hxe]
theorem map_subtype_source {x : s} (hxe : (x : α) ∈ e.source): e x ∈ (e.subtypeRestr s).target := by
  refine' ⟨e.map_source hxe, _⟩
  rw [s.localHomeomorphSubtypeCoe_target, mem_preimage, e.leftInvOn hxe]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
x : ↥s
hxe : ↑x ∈ e.source
⊢ ↑x ∈ ↑s

Next tactic:
exact x.prop
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
⊢ PartialHomeomorph.trans (PartialHomeomorph.symm (subtypeRestr f s)) (subtypeRestr f' s) ≈
    PartialHomeomorph.restr (PartialHomeomorph.trans (PartialHomeomorph.symm f) f')
      (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)

Next tactic:
simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans (PartialHomeomorph.symm f) (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
      (PartialHomeomorph.trans (Opens.localHomeomorphSubtypeCoe s) f') ≈
    PartialHomeomorph.restr (PartialHomeomorph.trans (PartialHomeomorph.symm f) f')
      (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)

Next tactic:
have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans (PartialHomeomorph.symm f) (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
      (PartialHomeomorph.trans (Opens.localHomeomorphSubtypeCoe s) f') ≈
    PartialHomeomorph.restr (PartialHomeomorph.trans (PartialHomeomorph.symm f) f')
      (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)

Next tactic:
rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans
        (PartialHomeomorph.trans (PartialHomeomorph.symm f)
          (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
        (Opens.localHomeomorphSubtypeCoe s))
      f' ≈
    PartialHomeomorph.trans
      (PartialHomeomorph.trans (ofSet (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) openness₁)
        (PartialHomeomorph.symm f))
      f'

Next tactic:
refine' EqOnSource.trans' _ (eqOnSource_refl _)
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans (PartialHomeomorph.symm f) (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
      (Opens.localHomeomorphSubtypeCoe s) ≈
    PartialHomeomorph.trans (ofSet (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) openness₁) (PartialHomeomorph.symm f)

Next tactic:
have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by mfld_set_tac
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
⊢ (PartialHomeomorph.symm f).toPartialEquiv.source ∩ (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) =
    (PartialHomeomorph.symm f).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s

Next tactic:
mfld_set_tac
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by mfld_set_tac
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
sets_identity :
  (PartialHomeomorph.symm f).toPartialEquiv.source ∩ (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) =
    (PartialHomeomorph.symm f).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans (PartialHomeomorph.symm f) (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
      (Opens.localHomeomorphSubtypeCoe s) ≈
    PartialHomeomorph.trans (ofSet (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) openness₁) (PartialHomeomorph.symm f)

Next tactic:
have openness₂ : IsOpen (s : Set α) := s.2
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by mfld_set_tac
  have openness₂ : IsOpen (s : Set α) := s.2
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
sets_identity :
  (PartialHomeomorph.symm f).toPartialEquiv.source ∩ (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) =
    (PartialHomeomorph.symm f).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s
openness₂ : IsOpen ↑s
⊢ PartialHomeomorph.trans
      (PartialHomeomorph.trans (PartialHomeomorph.symm f) (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s)))
      (Opens.localHomeomorphSubtypeCoe s) ≈
    PartialHomeomorph.trans (ofSet (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) openness₁) (PartialHomeomorph.symm f)

Next tactic:
rw [ofSet_trans', sets_identity, ← trans_of_set' _ openness₂, trans_assoc]
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by mfld_set_tac
  have openness₂ : IsOpen (s : Set α) := s.2
  rw [ofSet_trans', sets_identity, ← trans_of_set' _ openness₂, trans_assoc]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
sets_identity :
  (PartialHomeomorph.symm f).toPartialEquiv.source ∩ (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) =
    (PartialHomeomorph.symm f).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s
openness₂ : IsOpen ↑s
⊢ PartialHomeomorph.trans (PartialHomeomorph.symm f)
      (PartialHomeomorph.trans (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s))
        (Opens.localHomeomorphSubtypeCoe s)) ≈
    PartialHomeomorph.trans (PartialHomeomorph.symm f) (ofSet (↑s) openness₂)

Next tactic:
refine' EqOnSource.trans' (eqOnSource_refl _) _
theorem subtypeRestr_symm_trans_subtypeRestr (f f' : PartialHomeomorph α β) :
    (f.subtypeRestr s).symm.trans (f'.subtypeRestr s) ≈
      (f.symm.trans f').restr (f.target ∩ f.symm ⁻¹' s) := by
  simp only [subtypeRestr_def, trans_symm_eq_symm_trans_symm]
  have openness₁ : IsOpen (f.target ∩ f.symm ⁻¹' s) := f.isOpen_inter_preimage_symm s.2
  rw [← ofSet_trans _ openness₁, ← trans_assoc, ← trans_assoc]
  refine' EqOnSource.trans' _ (eqOnSource_refl _)
  -- f' has been eliminated !!!
  have sets_identity : f.symm.source ∩ (f.target ∩ f.symm ⁻¹' s) = f.symm.source ∩ f.symm ⁻¹' s :=
    by mfld_set_tac
  have openness₂ : IsOpen (s : Set α) := s.2
  rw [ofSet_trans', sets_identity, ← trans_of_set' _ openness₂, trans_assoc]
  refine' EqOnSource.trans' (eqOnSource_refl _) _
  -- f has been eliminated !!!
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : TopologicalSpace α
inst✝³ : TopologicalSpace β
inst✝² : TopologicalSpace γ
inst✝¹ : TopologicalSpace δ
e : PartialHomeomorph α β
s : Opens α
inst✝ : Nonempty ↥s
f f' : PartialHomeomorph α β
openness₁ : IsOpen (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s)
sets_identity :
  (PartialHomeomorph.symm f).toPartialEquiv.source ∩ (f.target ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s) =
    (PartialHomeomorph.symm f).toPartialEquiv.source ∩ ↑(PartialHomeomorph.symm f) ⁻¹' ↑s
openness₂ : IsOpen ↑s
⊢ PartialHomeomorph.trans (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe s))
      (Opens.localHomeomorphSubtypeCoe s) ≈
    ofSet (↑s) openness₂

Next tactic:
refine' Setoid.trans (trans_symm_self s.localHomeomorphSubtypeCoe) _