Skip to content

Rewrite category theory code to separate structure and properties #1267

@mortberg

Description

@mortberg

I think the category theory in the library should be rewritten to match the way the algebra code is written. In particular, data and properties should be separated so that we have for example:

  • CategoryStr = Category structure
  • isCategory = The properties for when a category structure is a category.
  • Category = Sigma type of CategoryStr and isCategory.

I believe this could both speed things up (e.g. isCategory can pretty much always be made abstract) and we can be more careful when passing things around, e.g., functors should only depend on CategoryStr, not isCategory. This should also make Agda better at inferring things for us (issues like Agda loosing track of categories having hom-sets is less likely to occur if less things depend on it, etc...). It's also generally desired to have category theoretic structures match the way the algebraic structures are implemented.

As part of this we should also be more careful about using no-eta-equality consistently (so finishing #1247 and resolving #1240).

I would also like to clean up the category theoretic notations when doing this. My experience is that Agda often gets confused whether it should display a syntax or the name of the operation, leading to unreadable goals with strange mixes of notations and mixfix operations as well as unpredictable behavior when using various levels of C-u. Hopefully this gets better if we remove some syntax declarations. I also strongly dislike some of the non-standard notation like _⟅_⟆.

What do you think about this @maxsnew @ecavallo @felixwellen and everyone else who is using the CT part of the library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions