l3lab/ntp-mathlib huggingface dataset:
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · 

Proof state:
case pos
α : Type u_1
β : Type u_2
X : Pointed
a : ((𝟭 Pointed).obj X).X
h : a = X.point
⊢ Option.elim' X.point Subtype.val none = a

Next tactic:
rw [h]
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            

Proof state:
case pos
α : Type u_1
β : Type u_2
X : Pointed
a : ((𝟭 Pointed).obj X).X
h : a = X.point
⊢ Option.elim' X.point Subtype.val none = X.point

Next tactic:
rfl
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · 

Proof state:
case neg
α : Type u_1
β : Type u_2
X : Pointed
a : ((𝟭 Pointed).obj X).X
h : ¬a = X.point
⊢ Option.elim' X.point Subtype.val (some { val := a, property := h }) = a

Next tactic:
rfl
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · rfl} rfl)
      fun {X Y} f =>
      Pointed.Hom.ext _ _ <|
        funext fun a =>
          Option.recOn a f.map_point.symm (by
            rintro ⟨a, ha⟩
            change Option.elim' _ _ _ = f.toFun a
            

Proof state:
case mk
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a✝ : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
a : X.X
ha : a ≠ X.point
⊢ Option.elim' Y.point (fun a => ↑a)
      (Pointed.Hom.toFun ((pointedToPartialFun ⋙ partialFunToPointed).map f) (some { val := a, property := ha })) =
    Pointed.Hom.toFun f a

Next tactic:
dsimp
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · rfl} rfl)
      fun {X Y} f =>
      Pointed.Hom.ext _ _ <|
        funext fun a =>
          Option.recOn a f.map_point.symm (by
            rintro ⟨a, ha⟩
            change Option.elim' _ _ _ = f.toFun a
            dsimp
            -- porting note: `rw [Part.elim_toOption]` does not work because there are
            -- conflicting `Decidable` instances
            

Proof state:
case mk
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a✝ : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
a : X.X
ha : a ≠ X.point
⊢ Option.elim' Y.point (fun a => ↑a)
      (Part.toOption { Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) }) =
    Pointed.Hom.toFun f a

Next tactic:
rw [Option.elim'_eq_elim, @Part.elim_toOption _ _ _ (Classical.propDecidable _)]
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · rfl} rfl)
      fun {X Y} f =>
      Pointed.Hom.ext _ _ <|
        funext fun a =>
          Option.recOn a f.map_point.symm (by
            rintro ⟨a, ha⟩
            change Option.elim' _ _ _ = f.toFun a
            dsimp
            -- porting note: `rw [Part.elim_toOption]` does not work because there are
            -- conflicting `Decidable` instances
            rw [Option.elim'_eq_elim, @Part.elim_toOption _ _ _ (Classical.propDecidable _)]
            

Proof state:
case mk
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a✝ : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
a : X.X
ha : a ≠ X.point
⊢ (if h : { Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) }.Dom then
      ↑(Part.get { Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) } h)
    else Y.point) =
    Pointed.Hom.toFun f a

Next tactic:
split_ifs with h
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · rfl} rfl)
      fun {X Y} f =>
      Pointed.Hom.ext _ _ <|
        funext fun a =>
          Option.recOn a f.map_point.symm (by
            rintro ⟨a, ha⟩
            change Option.elim' _ _ _ = f.toFun a
            dsimp
            -- porting note: `rw [Part.elim_toOption]` does not work because there are
            -- conflicting `Decidable` instances
            rw [Option.elim'_eq_elim, @Part.elim_toOption _ _ _ (Classical.propDecidable _)]
            split_ifs with h
            · 

Proof state:
case pos
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a✝ : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
a : X.X
ha : a ≠ X.point
h : { Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) }.Dom
⊢ ↑(Part.get { Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) } h) =
    Pointed.Hom.toFun f a

Next tactic:
rfl
/-- 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]
            constructor
            · rintro ⟨_, ⟨h₁, h₂⟩, h₃⟩
              rw [h₃, ← h₂, dif_pos h₁]
            · intro h
              split_ifs at h with ha
              rw [some_inj] at h
              refine' ⟨b, ⟨ha, h.symm⟩, rfl⟩)
    (NatIso.ofComponents (fun X => Pointed.Iso.mk
      { toFun := Option.elim' X.point Subtype.val
        invFun := fun a => by
          classical
          exact if h : a = X.point then none else some ⟨_, h⟩
        left_inv := fun a => Option.recOn a (dif_pos rfl) fun a => by
          dsimp
          rw [dif_neg a.2]
          rfl
        right_inv := fun a => by
          dsimp
          split_ifs with h
          · rw [h]
            rfl
          · rfl} rfl)
      fun {X Y} f =>
      Pointed.Hom.ext _ _ <|
        funext fun a =>
          Option.recOn a f.map_point.symm (by
            rintro ⟨a, ha⟩
            change Option.elim' _ _ _ = f.toFun a
            dsimp
            -- porting note: `rw [Part.elim_toOption]` does not work because there are
            -- conflicting `Decidable` instances
            rw [Option.elim'_eq_elim, @Part.elim_toOption _ _ _ (Classical.propDecidable _)]
            split_ifs with h
            · rfl
            · 

Proof state:
case neg
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a✝ : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
a : X.X
ha : a ≠ X.point
h : ¬{ Dom := ¬Pointed.Hom.toFun f a = Y.point, get := Subtype.mk (Pointed.Hom.toFun f a) }.Dom
⊢ Y.point = Pointed.Hom.toFun f a

Next tactic:
exact Eq.symm (of_not_not h)
/-- Forgetting that maps are total and making them total again by adding a point is the same as just
adding a point. -/
@[simps!]
noncomputable def typeToPartialFunIsoPartialFunToPointed :
    typeToPartialFun ⋙ partialFunToPointed ≅ typeToPointed :=
  NatIso.ofComponents
    (fun X =>
      { hom := ⟨id, rfl⟩
        inv := ⟨id, rfl⟩
        hom_inv_id := rfl
        inv_hom_id := rfl })
    fun f =>
    Pointed.Hom.ext _ _ <|
      funext fun a => Option.recOn a rfl fun a => by
        

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : Type ?u.21974
f : X✝ ⟶ Y✝
a✝ : ((typeToPartialFun ⋙ partialFunToPointed).obj X✝).X
a : typeToPartialFun.obj X✝
⊢ Pointed.Hom.toFun
      ((typeToPartialFun ⋙ partialFunToPointed).map f ≫
        ((fun X =>
              Iso.mk
                { toFun := id,
                  map_point :=
                    (_ :
                      id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point =
                        id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point) }
                { toFun := id, map_point := (_ : id (typeToPointed.obj X).point = id (typeToPointed.obj X).point) })
            Y✝).hom)
      (some a) =
    Pointed.Hom.toFun
      (((fun X =>
              Iso.mk
                { toFun := id,
                  map_point :=
                    (_ :
                      id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point =
                        id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point) }
                { toFun := id, map_point := (_ : id (typeToPointed.obj X).point = id (typeToPointed.obj X).point) })
            X✝).hom ≫
        typeToPointed.map f)
      (some a)

Next tactic:
classical
        convert Part.some_toOption _
/-- Forgetting that maps are total and making them total again by adding a point is the same as just
adding a point. -/
@[simps!]
noncomputable def typeToPartialFunIsoPartialFunToPointed :
    typeToPartialFun ⋙ partialFunToPointed ≅ typeToPointed :=
  NatIso.ofComponents
    (fun X =>
      { hom := ⟨id, rfl⟩
        inv := ⟨id, rfl⟩
        hom_inv_id := rfl
        inv_hom_id := rfl })
    fun f =>
    Pointed.Hom.ext _ _ <|
      funext fun a => Option.recOn a rfl fun a => by
        classical
        

Proof state:
α : Type u_1
β : Type u_2
X✝ Y✝ : Type ?u.21974
f : X✝ ⟶ Y✝
a✝ : ((typeToPartialFun ⋙ partialFunToPointed).obj X✝).X
a : typeToPartialFun.obj X✝
⊢ Pointed.Hom.toFun
      ((typeToPartialFun ⋙ partialFunToPointed).map f ≫
        ((fun X =>
              Iso.mk
                { toFun := id,
                  map_point :=
                    (_ :
                      id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point =
                        id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point) }
                { toFun := id, map_point := (_ : id (typeToPointed.obj X).point = id (typeToPointed.obj X).point) })
            Y✝).hom)
      (some a) =
    Pointed.Hom.toFun
      (((fun X =>
              Iso.mk
                { toFun := id,
                  map_point :=
                    (_ :
                      id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point =
                        id ((typeToPartialFun ⋙ partialFunToPointed).obj X).point) }
                { toFun := id, map_point := (_ : id (typeToPointed.obj X).point = id (typeToPointed.obj X).point) })
            X✝).hom ≫
        typeToPointed.map f)
      (some a)

Next tactic:
convert Part.some_toOption _
theorem two_eq_zero : (2 : R) = 0 := by 

Proof state:
R : Type u_1
ι : Type u_2
inst✝¹ : Semiring R
inst✝ : CharP R 2
⊢ 2 = 0

Next tactic:
rw [← Nat.cast_two, CharP.cast_eq_zero]
@[simp]
theorem add_self_eq_zero (x : R) : x + x = 0 := by 

Proof state:
R : Type u_1
ι : Type u_2
inst✝¹ : Semiring R
inst✝ : CharP R 2
x : R
⊢ x + x = 0

Next tactic:
rw [← two_smul R x, two_eq_zero, zero_smul]
set_option linter.deprecated false in
@[simp]
theorem bit0_eq_zero : (bit0 : R → R) = 0 := by
  

Proof state:
R : Type u_1
ι : Type u_2
inst✝¹ : Semiring R
inst✝ : CharP R 2
⊢ bit0 = 0

Next tactic:
funext
set_option linter.deprecated false in
@[simp]
theorem bit0_eq_zero : (bit0 : R → R) = 0 := by
  funext
  

Proof state:
case h
R : Type u_1
ι : Type u_2
inst✝¹ : Semiring R
inst✝ : CharP R 2
x✝ : R
⊢ bit0 x✝ = OfNat.ofNat 0 x✝

Next tactic:
exact add_self_eq_zero _