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

feat(category_theory/shapes): basic shapes of cones and conversions #611

Closed

Conversation

semorrison
Copy link
Collaborator

Some helper methods for building and decomposing cones of various standard shapes.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@semorrison
Copy link
Collaborator Author

I've just rebased this.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine. But I don't have as clear a vision of what the end result of the implementation of the limits library should look like as others might have. I would say, let's get this merged and see how it works. We don't have too many users, so we can still refactor after we have more experience.

@semorrison
Copy link
Collaborator Author

What do you think, @rwbarton?

@rwbarton
Copy link
Collaborator

rwbarton commented Feb 5, 2019

I haven't had a chance to look at this in depth. I'm okay with the plan of merging something along these lines with the idea that it may change substantially in the future.

I'm especially unsure that in the long run we really want two different notions square and cosquare.

I think we should also take a look at prior art in other category theory libraries, for example the Lean 2 category theory library (e.g. 1, 2).

@jcommelin
Copy link
Member

@fpvandoorn Can you comment on your experience developing the category lib in Lean2?

@fpvandoorn
Copy link
Member

I'm not sure what kind of things you want to know. I remember that it was a lot of work with 1-2 people to build a category library (it was mostly me and Jakob von Raumer, @javra), especially since we didn't have a clear goal in sight. Therefore the library has many rough edges and is very incomplete. It was fun to build parts of a category theory library, though, especially since some things in category theory work quite differently in HoTT.

I like how the category theory library in Lean 3 does more with automation. There were quite some diagram chases which we had to write out explicitly, which are done by a single tactic in Lean 3. There are various other differences, for example we used bundled categories ((C : Category) instead of (C : Type) [category C]), but I think that is a minor difference in practice.

About limits, I remember one trick which was neat, namely what we called a "sparse category". It's a special case of the free category, where you cannot compose any of the given morphisms. So basically it just adds identity morphisms. Instances include many of the "walking structures": like the shape of pullbacks, pushouts and (co)equalizers.

If you have more specific questions, I'm happy to answer them.

@javra
Copy link
Collaborator

javra commented Feb 5, 2019

I remember that some tricks we used are also mentioned in this paper by Gross, Chlipala, and Spivak. Especially making the the category definition symmetric (section 3.1 of the paper) was quite helpful.

@fpvandoorn
Copy link
Member

fpvandoorn commented Feb 5, 2019

Oh yes, that was useful to make (Cᵒᵖ)ᵒᵖ definitionally equal to C up to eta for records. So if C was of the form category.mk _ _ ... _ then (Cᵒᵖ)ᵒᵖ ≡ C. I think these tricks are unnecessary if you have definitional proof irrelevance, though.

@jcommelin
Copy link
Member

But we don't have eta for records...

@javra
Copy link
Collaborator

javra commented Feb 5, 2019

Not having eta for records prevents the trick from working in all cases, but it still does whenever the the category is an application of the constructor, which happens from time to time when you write the library.

I guess, as @fpvandoorn said, the benefits are much smaller than in HoTT, but it might still result in cleaner terms.

@semorrison
Copy link
Collaborator Author

I'm not sure of the consequence of formalabstracts incorporating this into their codebase. I'm still hopeful that we can merge this. I would like to be able to add more stuff to the category theory library, but I'm mostly stalled on this decision.

@fpvandoorn
Copy link
Member

fpvandoorn commented Feb 27, 2019

Once this PR is merged here we will remove it from our repository.

@semorrison
Copy link
Collaborator Author

Just rebased onto master; travis had been getting sad.

@semorrison
Copy link
Collaborator Author

Err... this PR seems to be stranded off on some strange repository leanprover-fork/mathlib-backup. I'm going to close and reopen a new one.

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.

None yet

5 participants