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

SelfInverse operations on Algebras and their properties #1914

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

jamesmckinna
Copy link
Contributor

@jamesmckinna jamesmckinna commented Jan 24, 2023

Reviewing my contribution of Data.Parity and friends, I found myself annoyed about repeated proofs of properties of the self-inverse functions _⁻¹ and corresponding opposite on Data.Sign...
... and was surprised that being SelfInverse didn't seem to be in either the Function or Algebra hierarchies.

Now, with this PR, I've chosen to put these things in the Algebra hierarchy, because that is where Involutive is defined, and self-inverse operations are involutive in the presence of reflexivity (one of the properties I needed/used/defined).

But it seems that I could have put these definitions under Function, and certainly some of the Consequences.Setoid for self-inverse operations are really about their behaviour as Functions... so some advice on where these properties should properly go would be welcome.

An argument I am open to is that, qua functions, they belong under Function; but as operations which are automorphisms of the corresponding Algebra structure, then they belong under Algebra.

It's not obvious to me that we systematically observe such distinctions. One thing that does jump out, cf. issue #1544, is that Algebra.Definitions defines Congruent₁ and Congruent₂, while Function.Definitions defines Congruent, so (t)here's another failure of systematisation: ... I prove that self-inverse operations are Congruent, rather than Congruent₁... but which should I have done?

TODODONE: refactor to use the new definitions/proofs

  • Data.Sign.Properties
  • Data.Parity.Properties

@jamesmckinna jamesmckinna mentioned this pull request Jan 24, 2023
@jamesmckinna
Copy link
Contributor Author

PR #1156 (and perhaps an ounce more work) would streamline the (construction and proof of the) iso between Sign and Parity, currently done by hand in Data.Parity.Properties; it might also thereby streamline entirely (?) the treatment of self-inverse operations undertaken in the PR at hand.

Copy link
Contributor

@MatthewDaggitt MatthewDaggitt left a comment

Choose a reason for hiding this comment

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

Other than that it looks good to me. I have no strong feelings about the Function vs Algebra distinction. I think it's fine here for the moment.

@jamesmckinna jamesmckinna changed the title self-inverse operations on Algebras and their properties SelfInverse operations on Algebras and their properties Feb 3, 2023
@MatthewDaggitt MatthewDaggitt merged commit 3462b98 into agda:master Feb 28, 2023
@jamesmckinna jamesmckinna deleted the self-inverse branch April 18, 2023 17:20
@andreasabel andreasabel mentioned this pull request Aug 27, 2023
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