l3lab/ntp-mathlib huggingface dataset:
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 !!!
  refine' Setoid.trans (trans_symm_self s.localHomeomorphSubtypeCoe) _
  

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
⊢ ofSet (Opens.localHomeomorphSubtypeCoe s).toPartialEquiv.target
      (_ : IsOpen (Opens.localHomeomorphSubtypeCoe s).toPartialEquiv.target) ≈
    ofSet (↑s) openness₂

Next tactic:
simp only [mfld_simps, Setoid.refl]
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).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
U : Opens α
inst✝ : Nonempty ↥U
⊢ EqOn (↑(PartialHomeomorph.symm e)) (Subtype.val ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U)))
    (subtypeRestr e U).toPartialEquiv.target

Next tactic:
intro y hy
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).target := by
  intro y hy
  

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
U : Opens α
inst✝ : Nonempty ↥U
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y = (Subtype.val ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U))) y

Next tactic:
rw [eq_comm, eq_symm_apply _ _ hy.1]
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).target := by
  intro y hy
  rw [eq_comm, eq_symm_apply _ _ hy.1]
  · 

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
U : Opens α
inst✝ : Nonempty ↥U
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
⊢ ↑e ((Subtype.val ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U))) y) = y

Next tactic:
change restrict _ e _ = _
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).target := by
  intro y hy
  rw [eq_comm, eq_symm_apply _ _ hy.1]
  · change restrict _ e _ = _
    

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
U : Opens α
inst✝ : Nonempty ↥U
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
⊢ restrict (↑U) (↑e) (↑(PartialHomeomorph.symm (subtypeRestr e U)) y) = y

Next tactic:
rw [← subtypeRestr_coe, (e.subtypeRestr U).right_inv hy]
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).target := by
  intro y hy
  rw [eq_comm, eq_symm_apply _ _ hy.1]
  · change restrict _ e _ = _
    rw [← subtypeRestr_coe, (e.subtypeRestr U).right_inv hy]
  · 

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
U : Opens α
inst✝ : Nonempty ↥U
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
⊢ (Subtype.val ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U))) y ∈ e.source

Next tactic:
have := map_target _ hy
theorem subtypeRestr_symm_eqOn (U : Opens α) [Nonempty U] :
    EqOn e.symm (Subtype.val ∘ (e.subtypeRestr U).symm) (e.subtypeRestr U).target := by
  intro y hy
  rw [eq_comm, eq_symm_apply _ _ hy.1]
  · change restrict _ e _ = _
    rw [← subtypeRestr_coe, (e.subtypeRestr U).right_inv hy]
  · have := map_target _ hy; 

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
U : Opens α
inst✝ : Nonempty ↥U
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
this : ↑(PartialHomeomorph.symm (subtypeRestr e U)) y ∈ (subtypeRestr e U).toPartialEquiv.source
⊢ (Subtype.val ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U))) y ∈ e.source

Next tactic:
rwa [subtypeRestr_source] at this
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
⊢ EqOn (↑(PartialHomeomorph.symm (subtypeRestr e V))) (inclusion hUV ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U)))
    (subtypeRestr e U).toPartialEquiv.target

Next tactic:
set i := Set.inclusion hUV
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  

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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
⊢ EqOn (↑(PartialHomeomorph.symm (subtypeRestr e V))) (i ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U)))
    (subtypeRestr e U).toPartialEquiv.target

Next tactic:
intro y hy
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  

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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ (subtypeRestr e U).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm (subtypeRestr e V)) y = (i ∘ ↑(PartialHomeomorph.symm (subtypeRestr e U))) y

Next tactic:
dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  

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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)) (↑(PartialHomeomorph.symm e) y) =
    inclusion hUV (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe U)) (↑(PartialHomeomorph.symm e) y))

Next tactic:
have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target

Next tactic:
rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    

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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' ↑U
⊢ ↑(PartialHomeomorph.symm e) y ∈ ↑V

Next tactic:
exact hUV hy.2
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)) (↑(PartialHomeomorph.symm e) y) =
    inclusion hUV (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe U)) (↑(PartialHomeomorph.symm e) y))

Next tactic:
refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · 

Proof state:
case refine'_1
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)) (↑(PartialHomeomorph.symm e) y) ∈
    (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.source

Next tactic:
rw [← PartialHomeomorph.symm_target]
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    

Proof state:
case refine'_1
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)) (↑(PartialHomeomorph.symm e) y) ∈
    (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)).toPartialEquiv.target

Next tactic:
apply PartialHomeomorph.map_source
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    apply PartialHomeomorph.map_source
    

Proof state:
case refine'_1.h
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y ∈ (PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)).toPartialEquiv.source

Next tactic:
rw [PartialHomeomorph.symm_source]
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    apply PartialHomeomorph.map_source
    rw [PartialHomeomorph.symm_source]
    

Proof state:
case refine'_1.h
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target

Next tactic:
exact hyV
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    apply PartialHomeomorph.map_source
    rw [PartialHomeomorph.symm_source]
    exact hyV
  · 

Proof state:
case refine'_2
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(Opens.localHomeomorphSubtypeCoe V)
      (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe V)) (↑(PartialHomeomorph.symm e) y)) =
    ↑(Opens.localHomeomorphSubtypeCoe V)
      (inclusion hUV (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe U)) (↑(PartialHomeomorph.symm e) y)))

Next tactic:
rw [V.localHomeomorphSubtypeCoe.right_inv hyV]
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    apply PartialHomeomorph.map_source
    rw [PartialHomeomorph.symm_source]
    exact hyV
  · rw [V.localHomeomorphSubtypeCoe.right_inv hyV]
    

Proof state:
case refine'_2
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y =
    ↑(Opens.localHomeomorphSubtypeCoe V)
      (inclusion hUV (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe U)) (↑(PartialHomeomorph.symm e) y)))

Next tactic:
show _ = U.localHomeomorphSubtypeCoe _
theorem subtypeRestr_symm_eqOn_of_le {U V : Opens α} [Nonempty U] [Nonempty V] (hUV : U ≤ V) :
    EqOn (e.subtypeRestr V).symm (Set.inclusion hUV ∘ (e.subtypeRestr U).symm)
      (e.subtypeRestr U).target := by
  set i := Set.inclusion hUV
  intro y hy
  dsimp [PartialHomeomorph.subtypeRestr_def] at hy ⊢
  have hyV : e.symm y ∈ V.localHomeomorphSubtypeCoe.target := by
    rw [Opens.localHomeomorphSubtypeCoe_target] at hy ⊢
    exact hUV hy.2
  refine' V.localHomeomorphSubtypeCoe.injOn _ trivial _
  · rw [← PartialHomeomorph.symm_target]
    apply PartialHomeomorph.map_source
    rw [PartialHomeomorph.symm_source]
    exact hyV
  · rw [V.localHomeomorphSubtypeCoe.right_inv hyV]
    show _ = U.localHomeomorphSubtypeCoe _
    

Proof state:
case refine'_2
α : 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
U V : Opens α
inst✝¹ : Nonempty ↥U
inst✝ : Nonempty ↥V
hUV : U ≤ V
i : ↑↑U → ↑↑V := inclusion hUV
y : β
hy : y ∈ e.target ∩ ↑(PartialHomeomorph.symm e) ⁻¹' (Opens.localHomeomorphSubtypeCoe U).toPartialEquiv.target
hyV : ↑(PartialHomeomorph.symm e) y ∈ (Opens.localHomeomorphSubtypeCoe V).toPartialEquiv.target
⊢ ↑(PartialHomeomorph.symm e) y =
    ↑(Opens.localHomeomorphSubtypeCoe U)
      (↑(PartialHomeomorph.symm (Opens.localHomeomorphSubtypeCoe U)) (↑(PartialHomeomorph.symm e) y))

Next tactic:
rw [U.localHomeomorphSubtypeCoe.right_inv hy.2]
/-- A sum version of **Vieta's formula** for `Multiset`: the product of the linear terms `X + λ`
where `λ` runs through a multiset `s` is equal to a linear combination of the symmetric functions
`esymm s` of the `λ`'s .-/
theorem prod_X_add_C_eq_sum_esymm (s : Multiset R) :
    (s.map fun r => X + C r).prod =
      ∑ j in Finset.range (Multiset.card s + 1), (C (s.esymm j) * X ^ (Multiset.card s - j)) := by
  

Proof state:
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ prod (map (fun r => X + C r) s) = ∑ j in Finset.range (card s + 1), C (esymm s j) * X ^ (card s - j)

Next tactic:
classical
    rw [prod_map_add, antidiagonal_eq_map_powerset, map_map, ← bind_powerset_len,
      map_bind, sum_bind, Finset.sum_eq_multiset_sum, Finset.range_val, map_congr (Eq.refl _)]
    intro _ _
    rw [esymm, ← sum_hom', ← sum_map_mul_right, map_congr (Eq.refl _)]
    intro s ht
    rw [mem_powersetCard] at ht
    dsimp
    rw [prod_hom' s (Polynomial.C : R →+* R[X])]
    simp [ht, map_const, prod_replicate, prod_hom', map_id', card_sub]
/-- A sum version of **Vieta's formula** for `Multiset`: the product of the linear terms `X + λ`
where `λ` runs through a multiset `s` is equal to a linear combination of the symmetric functions
`esymm s` of the `λ`'s .-/
theorem prod_X_add_C_eq_sum_esymm (s : Multiset R) :
    (s.map fun r => X + C r).prod =
      ∑ j in Finset.range (Multiset.card s + 1), (C (s.esymm j) * X ^ (Multiset.card s - j)) := by
  classical
    

Proof state:
R : Type u_1
inst✝ : CommSemiring R
s : Multiset R
⊢ prod (map (fun r => X + C r) s) = ∑ j in Finset.range (card s + 1), C (esymm s j) * X ^ (card s - j)

Next tactic:
rw [prod_map_add, antidiagonal_eq_map_powerset, map_map, ← bind_powerset_len,
      map_bind, sum_bind, Finset.sum_eq_multiset_sum, Finset.range_val, map_congr (Eq.refl _)]