SelfInverse operations on Algebras and their properties
#1914
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reviewing my contribution of
Data.Parityand friends, I found myself annoyed about repeated proofs of properties of the self-inverse functions_⁻¹and correspondingoppositeonData.Sign...... and was surprised that being
SelfInversedidn't seem to be in either theFunctionorAlgebrahierarchies.Now, with this PR, I've chosen to put these things in the
Algebrahierarchy, because that is whereInvolutiveis 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 theConsequences.Setoidfor self-inverse operations are really about their behaviour asFunctions... 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 correspondingAlgebrastructure, then they belong underAlgebra.It's not obvious to me that we systematically observe such distinctions. One thing that does jump out, cf. issue #1544, is that
Algebra.DefinitionsdefinesCongruent₁andCongruent₂, whileFunction.DefinitionsdefinesCongruent, so (t)here's another failure of systematisation: ... I prove that self-inverse operations areCongruent, rather thanCongruent₁... but which should I have done?TODODONE: refactor to use the new definitions/proofsData.Sign.PropertiesData.Parity.Properties