SelfInverse
operations on Algebra
s 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.Parity
and friends, I found myself annoyed about repeated proofs of properties of the self-inverse functions_⁻¹
and correspondingopposite
onData.Sign
...... and was surprised that being
SelfInverse
didn't seem to be in either theFunction
orAlgebra
hierarchies.Now, with this PR, I've chosen to put these things in the
Algebra
hierarchy, because that is whereInvolutive
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 theConsequences.Setoid
for self-inverse operations are really about their behaviour asFunction
s... 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 correspondingAlgebra
structure, 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.Definitions
definesCongruent₁
andCongruent₂
, whileFunction.Definitions
definesCongruent
, 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.Properties
Data.Parity.Properties