l3lab/ntp-mathlib huggingface dataset:
/-- 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
  classical
  

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

Next tactic:
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] }
/-- 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
  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
        

Proof state:
α : Type u_1
β : Type u_2
X : PartialFun
o :
  ({ obj := fun X => { X := Option X, point := none },
          map := fun {X Y} f =>
            { toFun := Option.elim' none fun a => Part.toOption (f a),
              map_point :=
                (_ :
                  Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point =
                    Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point) } }.obj
      X).X
a : X
⊢ Pointed.Hom.toFun
      ({ obj := fun X => { X := Option X, point := none },
            map := fun {X Y} f =>
              { toFun := Option.elim' none fun a => Part.toOption (f a),
                map_point :=
                  (_ :
                    Option.elim' none (fun a => Part.toOption (f a))
                        ((fun X => { X := Option X, point := none }) X).point =
                      Option.elim' none (fun a => Part.toOption (f a))
                        ((fun X => { X := Option X, point := none }) X).point) } }.map
        (𝟙 X))
      (some a) =
    Pointed.Hom.toFun
      (𝟙
        ({ obj := fun X => { X := Option X, point := none },
              map := fun {X Y} f =>
                { toFun := Option.elim' none fun a => Part.toOption (f a),
                  map_point :=
                    (_ :
                      Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point =
                        Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point) } }.obj
          X))
      (some a)

Next tactic:
dsimp [CategoryStruct.id]
/-- 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
  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]
        

Proof state:
α : Type u_1
β : Type u_2
X : PartialFun
o :
  ({ obj := fun X => { X := Option X, point := none },
          map := fun {X Y} f =>
            { toFun := Option.elim' none fun a => Part.toOption (f a),
              map_point :=
                (_ :
                  Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point =
                    Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point) } }.obj
      X).X
a : X
⊢ Part.toOption (Part.some a) = some a

Next tactic:
convert Part.some_toOption a
/-- 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
  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
        

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : PartialFun
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
o :
  ({ obj := fun X => { X := Option X, point := none },
          map := fun {X Y} f =>
            { toFun := Option.elim' none fun a => Part.toOption (f a),
              map_point :=
                (_ :
                  Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point =
                    Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point) } }.obj
      X✝).X
a : X✝
⊢ Pointed.Hom.toFun
      ({ obj := fun X => { X := Option X, point := none },
            map := fun {X Y} f =>
              { toFun := Option.elim' none fun a => Part.toOption (f a),
                map_point :=
                  (_ :
                    Option.elim' none (fun a => Part.toOption (f a))
                        ((fun X => { X := Option X, point := none }) X).point =
                      Option.elim' none (fun a => Part.toOption (f a))
                        ((fun X => { X := Option X, point := none }) X).point) } }.map
        (f ≫ g))
      (some a) =
    Pointed.Hom.toFun
      ({ obj := fun X => { X := Option X, point := none },
              map := fun {X Y} f =>
                { toFun := Option.elim' none fun a => Part.toOption (f a),
                  map_point :=
                    (_ :
                      Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point =
                        Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point) } }.map
          f ≫
        { obj := fun X => { X := Option X, point := none },
              map := fun {X Y} f =>
                { toFun := Option.elim' none fun a => Part.toOption (f a),
                  map_point :=
                    (_ :
                      Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point =
                        Option.elim' none (fun a => Part.toOption (f a))
                          ((fun X => { X := Option X, point := none }) X).point) } }.map
          g)
      (some a)

Next tactic:
dsimp [CategoryStruct.comp]
/-- 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
  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]
        

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ Z✝ : PartialFun
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
o :
  ({ obj := fun X => { X := Option X, point := none },
          map := fun {X Y} f =>
            { toFun := Option.elim' none fun a => Part.toOption (f a),
              map_point :=
                (_ :
                  Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point =
                    Option.elim' none (fun a => Part.toOption (f a))
                      ((fun X => { X := Option X, point := none }) X).point) } }.obj
      X✝).X
a : X✝
⊢ Part.toOption (Part.bind (f a) g) = Option.elim' none (fun a => Part.toOption (g a)) (Part.toOption (f a))

Next tactic:
rw [Part.bind_toOption g (f a), Option.elim'_eq_elim]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by 

Proof state:
α : Type u_1
β : Type u_2
X : PartialFun
a : (partialFunToPointed ⋙ pointedToPartialFun).obj X
⊢ (fun a => { val := some a, property := (_ : some a ≠ none) }) ((fun a => Option.get ↑a (_ : isSome ↑a = true)) a) = a

Next tactic:
simp only [some_get, Subtype.coe_eta]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ b ∈
      ((𝟭 PartialFun).map f ≫
          ((fun X =>
                PartialFun.Iso.mk
                  { toFun := fun a => { val := some a, property := (_ : some a ≠ none) },
                    invFun := fun a => Option.get ↑a (_ : isSome ↑a = true),
                    left_inv :=
                      (_ :
                        ∀ (a : (𝟭 PartialFun).obj X),
                          Option.get (some a)
                              (_ : isSome ↑((fun a => { val := some a, property := (_ : some a ≠ none) }) a) = true) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (a : (partialFunToPointed ⋙ pointedToPartialFun).obj X),
                          { val := some ((fun a => Option.get ↑a (_ : isSome ↑a = true)) a),
                              property := (_ : some ((fun a => Option.get ↑a (_ : isSome ↑a = true)) a) ≠ none) } =
                            a) })
              Y✝).hom)
        a ↔
    b ∈
      (((fun X =>
                PartialFun.Iso.mk
                  { toFun := fun a => { val := some a, property := (_ : some a ≠ none) },
                    invFun := fun a => Option.get ↑a (_ : isSome ↑a = true),
                    left_inv :=
                      (_ :
                        ∀ (a : (𝟭 PartialFun).obj X),
                          Option.get (some a)
                              (_ : isSome ↑((fun a => { val := some a, property := (_ : some a ≠ none) }) a) = true) =
                            a),
                    right_inv :=
                      (_ :
                        ∀ (a : (partialFunToPointed ⋙ pointedToPartialFun).obj X),
                          { val := some ((fun a => Option.get ↑a (_ : isSome ↑a = true)) a),
                              property := (_ : some ((fun a => Option.get ↑a (_ : isSome ↑a = true)) a) ≠ none) } =
                            a) })
              X✝).hom ≫
          (partialFunToPointed ⋙ pointedToPartialFun).map f)
        a

Next tactic:
dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ Part.bind (f a) fun x => Part.some { val := some x, property := (_ : some x ≠ none) }) ↔
    b ∈
      Part.bind (Part.some { val := some a, property := (_ : some a ≠ none) })
        (PFun.toSubtype (fun x => ¬x = (partialFunToPointed.obj Y✝).point)
            (Option.elim' none fun a => Part.toOption (f a)) ∘
          Subtype.val)

Next tactic:
rw [Part.bind_some]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ Part.bind (f a) fun x => Part.some { val := some x, property := (_ : some x ≠ none) }) ↔
    b ∈
      (PFun.toSubtype (fun x => ¬x = (partialFunToPointed.obj Y✝).point)
            (Option.elim' none fun a => Part.toOption (f a)) ∘
          Subtype.val)
        { val := some a, property := (_ : some a ≠ none) }

Next tactic:
refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
          

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (∃ a_1 ∈ f a, b ∈ Part.some { val := some a_1, property := (_ : some a_1 ≠ none) }) ↔
    ↑b = Option.elim' none (fun a => Part.toOption (f a)) ↑{ val := some a, property := (_ : some a ≠ none) }

Next tactic:
obtain ⟨b | b, hb⟩ := b
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
          obtain ⟨b | b, hb⟩ := b
          · 

Proof state:
case mk.none
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
hb : none ≠ (partialFunToPointed.obj Y✝).point
⊢ (∃ a_1 ∈ f a, { val := none, property := hb } ∈ Part.some { val := some a_1, property := (_ : some a_1 ≠ none) }) ↔
    ↑{ val := none, property := hb } =
      Option.elim' none (fun a => Part.toOption (f a)) ↑{ val := some a, property := (_ : some a ≠ none) }

Next tactic:
exact (hb rfl).elim
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
          obtain ⟨b | b, hb⟩ := b
          · exact (hb rfl).elim
          · 

Proof state:
case mk.some
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : Y✝
hb : some b ≠ (partialFunToPointed.obj Y✝).point
⊢ (∃ a_1 ∈ f a, { val := some b, property := hb } ∈ Part.some { val := some a_1, property := (_ : some a_1 ≠ none) }) ↔
    ↑{ val := some b, property := hb } =
      Option.elim' none (fun a => Part.toOption (f a)) ↑{ val := some a, property := (_ : some a ≠ none) }

Next tactic:
dsimp [Part.toOption]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
          obtain ⟨b | b, hb⟩ := b
          · exact (hb rfl).elim
          · dsimp [Part.toOption]
            

Proof state:
case mk.some
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : Y✝
hb : some b ≠ (partialFunToPointed.obj Y✝).point
⊢ (∃ a_1 ∈ f a, { val := some b, property := hb } ∈ Part.some { val := some a_1, property := (_ : some a_1 ≠ none) }) ↔
    some b = if h : (f a).Dom then some (Part.get (f a) h) else none

Next tactic:
simp_rw [Part.mem_some_iff, Subtype.mk_eq_mk]
/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed :=
  CategoryTheory.Equivalence.mk partialFunToPointed pointedToPartialFun
    (NatIso.ofComponents (fun X => PartialFun.Iso.mk
      { toFun := fun a => ⟨some a, some_ne_none a⟩
        invFun := fun a => Option.get _ (Option.ne_none_iff_isSome.1 a.2)
        left_inv := fun a => Option.get_some _ _
        right_inv := fun a => by simp only [some_get, Subtype.coe_eta] })
      fun f =>
        PFun.ext fun a b => by
          dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
          rw [Part.bind_some]
          -- porting note: the proof below has changed a lot because
          -- `Part.mem_bind_iff` means that `b ∈ Part.bind f g` is equivalent
          -- to `∃ (a : α), a ∈ f ∧ b ∈ g a`, while in mathlib3 it was equivalent
          -- to `∃ (a : α) (H : a ∈ f), b ∈ g a`
          refine' (Part.mem_bind_iff.trans _).trans PFun.mem_toSubtype_iff.symm
          obtain ⟨b | b, hb⟩ := b
          · exact (hb rfl).elim
          · dsimp [Part.toOption]
            simp_rw [Part.mem_some_iff, Subtype.mk_eq_mk]
            

Proof state:
case mk.some
α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : Y✝
hb : some b ≠ (partialFunToPointed.obj Y✝).point
⊢ (∃ a_1 ∈ f a, some b = some a_1) ↔ some b = if h : (f a).Dom then some (Part.get (f a) h) else none

Next tactic:
constructor