Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category and Cartesian instances for polymorphic predicates #443

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AJChapman
Copy link

This is a new category in which the objects are predicates (wrapped in a PRED record implicitly containing the underlying type and the predicate) and the morphisms map between these objects. This differs from the Preds instance in Categories.Category.Instance.Preds in that the morphisms can change the underlying type as well as the predicate. I'm tentatively referring to this as 'polymorphic' to distinguish it from the existing instance.

I'm not certain that this fits into this library, and if it does then maybe I need to break it apart into separate files for PRED, Preds and PredsCartesian? I'd be happy to adapt it if you're interested, or just to get feedback on any of it as I'm fairly new to Agda and dependent types.

@JacquesCarette
Copy link
Collaborator

Note that I'm away at a conference right now, so won't be able to review in detail for another few days.

Because PRED is essentially isomorphic to 'containers' which is also known as 'polynomial functors', we definitely want this. Though doing it atop 'containers' is likely the way to go.

@TOTBWF
Copy link
Collaborator

TOTBWF commented Dec 4, 2024

A better name for this would be Fam(Set); it is precisely the total category of the family fibration on the category of sets.

Containers/Poly would have the maps going "backwards", EG:

record _⇒_ (A B : PRED) : Set o where
  constructor mk⇒
  open PRED
  field
    {f} : U A  U B
    imp :  {u}  P B (f u)  P A u

@TOTBWF
Copy link
Collaborator

TOTBWF commented Dec 4, 2024

It might be worth doing Fam in it's generality though; this would give you Fam(Set), Fam(Setoids), and Fam(Setoids^op) all in one go.

@JacquesCarette
Copy link
Collaborator

Thanks for catching that I missed the orientation reversal. And yes, it probably is worth doing Fam instead. Do you know what that means @AJChapman ?

@AJChapman
Copy link
Author

I don't yet know what it means. My category theory knowledge is quite limited. I'll read up on what a 'family fibration' is at the 1lab link @TOTBWF gave. I see that 1lab already has this implemented, so I can use their code as a guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants