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

[ refactor ] fixes #2568; proves full symmetry for Bijection #2569

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

jamesmckinna
Copy link
Contributor

@jamesmckinna jamesmckinna commented Jan 28, 2025

A comprehensive overhaul building on the proposed refactoring in #2568 . Finally finished, I think!

UPDATED: now all 'done', and a lot tighter/smoother/cleaner

  • refactor Function.Consequences? (check implicit/explicit bindings of lemmas there, esp. in their use later)
  • BUT: full symmetry for Bijection now proved, old weaker form sym-≡ etc. now deprecated (this was a bug!)
  • AND can prove Congruent ≈₂ ≈₁ section outright under similar equational assumptions!
  • HENCE: in Function.Construct.Symmetry
    • indeed, can remove hypothesis of Congruent ≈₁ ≈₂ f from {injective|bijective}
    • hence, symmetry of IsBijective, and of Bijection, without detour via Inverse

TODO:

  • CHANGELOG
  • refactor Function.Construct.Symmetry Function.Properties.Bijection to prove full symmetry of IsBijective etc.

NB.

  • the deprecations considered in [ DRY ] Refactor Function.* to rationalise the existence of a section to a given Surjective f #2568 are optional, it's more a case of agreeing the 'right' names; existing commits make the change so as to highlight where the work has happened
  • the other changes above do necessitate deprecations, of the former, weaker (!), proofs
  • these are badged as v2.3 deprecations in favour of *WithoutCongruence constructions, but a v3.0 cleanup PR would remove the old proofs entirely and rename to remove that suffix
  • not entirely sure I've quite got the deprecation messages correct, given how gnarly the refactoring has been.... it's typically not a straightforward like-for-like deprecation, because the types have changed
  • likewise, there may still be one or two outstanding DRY opportunities for further refactoring, but downstream!

@jamesmckinna jamesmckinna changed the title [ refactor ] fixes #2568 [ refactor ] fixes #2568; proves symmetry for Bijection Jan 29, 2025
@jamesmckinna jamesmckinna marked this pull request as ready for review January 29, 2025 16:24
@jamesmckinna jamesmckinna added this to the v2.3 milestone Jan 29, 2025
@jamesmckinna jamesmckinna changed the title [ refactor ] fixes #2568; proves symmetry for Bijection [ refactor ] fixes #2568; proves full symmetry for Bijection Jan 29, 2025
@jamesmckinna jamesmckinna marked this pull request as ready for review January 30, 2025 14:15
@jamesmckinna
Copy link
Contributor Author

jamesmckinna commented Jan 30, 2025

Ooops! Need to fix the version number in deprecation warnings. Will fix tomorrow.

Comment on lines +122 to +123
section : B → A
section = proj₁ ∘ surj
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I now think that the only conceivable change I might make would be to call this from rather than section:

  • pro from : consistency with usage elsewhere as the counterpart to to
  • con from : possible clash of names if scopes are opened carelessly?
  • pro section: name standardised apart from others; standard (category-theoretic) nomenclature
  • con section: too occult a name wrt the rest of the library?

CHANGELOG.md Outdated
Comment on lines 149 to 152
* In `Function.Consequences`: the theory of the left inverse of a surjective function
```agda
module Section (surj : Surjective ≈₁ ≈₂ f)
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should this module be lifted out from Consequences to the top-level of Function.*? Or somewhere else?

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.

1 participant