-- Mathlib/CategoryTheory/Limits/Constructions/BinaryProducts.lean
/-- A functor that preserves initial objects and pushouts preserves binary coproducts. -/
lemma preservesBinaryCoproducts_of_preservesInitial_and_pushouts [HasInitial C]
    [HasPushouts C] [PreservesColimitsOfShape (Discrete.{0} PEmpty) F]
    [PreservesColimitsOfShape WalkingSpan F] : PreservesColimitsOfShape (Discrete WalkingPair) F :=
  ⟨fun {K} =>
    preservesColimit_of_preserves_colimit_cocone (colimitCoconeOfInitialAndPushouts K).2 (by
      apply
        isBinaryCoproductOfIsInitialIsPushout _ _
          (isColimitOfHasInitialOfPreservesColimit F)
      apply isColimitOfHasPushoutOfPreservesColimit)⟩

Proof state:
case hc
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ IsColimit
    (PushoutCocone.mk ((F.mapCocone (colimitCoconeOfInitialAndPushouts K).cocone).ι.app { as := WalkingPair.left })
      ((F.mapCocone (colimitCoconeOfInitialAndPushouts K).cocone).ι.app { as := WalkingPair.right }) ⋯)

case f
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ F.obj (⊥_ C) ⟶ (K ⋙ F).obj { as := WalkingPair.left }

case g
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ F.obj (⊥_ C) ⟶ (K ⋙ F).obj { as := WalkingPair.right }

Tactic:
apply isColimitOfHasPushoutOfPreservesColimit

Result:
no goals

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ IsColimit (F.mapCocone (colimitCoconeOfInitialAndPushouts K).cocone)

Tactic:
apply
  isBinaryCoproductOfIsInitialIsPushout _ _
    (isColimitOfHasInitialOfPreservesColimit F)

Result:
case hc
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ IsColimit
    (PushoutCocone.mk ((F.mapCocone (colimitCoconeOfInitialAndPushouts K).cocone).ι.app { as := WalkingPair.left })
      ((F.mapCocone (colimitCoconeOfInitialAndPushouts K).cocone).ι.app { as := WalkingPair.right }) ⋯)

case f
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ F.obj (⊥_ C) ⟶ (K ⋙ F).obj { as := WalkingPair.left }

case g
C : Type u
inst✝⁵ : Category.{v, u} C
D : Type u'
inst✝⁴ : Category.{v', u'} D
F : C ⥤ D
inst✝³ : HasInitial C
inst✝² : HasPushouts C
inst✝¹ : PreservesColimitsOfShape (Discrete PEmpty.{1}) F
inst✝ : PreservesColimitsOfShape WalkingSpan F
K : Discrete WalkingPair ⥤ C
⊢ F.obj (⊥_ C) ⟶ (K ⋙ F).obj { as := WalkingPair.right }