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

Data.Parity and the 2+_ pattern #1851

Closed
9 of 10 tasks
jamesmckinna opened this issue Oct 20, 2022 · 0 comments · Fixed by #1852
Closed
9 of 10 tasks

Data.Parity and the 2+_ pattern #1851

jamesmckinna opened this issue Oct 20, 2022 · 0 comments · Fixed by #1852

Comments

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Oct 20, 2022

@Taneb 's recent work (#1744 , #1744) on permutations-as-transposition-lists has drawn attention to the (possible) need for a Parity type (rather than proxying via Data.Sign), together with various properties: so far I have a branch with
UPDATED:

  • Parity admits a commutative semiring structure (with 0 = 0ℙ; 1 = 1ℙ etc.)
  • a function parity from Nat to Parity in Data.Nat.Base
  • a function toSign from Parity to Sign
  • a function fromSign from Sign to Parity
  • proofs that (toSign, fromSign) form an abelian group iso from (Parity, 0, _+_) to (Sign, +, _*_)
  • miscellaneous tidyings up of Data.Sign etc. to reflect new names for algebraic structures/bundles, cf. issue Data.Integer.Properties.+-isAbelianGroup should be called +-0-isAbelianGroup #1844 and in line with review comments on current PR
  • CHANGELOG

TODO in a subsequent PR:

  • proof that parity is a commutative semiring homomorphism from Nat to Parity
  • rationalise that proof; and in particular resolve where it belongs

Additionally, this might have the following as knock-on effects:

EDITED:
It raised a question in my mind as well regarding where homomorphism-like properties belong in the library: under the source type, in *.Properties, or somewhere else? I currently have Parity import Sign in order to define the operations, but it strikes me that there's an asymmetry to that decision, which might better be reflected in having subdirectories of the Algebra.* hierarchy which record concrete instances of (Semi)RingHomomorphisms etc. suggestions welcome! moved discussion to issue #1871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant