-- Module: Mathlib.CategoryTheory.Limits.Types.Coproducts
Goal:
X Y : Type u
c : BinaryCofan X Y
h₁ :
  Injective (α := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair })) (β :=
    (fun (X : Type u) ↦ X)
      (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt) { as := left : Discrete WalkingPair }))
    (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
      (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
        (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }))
h₂ :
  Injective (α := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := right : Discrete WalkingPair })) (β :=
    (fun (X : Type u) ↦ X)
      (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt) { as := right : Discrete WalkingPair }))
    (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) :
      (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
        (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right }))
h₃ :
  IsCompl (α :=
    Set
      ((fun (X : Type u) ↦ X)
        (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt) { as := left : Discrete WalkingPair })))
    (Set.range (ι := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair }))
      (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
        (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
          (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left })))
    (Set.range (ι := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := right : Discrete WalkingPair }))
      (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) :
        (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
          (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right })))
this :
  ∀
    (x :
      (fun (X : Type u) ↦ X)
        (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt) { as := left : Discrete WalkingPair })),
    Membership.mem (γ :=
        Set
          ((fun (X : Type u) ↦ X)
            (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
              { as := left : Discrete WalkingPair })))
        (Set.range (ι := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair }))
          (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
            (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
              (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left })))
        x ∨
      Membership.mem (γ :=
        Set
          ((fun (X : Type u) ↦ X)
            (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
              { as := right : Discrete WalkingPair })))
        (Set.range (ι := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := right : Discrete WalkingPair }))
          (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) :
            (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
              (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right })))
        x
T : Type u
m : c.pt ⟶ T
x : c.pt
mpr :
  Eq (α := T) ((ConcreteCategory.hom (FC := TypeCat.Fun) m : (a : c.pt) → T) x : T)
    (if h : ∃ (y : X), (ConcreteCategory.hom (FC := TypeCat.Fun) c.inl : (a : X) → c.pt) y = x then
        (ConcreteCategory.hom (FC := TypeCat.Fun) m : (a : c.pt) → T)
          ((ConcreteCategory.hom (FC := TypeCat.Fun) c.inl : (a : X) → c.pt)
              (((Equiv.ofInjective (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) : (a : X) → c.pt) h₁).symm :
                    (a : (↑(Set.range (⇑(ConcreteCategory.hom c.inl) : (a : X) → c.pt)) : Type u)) → X)
                  (Subtype.mk (p := fun (x : c.pt) ↦
                    Membership.mem (γ := Set c.pt)
                      (Set.range (ι := X) (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) : (a : X) → c.pt)) x)
                    x ⋯) :
                X) :
            c.pt)
      else
        (ConcreteCategory.hom (FC := TypeCat.Fun) m : (a : c.pt) → T)
          ((ConcreteCategory.hom (FC := TypeCat.Fun) c.inr : (a : Y) → c.pt)
              (((Equiv.ofInjective (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) : (a : Y) → c.pt) h₂).symm :
                    (a : (↑(Set.range (⇑(ConcreteCategory.hom c.inr) : (a : Y) → c.pt)) : Type u)) → Y)
                  (Subtype.mk (p := fun (x : c.pt) ↦
                    Membership.mem (γ := Set c.pt)
                      (Set.range (ι := Y) (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) : (a : Y) → c.pt)) x)
                    x ⋯) :
                Y) :
            c.pt) :
      T)
⊢ (ConcreteCategory.hom (FC := TypeCat.Fun) m).toFun x =
    TypeCat.Fun.toFun
      (ConcreteCategory.hom (FC := TypeCat.Fun)
        (↾fun (x : c.pt) ↦
          if h :
              Membership.mem (γ :=
                Set
                  ((fun (X : Type u) ↦ X)
                    (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
                      { as := left : Discrete WalkingPair })))
                (Set.range (ι := (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair }))
                  (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
                    (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
                      (fun (X : Type u) ↦ X) (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left })))
                x then
            (ConcreteCategory.hom (FC := TypeCat.Fun) (c.inl ≫ m) :
                (a : (fun (X : Type u) ↦ X) X) → (fun (X : Type u) ↦ X) T)
              (((Equiv.ofInjective
                        (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
                          (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
                            (fun (X : Type u) ↦ X)
                              (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }))
                        h₁).symm :
                    (a :
                        (↑(Set.range
                              (⇑(ConcreteCategory.hom c.inl) :
                                (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
                                  (fun (X : Type u) ↦ X)
                                    (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left }))) :
                          Type u)) →
                      (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left }))
                  (Subtype.mk (p :=
                    fun
                      (x :
                        (fun (X : Type u) ↦ X)
                          (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
                            { as := left : Discrete WalkingPair })) ↦
                    Membership.mem (γ :=
                      Set
                        ((fun (X : Type u) ↦ X)
                          (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
                            { as := left : Discrete WalkingPair })))
                      (Set.range (ι :=
                        (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair }))
                        (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inl) :
                          (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := left })) →
                            (fun (X : Type u) ↦ X)
                              (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := left })))
                      x)
                    x h) :
                (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := left : Discrete WalkingPair }))
          else
            (ConcreteCategory.hom (FC := TypeCat.Fun) (c.inr ≫ m) :
                (a : (fun (X : Type u) ↦ X) Y) → (fun (X : Type u) ↦ X) T)
              (((Equiv.ofInjective
                        (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) :
                          (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
                            (fun (X : Type u) ↦ X)
                              (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right }))
                        h₂).symm :
                    (a :
                        (↑(Set.range
                              (⇑(ConcreteCategory.hom c.inr) :
                                (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
                                  (fun (X : Type u) ↦ X)
                                    (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right }))) :
                          Type u)) →
                      (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right }))
                  (Subtype.mk (p :=
                    fun
                      (x :
                        (fun (X : Type u) ↦ X)
                          (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
                            { as := right : Discrete WalkingPair })) ↦
                    Membership.mem (γ :=
                      Set
                        ((fun (X : Type u) ↦ X)
                          (Functor.obj (Functor.obj (Functor.const (Discrete WalkingPair)) c.pt)
                            { as := right : Discrete WalkingPair })))
                      (Set.range (ι :=
                        (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := right : Discrete WalkingPair }))
                        (⇑(ConcreteCategory.hom (FC := TypeCat.Fun) c.inr) :
                          (a : (fun (X : Type u) ↦ X) ((pair X Y).obj { as := right })) →
                            (fun (X : Type u) ↦ X)
                              (((Functor.const (Discrete WalkingPair)).obj c.pt).obj { as := right })))
                      x)
                    x ⋯) :
                (fun (X : Type u) ↦ X) (Functor.obj (pair X Y) { as := right : Discrete WalkingPair }))))
      x

Tactic:
simp only [TypeCat.Fun.toFun_apply, Functor.const_obj_obj, pair_obj_left, Set.mem_range,
          comp_apply, pair_obj_right, ConcreteCategory.hom_ofHom, TypeCat.Fun.coe_mk]

Premises used: Set.mem_range, CategoryTheory.Limits.pair_obj_right, TypeCat.Fun.coe_mk, TypeCat.Fun.toFun_apply, CategoryTheory.comp_apply, CategoryTheory.Limits.pair_obj_left, CategoryTheory.Functor.const_obj_obj, CategoryTheory.ConcreteCategory.hom_ofHom