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

Rewrite rules for pushouts #1021

Merged
merged 33 commits into from
Apr 19, 2024
Merged

Conversation

fredrik-bakke
Copy link
Collaborator

@fredrik-bakke fredrik-bakke commented Feb 6, 2024

Adds strict β-laws for the standard pushouts in a new module synthetic-homotopy-theory.rewriting-pushouts.

Todo

@fredrik-bakke
Copy link
Collaborator Author

I just realized, If we add rewrite rules for the computation rules of the eliminator for pushouts, then we should be able to prove funext from the existence of the interval, thus maybe it will be possible to construct eq-htpy in such a way that eq-htpy refl ≐ refl-htpy...

@fredrik-bakke
Copy link
Collaborator Author

Okay, this PR is already blocked on #885. I'll just write my thoughts for the next steps here: To have the most reasonable definitions for the rewrite rules, it is quite important that cogap is definitionally both the left and right inverse of cocone-map, hence we should postulate up-pushout in terms of a version of universal-property-pushout using is-coherently-invertible.

@fredrik-bakke
Copy link
Collaborator Author

This PR reopens #515.

@fredrik-bakke
Copy link
Collaborator Author

As @EgbertRijke pointed out to me and I had completely forgotten, we should only implement rewrite rules for the point constructors. Here's the relevant justification from the HoTT/UF book:

image

@fredrik-bakke
Copy link
Collaborator Author

Just to remind my future self. It seems we may want to use primEraseEquality with our rewrite rules, so that the computation rules hold by reflexivity, as expected... I believe.

EgbertRijke pushed a commit that referenced this pull request Feb 19, 2024
I'm ~just~ adding ~a little~ some infrastructure about coherently
invertible maps ref. our discussions ~yesterday~ the other day. Don't
worry, I'm not starting a huge refactoring project.

Relevant to #946 and #1021.


### Summary
- Add mirror file about coherence squares of homotopies after coherence
squares of identifications
- Add some core files for more streamlined proofs in other core files.
- Refactor some proofs for coherently invertible maps
- `is-emb-is-equiv` was actually a proof about coherently invertible
maps
- slightly improve readability of
`is-coherently-invertible-is-invertible`
- Prove the following (and corollaries) without "coherent replacement":
  - a coherently invertible map is transpose coherently invertible
  - the inverse of a coherently invertible map is coherently invertible
  - composites of coherently invertible maps are coherently invertible
  - coherently invertible maps are closed under homotopies
@fredrik-bakke
Copy link
Collaborator Author

fredrik-bakke commented Apr 9, 2024

I just came across the following sources again today:

which reminded me that it should be possible to define pushouts in a way that computes on point constructors without using rewrites! This approach sounds preferable to me if we can be guaranteed that Agda does not leak any additional implementation details.

EDIT: Never mind, this is indeed inconsistent https://homotopytypetheory.org/2011/04/23/running-circles-around-in-your-proof-assistant/#comment-80163

@fredrik-bakke
Copy link
Collaborator Author

Good news! Agda does support adding rewrite rules in a separate file. This means that formalizations that use the rewrite rules for pushouts can live alongside formalizations that don't. The only limitation is that one cannot import formalizations that use rewriting without enabling rewriting, as expected.

@fredrik-bakke
Copy link
Collaborator Author

I'm opening this PR up to comments now. Note that the infrastructure for pushouts is not perfect. I'm hoping to improve it a bit over the next week with some additional refactoring.

@fredrik-bakke fredrik-bakke marked this pull request as ready for review April 17, 2024 10:17
@EgbertRijke
Copy link
Collaborator

Looks very good!

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.

Great job! I'd like to see what you have in mind to use these for. I would like to see a bit more docs on how to "enable rewriting for pushouts" though.

src/reflection/erasing-equality.lagda.md Outdated Show resolved Hide resolved
src/reflection/rewriting.lagda.md Outdated Show resolved Hide resolved
src/synthetic-homotopy-theory/cocones-under-spans.lagda.md Outdated Show resolved Hide resolved
src/synthetic-homotopy-theory/joins-of-types.lagda.md Outdated Show resolved Hide resolved
@VojtechStep VojtechStep merged commit 378ff01 into UniMath:master Apr 19, 2024
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