Lean4
/-- The product in `CommRingCat` is the Cartesian product. -/
def prodFanIsLimit : IsLimit (prodFan A B)
where
lift c := ofHom <| RingHom.prod (c.π.app ⟨WalkingPair.left⟩).hom (c.π.app ⟨WalkingPair.right⟩).hom
fac c
j := by
ext
rcases j with ⟨⟨⟩⟩ <;> simp only [pair_obj_left, prodFan_pt, BinaryFan.π_app_left, BinaryFan.π_app_right] <;> rfl
uniq s m
h := by
ext x
change m x = (BinaryFan.fst s x, BinaryFan.snd s x)
have eq1 : (m ≫ (A.prodFan B).fst) x = (BinaryFan.fst s) x := congr_hom (h ⟨WalkingPair.left⟩) x
have eq2 : (m ≫ (A.prodFan B).snd) x = (BinaryFan.snd s) x := congr_hom (h ⟨WalkingPair.right⟩) x
rw [← eq1, ← eq2]
simp [prodFan]