Skip to content

Usability of Pullback.agda #520

@sergey-goncharov

Description

@sergey-goncharov

I am struggling with Categories.Diagram.Pullback, trying to use it for my project. I've added some fixes, which helped, but the whole implementation philosophy seems to contradict my use case (any use case?). So, I am seeking guidance.

I believe, mathematically, the central concept is IsPullback, not Pullback. This is because we usually have an already-commuting diagram as input, and we only need to prove that it is a pullback. So, the functional transformation we need is:

  • commuting diagram -> pullback property

not:

  • cospan -> commuting diagram, which is also a pullback

Sometimes, the difference is shallow. But it gets deep quickly. As an example, I tried to use unglue, which basically subtracts a pullback from another pullback:

unglue : (p : Pullback f g) → Pullback (f ∘ h) g → Pullback h (Pullback.p₁ p)

The problematic clause is this

p₂ = p.universal (sym-assoc ○ q.commute)

Because the pullback span is defined up to isomorphism, Pullback (f ∘ h) g only ensures that a suitable span exists, and it is guaranteed not to match any span that I am highly likely to already have at hand. Thus, to finish the construction of Pullback h (Pullback.p₁ p), we need the universal property of the first pullback, which returns anything but the morphism I probably already have, because I probably already have a concrete factorization of the large pullback's span through the small pullback's span. The resulting pullback Pullback h (Pullback.p₁ p) is then different from my candidate pullback, and that difference is not shallow. It seems that it is easier to prove that the resulting pullback is so from scratch than by using unglue.

Incidentally, unglue is often not general enough, so I added a stronger version, called unglue' , following the IsPullback paradigm. It works perfectly, but still, sometimes, the generality of unglue is enough, so I would prefer to have an IsPullback version of it. So, how should I call it? unglue''? To me, the right thing would be to have unglue and unglue' in the IsPullback form, and whatever for the current unglue.

This is just an example. This whole file is written in Pullback-centric way. Instead of swap : Pullback f g → Pullback g f I would have preferred swap : IsPullback f g h u → IsPullback g f u h, etc. Perhaps, this is not specific to pullbacks but to other structures across the library. So, I am wondering if there is a solid design decision behind this approach, which I am not grasping, being narrowly focused on concrete categorical arguments I am trying to formalize.

Any opinions? Should I just keep adding things that I am missing, and should I stick to any specific naming conventions then?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions