Theorem: partialFunEquivPointed_counitIso_hom_app_toFun
File: Mathlib/CategoryTheory/Category/PartialFun.lean

Proof steps:
state_before: α : Type u_1
β : Type u_2
X : PartialFun
a : (partialFunToPointed ⋙ pointedToPartialFun).obj X
⊢ (fun a => ⟨some a, ⋯⟩) ((fun a => Option.get ↑a ⋯) a) = a
state_after: no goals
tactic: simp only [some_get, Subtype.coe_eta]
state_before: α : 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 => ⟨some a, ⋯⟩, invFun := fun a => Option.get ↑a ⋯, left_inv := ⋯, right_inv := ⋯ })
              Y✝).hom)
        a ↔
    b ∈
      (((fun X =>
                PartialFun.Iso.mk
                  { toFun := fun a => ⟨some a, ⋯⟩, invFun := fun a => Option.get ↑a ⋯, left_inv := ⋯, right_inv := ⋯ })
              X✝).hom ≫
          (partialFunToPointed ⋙ pointedToPartialFun).map f)
        a
state_after: α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ (f a).bind fun x => Part.some ⟨some x, ⋯⟩) ↔
    b ∈
      (Part.some ⟨some a, ⋯⟩).bind
        (PFun.toSubtype (fun x => ¬x = none) (Option.elim' none fun a => (f a).toOption) ∘ Subtype.val)
tactic: dsimp [PartialFun.Iso.mk, CategoryStruct.comp, pointedToPartialFun]
state_before: α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ (f a).bind fun x => Part.some ⟨some x, ⋯⟩) ↔
    b ∈
      (Part.some ⟨some a, ⋯⟩).bind
        (PFun.toSubtype (fun x => ¬x = none) (Option.elim' none fun a => (f a).toOption) ∘ Subtype.val)
state_after: α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ (f a).bind fun x => Part.some ⟨some x, ⋯⟩) ↔
    b ∈ (PFun.toSubtype (fun x => ¬x = none) (Option.elim' none fun a => (f a).toOption) ∘ Subtype.val) ⟨some a, ⋯⟩
tactic: rw [Part.bind_some]
state_before: α : Type u_1
β : Type u_2
X✝ Y✝ : PartialFun
f : X✝ ⟶ Y✝
a : (𝟭 PartialFun).obj X✝
b : (partialFunToPointed ⋙ pointedToPartialFun).obj Y✝
⊢ (b ∈ (f a).bind fun x => Part.some ⟨some x, ⋯⟩) ↔
    b ∈ (PFun.toSubtype (fun x => ¬x = none) (Option.elim' none fun a => (f a).toOption) ∘ Subtype.val) ⟨some a, ⋯⟩
state_after: α : 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 ⟨some a_1, ⋯⟩) ↔ ↑b = Option.elim' none (fun a => (f a).toOption) ↑⟨some a, ⋯⟩
tactic: refine (Part.mem_bind_iff.trans ?_).trans PFun.mem_toSubtype_iff.symm
state_before: α : 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 ⟨some a_1, ⋯⟩) ↔ ↑b = Option.elim' none (fun a => (f a).toOption) ↑⟨some a, ⋯⟩
state_after: 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, ⟨none, hb⟩ ∈ Part.some ⟨some a_1, ⋯⟩) ↔
    ↑⟨none, hb⟩ = Option.elim' none (fun a => (f a).toOption) ↑⟨some a, ⋯⟩

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, hb⟩ ∈ Part.some ⟨some a_1, ⋯⟩) ↔
    ↑⟨some b, hb⟩ = Option.elim' none (fun a => (f a).toOption) ↑⟨some a, ⋯⟩
tactic: obtain ⟨b | b, hb⟩ := b
state_before: α : Type u_1
β : Type u_2
X : Pointed
⊢ ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X ≃ ((𝟭 Pointed).obj X).X
state_after: no goals
tactic: classical exact Equiv.optionSubtypeNe X.point
state_before: α : Type u_1
β : Type u_2
X : Pointed
⊢ (Equiv.optionSubtypeNe X.point) ((pointedToPartialFun ⋙ partialFunToPointed).obj X).point = ((𝟭 Pointed).obj X).point
state_after: no goals
tactic: rfl
state_before: α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a : ((pointedToPartialFun ⋙ partialFunToPointed).obj X).X
⊢ ((pointedToPartialFun ⋙ partialFunToPointed).map f ≫
          ((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) Y).hom).toFun
      a =
    (((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) X).hom ≫ (𝟭 Pointed).map f).toFun a
state_after: case none
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
⊢ ((pointedToPartialFun ⋙ partialFunToPointed).map f ≫
          ((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) Y).hom).toFun
      none =
    (((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) X).hom ≫ (𝟭 Pointed).map f).toFun none

case some.mk
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a : X.X
ha : a ≠ X.point
⊢ ((pointedToPartialFun ⋙ partialFunToPointed).map f ≫
          ((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) Y).hom).toFun
      (some ⟨a, ha⟩) =
    (((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) X).hom ≫ (𝟭 Pointed).map f).toFun (some ⟨a, ha⟩)
tactic: obtain _ | ⟨a, ha⟩ := a
state_before: case some.mk
α : Type u_1
β : Type u_2
X Y : Pointed
f : X ⟶ Y
a : X.X
ha : a ≠ X.point
⊢ ((pointedToPartialFun ⋙ partialFunToPointed).map f ≫
          ((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) Y).hom).toFun
      (some ⟨a, ha⟩) =
    (((fun X => Pointed.Iso.mk (Equiv.optionSubtypeNe X.point) ⋯) X).hom ≫ (𝟭 Pointed).map f).toFun (some ⟨a, ha⟩)
state_after: no goals
tactic: simp_all [Option.casesOn'_eq_elim, Part.elim_toOption]