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 ] Functoriality of Data.List.Relation.Binary.Sublist|Subset wrt All and Any #2525

Open
jamesmckinna opened this issue Dec 18, 2024 · 4 comments

Comments

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Dec 18, 2024

Should this be a corollary of something about All P xs implies All P ys whenever ys is a subset of xs?

Indeed, and this appears twice in the library:

  • Data.List.Relation.Unary.All.Properties.anti-mono : xs Subset.⊆ ys → All P ys → All P xs (and Sublist is a stronger property than Subset)
  • Data.List.Relation.Binary.Sublist.Propositional.Properties.All-resp-⊆ : {P : Pred A ℓ} → (All P) Respects _⊇_ and this should (added: perhaps?) be refactored to a proof in ...Sublist.Setoid.Properties, under assumptions that P respects the underlying Setoid equality?

Originally posted by @jamesmckinna in #2522 (comment)

@MatthewDaggitt
Copy link
Contributor

Eek that's not ideal that it appears twice 😓

My instincts say that it should live under Sublist...

@jamesmckinna
Copy link
Contributor Author

My instincts say that it should live under Sublist...

As would mine, except for the fact that the Sublist versions morally should delegate to the Subset versions via Sublist⇒Subset? But then we have the problem that this lemma is under ...Subset.Setoid.Properties... sigh!?

@MatthewDaggitt
Copy link
Contributor

As would mine, except for the fact that the Sublist versions morally should delegate to the Subset versions via Sublist⇒Subset?

Err, that's not a principle that any of the existing code has been designed around. It might be possible to do but it would involve a wholesale refactoring of the Sublist modules I suspect.

@JacquesCarette
Copy link
Contributor

JacquesCarette commented Dec 28, 2024

(There's quite a bit of discussion in #2522 that is relevant.)

This is a much more general design issue: should we prove things directly or as special cases of more general results? That's probably the real discussion to be having. I'm fairly sure that has come up before! There are pros and cons, and my opinion on that has changed (evolved?) multiple times over the years.

@agda agda deleted a comment from JacquesCarette Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants