l3lab/ntp-mathlib huggingface dataset:
theorem monotoneOn_of_rightInvOn_of_mapsTo {α β : Sort _} [PartialOrder α] [LinearOrder β]
    {φ : β → α} {ψ : α → β} {t : Set β} {s : Set α} (hφ : MonotoneOn φ t)
    (φψs : Set.RightInvOn ψ φ s) (ψts : Set.MapsTo ψ s t) : MonotoneOn ψ s := by
  rintro x xs y ys l
  rcases le_total (ψ x) (ψ y) with (ψxy|ψyx)
  · exact ψxy
  · have := hφ (ψts ys) (ψts xs) ψyx
    rw [φψs.eq ys, φψs.eq xs] at this
    induction le_antisymm l this
    

Proof state:
case inr.refl
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
ι : Sort u_4
π : α✝ → Type u_5
fa : α✝ → α✝
fb : β✝ → β✝
f : α✝ → β✝
g : β✝ → γ
s✝ t✝ : Set α✝
α : Type u_6
β : Type u_7
inst✝¹ : PartialOrder α
inst✝ : LinearOrder β
φ : β → α
ψ : α → β
t : Set β
s : Set α
hφ : MonotoneOn φ t
φψs : RightInvOn ψ φ s
ψts : MapsTo ψ s t
x : α
xs : x ∈ s
y : α
ys : x ∈ s
l : x ≤ x
ψyx : ψ x ≤ ψ x
this : x ≤ x
⊢ ψ x ≤ ψ x

Next tactic:
exact le_refl _
protected lemma MapsTo.extendDomain (h : MapsTo g s t) :
    MapsTo (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : MapsTo (⇑g) s t
⊢ MapsTo (⇑(extendDomain g f)) (Subtype.val ∘ ⇑f '' s) (Subtype.val ∘ ⇑f '' t)

Next tactic:
rintro _ ⟨a, ha, rfl⟩
protected lemma MapsTo.extendDomain (h : MapsTo g s t) :
    MapsTo (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩; 

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : MapsTo (⇑g) s t
a : α
ha : a ∈ s
⊢ (extendDomain g f) ((Subtype.val ∘ ⇑f) a) ∈ Subtype.val ∘ ⇑f '' t

Next tactic:
exact ⟨_, h ha, by simp_rw [Function.comp_apply, extendDomain_apply_image]⟩
protected lemma MapsTo.extendDomain (h : MapsTo g s t) :
    MapsTo (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩; exact ⟨_, h ha, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : MapsTo (⇑g) s t
a : α
ha : a ∈ s
⊢ (Subtype.val ∘ ⇑f) (g a) = (extendDomain g f) ((Subtype.val ∘ ⇑f) a)

Next tactic:
simp_rw [Function.comp_apply, extendDomain_apply_image]
protected lemma SurjOn.extendDomain (h : SurjOn g s t) :
    SurjOn (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : SurjOn (⇑g) s t
⊢ SurjOn (⇑(extendDomain g f)) (Subtype.val ∘ ⇑f '' s) (Subtype.val ∘ ⇑f '' t)

Next tactic:
rintro _ ⟨a, ha, rfl⟩
protected lemma SurjOn.extendDomain (h : SurjOn g s t) :
    SurjOn (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : SurjOn (⇑g) s t
a : α
ha : a ∈ t
⊢ (Subtype.val ∘ ⇑f) a ∈ ⇑(extendDomain g f) '' (Subtype.val ∘ ⇑f '' s)

Next tactic:
obtain ⟨b, hb, rfl⟩ := h ha
protected lemma SurjOn.extendDomain (h : SurjOn g s t) :
    SurjOn (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩
  obtain ⟨b, hb, rfl⟩ := h ha
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : SurjOn (⇑g) s t
b : α
hb : b ∈ s
ha : g b ∈ t
⊢ (Subtype.val ∘ ⇑f) (g b) ∈ ⇑(extendDomain g f) '' (Subtype.val ∘ ⇑f '' s)

Next tactic:
exact ⟨_, ⟨_, hb, rfl⟩, by simp_rw [Function.comp_apply, extendDomain_apply_image]⟩
protected lemma SurjOn.extendDomain (h : SurjOn g s t) :
    SurjOn (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩
  obtain ⟨b, hb, rfl⟩ := h ha
  exact ⟨_, ⟨_, hb, rfl⟩, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : SurjOn (⇑g) s t
b : α
hb : b ∈ s
ha : g b ∈ t
⊢ (extendDomain g f) ((Subtype.val ∘ ⇑f) b) = (Subtype.val ∘ ⇑f) (g b)

Next tactic:
simp_rw [Function.comp_apply, extendDomain_apply_image]
protected lemma LeftInvOn.extendDomain (h : LeftInvOn g₁ g₂ s) :
    LeftInvOn (g₁.extendDomain f) (g₂.extendDomain f) ((↑) ∘ f '' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : LeftInvOn (⇑g₁) (⇑g₂) s
⊢ LeftInvOn (⇑(extendDomain g₁ f)) (⇑(extendDomain g₂ f)) (Subtype.val ∘ ⇑f '' s)

Next tactic:
rintro _ ⟨a, ha, rfl⟩
protected lemma LeftInvOn.extendDomain (h : LeftInvOn g₁ g₂ s) :
    LeftInvOn (g₁.extendDomain f) (g₂.extendDomain f) ((↑) ∘ f '' s) := by
  rintro _ ⟨a, ha, rfl⟩; 

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : LeftInvOn (⇑g₁) (⇑g₂) s
a : α
ha : a ∈ s
⊢ (extendDomain g₁ f) ((extendDomain g₂ f) ((Subtype.val ∘ ⇑f) a)) = (Subtype.val ∘ ⇑f) a

Next tactic:
simp_rw [Function.comp_apply, extendDomain_apply_image, h ha]
protected lemma RightInvOn.extendDomain (h : RightInvOn g₁ g₂ t) :
    RightInvOn (g₁.extendDomain f) (g₂.extendDomain f) ((↑) ∘ f '' t) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : RightInvOn (⇑g₁) (⇑g₂) t
⊢ RightInvOn (⇑(extendDomain g₁ f)) (⇑(extendDomain g₂ f)) (Subtype.val ∘ ⇑f '' t)

Next tactic:
rintro _ ⟨a, ha, rfl⟩
protected lemma RightInvOn.extendDomain (h : RightInvOn g₁ g₂ t) :
    RightInvOn (g₁.extendDomain f) (g₂.extendDomain f) ((↑) ∘ f '' t) := by
  rintro _ ⟨a, ha, rfl⟩; 

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g g₁ g₂ : Perm α
s t : Set α
h : RightInvOn (⇑g₁) (⇑g₂) t
a : α
ha : a ∈ t
⊢ (extendDomain g₂ f) ((extendDomain g₁ f) ((Subtype.val ∘ ⇑f) a)) = (Subtype.val ∘ ⇑f) a

Next tactic:
simp_rw [Function.comp_apply, extendDomain_apply_image, h ha]
protected lemma bijOn (h : ∀ a, e a ∈ t ↔ a ∈ s) : BijOn e s t :=
  e.bijOn' (fun a ↦ (h _).2) $ fun b hb ↦ (h _).1 $ by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
h : ∀ (a : α), e a ∈ t ↔ a ∈ s
b : β
hb : b ∈ t
⊢ e (e.symm b) ∈ t

Next tactic:
rwa [apply_symm_apply]
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
a b : α
ha : a ∈ s
hb : b ∈ s
x : α
⊢ (swap a b) x ∈ s ↔ x ∈ s

Next tactic:
obtain rfl | hxa := eq_or_ne x a
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
b : α
hb : b ∈ s
x : α
ha : x ∈ s
⊢ (swap x b) x ∈ s ↔ x ∈ s

Next tactic:
obtain rfl | hxb := eq_or_ne x b
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
a b : α
ha : a ∈ s
hb : b ∈ s
x : α
hxa : x ≠ a
⊢ (swap a b) x ∈ s ↔ x ∈ s

Next tactic:
obtain rfl | hxb := eq_or_ne x b
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    obtain rfl | hxb := eq_or_ne x b <;>
    

Proof state:
case inl.inl
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
x : α
ha hb : x ∈ s
⊢ (swap x x) x ∈ s ↔ x ∈ s

Next tactic:
simp [*, swap_apply_of_ne_of_ne]
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    obtain rfl | hxb := eq_or_ne x b <;>
    

Proof state:
case inl.inr
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
b : α
hb : b ∈ s
x : α
ha : x ∈ s
hxb : x ≠ b
⊢ (swap x b) x ∈ s ↔ x ∈ s

Next tactic:
simp [*, swap_apply_of_ne_of_ne]
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    obtain rfl | hxb := eq_or_ne x b <;>
    

Proof state:
case inr.inl
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
a : α
ha : a ∈ s
x : α
hxa : x ≠ a
hb : x ∈ s
⊢ (swap a x) x ∈ s ↔ x ∈ s

Next tactic:
simp [*, swap_apply_of_ne_of_ne]
lemma bijOn_swap (ha : a ∈ s) (hb : b ∈ s) : BijOn (swap a b) s s :=
  (swap a b).bijOn $ fun x ↦ by
    obtain rfl | hxa := eq_or_ne x a <;>
    obtain rfl | hxb := eq_or_ne x b <;>
    

Proof state:
case inr.inr
α : Type u_1
β : Type u_2
γ : Type u_3
ι : Sort u_4
π : α → Type u_5
e : α ≃ β
s : Set α
t : Set β
inst✝ : DecidableEq α
a b : α
ha : a ∈ s
hb : b ∈ s
x : α
hxa : x ≠ a
hxb : x ≠ b
⊢ (swap a b) x ∈ s ↔ x ∈ s

Next tactic:
simp [*, swap_apply_of_ne_of_ne]
/-- Constructs a partial function isomorphism between types from an equivalence between them. -/
@[simps]
def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where
  hom x := e x
  inv x := e.symm x
  hom_inv_id := (PFun.coe_comp _ _).symm.trans (by
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
α β : PartialFun
e : α ≃ β
⊢ ↑((fun x => e.symm x) ∘ fun x => e x) = 𝟙 α

Next tactic:
simp only [Equiv.symm_comp_self, PFun.coe_id]
/-- Constructs a partial function isomorphism between types from an equivalence between them. -/
@[simps]
def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where
  hom x := e x
  inv x := e.symm x
  hom_inv_id := (PFun.coe_comp _ _).symm.trans (by
    simp only [Equiv.symm_comp_self, PFun.coe_id]
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
α β : PartialFun
e : α ≃ β
⊢ PFun.id α = 𝟙 α

Next tactic:
rfl
/-- Constructs a partial function isomorphism between types from an equivalence between them. -/
@[simps]
def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where
  hom x := e x
  inv x := e.symm x
  hom_inv_id := (PFun.coe_comp _ _).symm.trans (by
    simp only [Equiv.symm_comp_self, PFun.coe_id]
    rfl)
  inv_hom_id := (PFun.coe_comp _ _).symm.trans (by
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
α β : PartialFun
e : α ≃ β
⊢ ↑((fun x => e x) ∘ fun x => e.symm x) = 𝟙 β

Next tactic:
simp only [Equiv.self_comp_symm, PFun.coe_id]
/-- Constructs a partial function isomorphism between types from an equivalence between them. -/
@[simps]
def Iso.mk {α β : PartialFun.{u}} (e : α ≃ β) : α ≅ β where
  hom x := e x
  inv x := e.symm x
  hom_inv_id := (PFun.coe_comp _ _).symm.trans (by
    simp only [Equiv.symm_comp_self, PFun.coe_id]
    rfl)
  inv_hom_id := (PFun.coe_comp _ _).symm.trans (by
    simp only [Equiv.self_comp_symm, PFun.coe_id]
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
α β : PartialFun
e : α ≃ β
⊢ PFun.id β = 𝟙 β

Next tactic:
rfl
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun X => { x // x ≠ X.point },
          map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
      (f ≫ g) =
    { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        f ≫
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        g

Next tactic:
apply PFun.ext _
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ ∀
    (a :
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.obj
        X✝)
    (b :
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.obj
        Z✝),
    b ∈
        { obj := fun X => { x // x ≠ X.point },
              map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
          (f ≫ g) a ↔
      b ∈
        ({ obj := fun X => { x // x ≠ X.point },
                  map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
              f ≫
            { obj := fun X => { x // x ≠ X.point },
                  map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
              g)
          a

Next tactic:
rintro ⟨a, ha⟩ ⟨c, hc⟩
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    rintro ⟨a, ha⟩ ⟨c, hc⟩
    

Proof state:
case mk.mk
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
a : X✝.X
ha : a ≠ X✝.point
c : Z✝.X
hc : c ≠ Z✝.point
⊢ { val := c, property := hc } ∈
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        (f ≫ g) { val := a, property := ha } ↔
    { val := c, property := hc } ∈
      ({ obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            f ≫
          { obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            g)
        { val := a, property := ha }

Next tactic:
constructor
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    rintro ⟨a, ha⟩ ⟨c, hc⟩
    constructor
    · 

Proof state:
case mk.mk.mp
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
a : X✝.X
ha : a ≠ X✝.point
c : Z✝.X
hc : c ≠ Z✝.point
⊢ { val := c, property := hc } ∈
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        (f ≫ g) { val := a, property := ha } →
    { val := c, property := hc } ∈
      ({ obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            f ≫
          { obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            g)
        { val := a, property := ha }

Next tactic:
rintro ⟨h₁, h₂⟩
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    rintro ⟨a, ha⟩ ⟨c, hc⟩
    constructor
    · rintro ⟨h₁, h₂⟩
      

Proof state:
case mk.mk.mp.intro
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
a : X✝.X
ha : a ≠ X✝.point
c : Z✝.X
hc : c ≠ Z✝.point
h₁ :
  ({ obj := fun X => { x // x ≠ X.point },
          map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
      (f ≫ g) { val := a, property := ha }).Dom
h₂ :
  Part.get
      ({ obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        (f ≫ g) { val := a, property := ha })
      h₁ =
    { val := c, property := hc }
⊢ { val := c, property := hc } ∈
    ({ obj := fun X => { x // x ≠ X.point },
              map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
          f ≫
        { obj := fun X => { x // x ≠ X.point },
              map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
          g)
      { val := a, property := ha }

Next tactic:
exact ⟨⟨fun h₀ => h₁ ((congr_arg g.toFun h₀).trans g.map_point), h₁⟩, h₂⟩
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    rintro ⟨a, ha⟩ ⟨c, hc⟩
    constructor
    · rintro ⟨h₁, h₂⟩
      exact ⟨⟨fun h₀ => h₁ ((congr_arg g.toFun h₀).trans g.map_point), h₁⟩, h₂⟩
    · 

Proof state:
case mk.mk.mpr
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
a : X✝.X
ha : a ≠ X✝.point
c : Z✝.X
hc : c ≠ Z✝.point
⊢ { val := c, property := hc } ∈
      ({ obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            f ≫
          { obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            g)
        { val := a, property := ha } →
    { val := c, property := hc } ∈
      { obj := fun X => { x // x ≠ X.point },
            map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
        (f ≫ g) { val := a, property := ha }

Next tactic:
rintro ⟨_, _, _⟩
/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun where
  obj X := { x : X // x ≠ X.point }
  map f := PFun.toSubtype _ f.toFun ∘ Subtype.val
  map_id X :=
    PFun.ext fun a b => PFun.mem_toSubtype_iff.trans (Subtype.coe_inj.trans Part.mem_some_iff.symm)
  map_comp f g := by
    -- porting note: the proof was changed because the original mathlib3 proof no longer works
    apply PFun.ext _
    rintro ⟨a, ha⟩ ⟨c, hc⟩
    constructor
    · rintro ⟨h₁, h₂⟩
      exact ⟨⟨fun h₀ => h₁ ((congr_arg g.toFun h₀).trans g.map_point), h₁⟩, h₂⟩
    · rintro ⟨_, _, _⟩
      

Proof state:
case mk.mk.mpr.intro.refl
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : Pointed
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
a : X✝.X
ha : a ≠ X✝.point
w✝ :
  (({ obj := fun X => { x // x ≠ X.point },
              map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
          f ≫
        { obj := fun X => { x // x ≠ X.point },
              map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
          g)
      { val := a, property := ha }).Dom
hc :
  Pointed.Hom.toFun g
      ↑(Part.get
          ({ obj := fun X => { x // x ≠ X.point },
                map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
            f { val := a, property := ha })
          (_ :
            ({ obj := fun X => { x // x ≠ X.point },
                    map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
                f { val := a, property := ha }).Dom)) ≠
    Z✝.point
⊢ {
      val :=
        Pointed.Hom.toFun g
          ↑(Part.get
              ({ obj := fun X => { x // x ≠ X.point },
                    map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
                f { val := a, property := ha })
              (_ :
                ({ obj := fun X => { x // x ≠ X.point },
                        map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
                    f { val := a, property := ha }).Dom)),
      property := hc } ∈
    { obj := fun X => { x // x ≠ X.point },
          map := fun {X Y} f => PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val }.map
      (f ≫ g) { val := a, property := ha }

Next tactic:
exact ⟨_, rfl⟩
/-- The functor which maps undefined values to a new point. This makes the maps total and creates
pointed types. This is the noncomputable part of the equivalence `PartialFunEquivPointed`. It can't
be computable because `= Option.none` is decidable while the domain of a general `part` isn't. -/
@[simps map]
noncomputable def partialFunToPointed : PartialFun ⥤ Pointed := by
  

Proof state:
α : Type u_1
β : Type u_2
⊢ PartialFun ⥤ Pointed

Next tactic:
classical
  exact
    { obj := fun X => ⟨Option X, none⟩
      map := fun f => ⟨Option.elim' none fun a => (f a).toOption, rfl⟩
      map_id := fun X => Pointed.Hom.ext _ _ <| funext fun o => Option.recOn o rfl fun a => (by
        dsimp [CategoryStruct.id]
        convert Part.some_toOption a)
      map_comp := fun f g => Pointed.Hom.ext _ _ <| funext fun o => Option.recOn o rfl fun a => by
        dsimp [CategoryStruct.comp]
        rw [Part.bind_toOption g (f a), Option.elim'_eq_elim] }