A general context for pasting lemmas (e.g. pullbacks, comma objects, etc.)
Statement
An elementary but useful fact when dealing with pullbacks is the so-called pasting law, which states that, given a diagram as follows in an arbitrary category, assuming the rightmost square is a pullback, then the leftmost square is a pullback if and only if the outer rectangle is a pullback.
Similarly, given a diagram as follows in an arbitrary 2-category, assuming the rightmost square is a comma object, then the leftmost square is a pullback if and only if the outer rectangle is a comma object.
This phenomenon appears in many guises in category theory (e.g. lax/pseudo/bi-pullbacks satisfy a similar pasting law, and see Lemma 6.4 of Relative monadicity for an example involving different shapes than squares).
In practice, proving these kinds of pasting laws is straightforward (just unwind the universal property of the rightmost limit) but tedious.
Question. Is there a general result from which these kinds of pasting laws follow? (I would be satisfied with an answer purely for categories, though an answer for 2-categories would be even better.)
I have in mind a formulation of such a result, so I am primarily wondering whether this has been considered anywhere in the literature …
Posed by varkor · ct.category-theory, limits-and-colimits, 2-categories, pullback
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-498889.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/mo-498889.lean
import Mathlib /-! # A general context for pasting lemmas (e.g. pullbacks, comma objects, etc.) Source: https://mathoverflow.net/questions/498889 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_mo_498889 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_498889