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

N forms a semiring #47

Merged
merged 4 commits into from
Jul 3, 2023
Merged

N forms a semiring #47

merged 4 commits into from
Jul 3, 2023

Conversation

pi8027
Copy link
Member

@pi8027 pi8027 commented Jun 8, 2023

I was trying to add a proper support for semirings in Algebra Tactics (on top of math-comp/algebra-tactics#71), and then found that this semiring instance would be useful for that.

I also wanted to add morphism instances for nat_of_bin and bin_of_nat, but it requires math-comp/math-comp#1031. Maybe I can just copy instances for nat from math-comp/math-comp#1031 to here.


#[export]
HB.instance Definition _ := GRing.Nmodule_isComSemiRing.Build N
Nmult_assoc Nmult_comm Nmult_1_l Nmult_plus_distr_r N.mul_0_l isT.
Copy link
Member Author

@pi8027 pi8027 Jun 8, 2023

Choose a reason for hiding this comment

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

Just a remark: The commutative ring instance for Z below uses Zmult_plus_distr_*l* but here I use Nmult_plus_distr_*r*. Naming inconsistency in the Coq standard library :/

theories/ssrZ.v Outdated Show resolved Hide resolved
@proux01
Copy link
Contributor

proux01 commented Jun 9, 2023

Could you add examples to test the new instances?

@pi8027
Copy link
Member Author

pi8027 commented Jun 9, 2023

Will do.

@pi8027 pi8027 merged commit d79c36c into master Jul 3, 2023
@pi8027 pi8027 deleted the N-semiring branch July 3, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants