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

Refactoring of retractions, sections, and equivalences, and adding the 6-for-2 property of equivalences #903

Merged
merged 34 commits into from
Nov 9, 2023

Conversation

EgbertRijke
Copy link
Collaborator

@EgbertRijke EgbertRijke commented Nov 6, 2023

  • Some cleanup of the commuting-triangles-of-maps file. I moved the commuting triangles induced by sections and retractions here, and moved the action of precomposition on commuting traingles to functoriality-of-function-types
  • A total cleanup of foundation-core.equivalences. One of the ways I cleaned up was by writing a bit more infrastructure for sections and retractions. This made the long names obsolete, because now the projections are named. This is also a general case I would like to make against long variable names: If you write proper infrastructure then you don't need long variable names, plus it will be a lot easier to maintain your naming scheme and not float off course with it.
  • The foundation-core.equivalences file now contains much more explanations.
  • I introduced a new naming scheme for proving that certain maps in commuting triangles have certain properties. Previously we had parts of names like left-factor-htpy, which was supposed to mean the left factor up to homotopy. However, I think it is clearer if we mention triangle in such names, and name the map in the triangle that is the subject of the assertion. Note that diagrammatic ordering is usually the opposite of the compositional ordering, so left-factor-htpy got replaced by right-map-triangle. Similarly, I replaced comp-htpy by left-map-triangle and right-factor-htpy by top-map-triangle. This change triggered a lot of changes throughout the library.
  • I added names for the projections out of the fiber of a map. We failed to do so previously, and it lead to clumsy formalization in some places. There are probably other places in the library where we could use those names, but I didn't go look for them as it would trigger another lot of changes throughout many files.
  • In retractions I added a predicate for is-retraction, for obvious reasons
  • In sections I added a predicate for is-section. In both cases I could have gone through the library and implement this predicate throughout. I didn't do so, but I could potentially do that in a subsequent pull request (not this one).
  • I factored out retracts-of-types from retractions, because it is a separate concept from the concept of a retraction of a map, even though it is of course closely related. One thing I did in this file was introduce a non-infix notation for retracts of types. We usually have some non-infix notation for infix operators that indicate how to use statements involving that operator in a naming scheme. Writing retract-of in names quickly looks very awkward, so I improved that to retract using this setup.
  • I moved the file retracts-of-maps from orthogonal-factorization-systems to foundation, so that it can be next to retracts-of-types
  • I worked the new infrastructure into the file retracts-of-maps, but that triggered lots of changes throughout that file. I ended up renaming quite a lot of things, and I hope that is ok. One of the thing I fixed was that the word section was used in names, but no element of section _ was constructed or involved. I also replaced retract-of-map with retract-map to not have to write of so often. Prepositions are not very common in our naming scheme, and I think our naming scheme is better when we use them very sparingly.

Copy link
Collaborator

@VojtechStep VojtechStep left a comment

Choose a reason for hiding this comment

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

I'm leaving a partial review for now. So far I like the changes, especially the renaming of 3-for-2 up to homotopies, I could never remember which one is which 👌

src/foundation-core/commuting-triangles-of-maps.lagda.md Outdated Show resolved Hide resolved
src/foundation-core/equivalences.lagda.md Outdated Show resolved Hide resolved
src/foundation/equivalences.lagda.md Show resolved Hide resolved
@fredrik-bakke
Copy link
Collaborator

Thanks for fixing up the retracts-of-maps file for me! (I only reviewed that one for now)

@EgbertRijke
Copy link
Collaborator Author

I made some simplifications to the proof that retracts of equivalences are equivalences. In particular, I avoided all explicit constructions of homotopies, since they were all consequences of things that were already constructed in the library.

@fredrik-bakke
Copy link
Collaborator

Thanks for simplifying the proofs! It originally went from an observation that the higher coherence assumed in the HoTT-UF book wasn't needed to what I submitted in my previous PR, so in the end I didn't consider looking for an even simpler proof. I'm glad you still kept them around though, as I think they're still instructive to have there

@EgbertRijke
Copy link
Collaborator Author

I think it is exactly the same proof as the one you gave, except it is packaged up in terms of earlier constructions in the library. I probably wouldn't have thought of it if you hadn't already simplified the proof.

Now I would still like to think about that identification that you earlier marked abstract. It would be nice to have an informal explanation of that construction, because it is hard to understand just by looking at the code.

@fredrik-bakke
Copy link
Collaborator

Oh, you un-abstracted it.

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Nov 6, 2023

Yeah, it's not very conceptual. The first half reasons using homotopies and the last half using identifications. There's another proof in HoTT-UF, but I decided to just brute force it.

@EgbertRijke
Copy link
Collaborator Author

Yeah, it's not very conceptual. The first half reasons using homotopies and the last half using identifications. There's another proof in HoTT-UF, but I decided to just brute force it.

I'll clean it up for you

@fredrik-bakke
Copy link
Collaborator

Yeah, it's not very conceptual. The first half reasons using homotopies and the last half using identifications. There's another proof in HoTT-UF, but I decided to just brute force it.

I'll clean it up for you

Under usual conditions, I would be more than happy to clean up my own mess as well given the feedback, although I also appreciate what you're doing!

@fredrik-bakke
Copy link
Collaborator

Is this PR closing completion? I was hoping to do a few more things with retracts of maps.

@EgbertRijke
Copy link
Collaborator Author

I'll try to complete it asap. But things are not done in sufficiently functorial manner, so I'm adding for example morphisms of arrows to make this possible.

@fredrik-bakke
Copy link
Collaborator

As agreed with Egbert, I will review and then merge this PR now. So if anyone else wants to give more input, now is your chance.

Copy link
Collaborator

@fredrik-bakke fredrik-bakke left a comment

Choose a reason for hiding this comment

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

Awesome work, Egbert! Thanks for doing all this

src/foundation-core/commuting-triangles-of-maps.lagda.md Outdated Show resolved Hide resolved
src/foundation-core/commuting-triangles-of-maps.lagda.md Outdated Show resolved Hide resolved
src/foundation-core/equivalences.lagda.md Outdated Show resolved Hide resolved
src/foundation-core/pullbacks.lagda.md Outdated Show resolved Hide resolved
src/foundation-core/retractions.lagda.md Outdated Show resolved Hide resolved
src/foundation/morphisms-arrows.lagda.md Show resolved Hide resolved
src/foundation/retracts-of-maps.lagda.md Show resolved Hide resolved
src/foundation/retracts-of-maps.lagda.md Outdated Show resolved Hide resolved
src/foundation/retracts-of-maps.lagda.md Outdated Show resolved Hide resolved
@fredrik-bakke fredrik-bakke enabled auto-merge (squash) November 9, 2023 12:43
@fredrik-bakke
Copy link
Collaborator

I don't know if you intended to, but I noticed you didn't include the explanation of the terminology "6-for-2" as you did for "3-for-2".

@fredrik-bakke fredrik-bakke merged commit 85f9582 into UniMath:master Nov 9, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants