Skip to content

[ refactor ] proofs under Data.List.Membership.*.Properties #2545

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

Closed
wants to merge 7 commits into from

Conversation

jamesmckinna
Copy link
Contributor

@jamesmckinna jamesmckinna commented Jan 12, 2025

This fixes the low-hanging-fruit item under issue #2542 concerning the switch to a postfix definition of:
_∉[] : (x : A) → x ∉ [] in each of

  • Data.List.Membership.Setoid.Properties
  • Data.List.Membership.Propositional.Properties.Core

Additionally:

  • cleans up imports: resp rather than its equivalent subst;
  • refactors to remove all uses of rewrite in the second module above, in the spirit of recent discussions.

UPDATED:

  • most recent (knock-on) commit exposes a slight wrinkle in the parameterisation: use here of the lemma, instantiated to Setoid S arises there as (S Membershipₚ.∉[]) _ which looks... not quite right wrt the original problem (and removing parentheses causes a parse error!) but tweaked now to look a bit more reasonable?

@MatthewDaggitt
Copy link
Contributor

Thanks @jamesmckinna !

@MatthewDaggitt MatthewDaggitt added this pull request to the merge queue Jan 14, 2025
@MatthewDaggitt MatthewDaggitt removed this pull request from the merge queue due to a manual request Jan 14, 2025
@MatthewDaggitt
Copy link
Contributor

MatthewDaggitt commented Jan 14, 2025

most recent (knock-on) commit exposes a slight wrinkle in the parameterisation: use here of the lemma, instantiated to Setoid S arises there as (S Membershipₚ.∉[]) _ which looks... not quite right wrt the original problem (and removing parentheses causes a parse error!) but tweaked now to look a bit more reasonable?

This has just sunk in. Yes, this is why we don't use misfix proofs as a rule, because complex module parameterisations often screw them over, and the contents of the modules should be usable regardless of whether the module parameters are provided or not.

I'd vote for staying with the current policy of not using misfix for proofs therefore (and codifying it in the style guide?).... Sorry, this is my fault, I knew this many years ago, but no longer.

@jamesmckinna
Copy link
Contributor Author

Thanks for the careful consideration @MatthewDaggitt !

So... I'll revert the controversial commits, but cherry-pick the equational refactorings as useful in their own right?

…ewrite`"

This reverts commit 61f31a7.

Following discussion on the PR
@jamesmckinna
Copy link
Contributor Author

jamesmckinna commented Jan 14, 2025

Ugh... that didn't seem to work, sigh, because I hadn't been fine-grained enough about this, or had but reverted too much, yuk.

@jamesmckinna
Copy link
Contributor Author

Nope. Closing in frustration!

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.

2 participants