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

Added theorem Nat.bezout_comm. #11127

Merged
merged 1 commit into from
Dec 6, 2019
Merged

Added theorem Nat.bezout_comm. #11127

merged 1 commit into from
Dec 6, 2019

Conversation

roglo
Copy link
Contributor

@roglo roglo commented Nov 15, 2019

In natural numbers, since there are no negatives, Bézout is either ∃ u v, au=bv+1 or ∃ u v, bv=au+1. Two cases are considered in Nat.gcd_bezout. But they are actually the same. The first case is equivalent to the second case (with different pairs (u, v)), providing a≠0 and b≠0. The new theorem Nat.bezout_com transforms one case to the other one.

@roglo roglo requested a review from herbelin as a code owner November 15, 2019 07:02
@Zimmi48 Zimmi48 added kind: feature New user-facing feature request or implementation. part: standard library The standard library stdlib. labels Nov 15, 2019
Copy link
Member

@herbelin herbelin left a comment

Choose a reason for hiding this comment

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

That's an interesting property!

Concerning the integration to the library, would the proof have to be reworked a lot so that it can be done in file NGcd.v and thus automatically exported to all implementations of natural numbers? Then Ngcd.gcd_bezout could take benefit of the new commutativity lemma to be a one-line proof.

@roglo
Copy link
Contributor Author

roglo commented Nov 15, 2019

I first tried to put it in Ngcd.v but there was a problem with eq_dec (not accessible) and especially mul_max_distr_r that I was unable to access too, even with Require Import NMaxMin. I tried to locally copy its code. Failed again: the proof of mul_max_distr_r uses things which uses other things, and so on. Too complicated.

@roglo
Copy link
Contributor Author

roglo commented Nov 17, 2019

Bon, je l'ai mis dans NGcd.v. J'ai compris qu'il fallait que j'Include NMaxMinProp A. Du coup, mul_max_distr_r passe, mais ça bloque maintenant sur le_max_r Et là, c'est plus compliqué, il va falloir que tu m'aides.

@roglo
Copy link
Contributor Author

roglo commented Nov 19, 2019

This should be good now.

@Zimmi48 Zimmi48 added the needs: changelog entry This should be documented in doc/changelog. label Dec 2, 2019
@herbelin
Copy link
Member

herbelin commented Dec 3, 2019

Thanks for bullets. That's true that it makes the indentation slowly sliding to the right. Anyway, let's keep it like this. Thanks a lot. I'll merge it tomorrow.

@herbelin herbelin self-assigned this Dec 3, 2019
@Zimmi48 Zimmi48 added the needs: squashing Some commits should be squashed together. label Dec 3, 2019
@herbelin
Copy link
Member

herbelin commented Dec 3, 2019

PS: Please also squash and add a changelog entry as noticed by @Zimmi48 (use dev/tools/make-changelog.sh, give PR number 11127, "10", edit the new file, git add, commit).

@roglo roglo requested a review from a team as a code owner December 4, 2019 10:26
@Zimmi48 Zimmi48 removed the needs: changelog entry This should be documented in doc/changelog. label Dec 4, 2019
@Zimmi48 Zimmi48 added this to the 8.12+beta1 milestone Dec 4, 2019
@herbelin
Copy link
Member

herbelin commented Dec 4, 2019

@Zimmi48: do you have further remarks or can I merge?

@Zimmi48
Copy link
Member

Zimmi48 commented Dec 5, 2019

Well, this PR still contains 6 commits instead of just one or two. I can show Daniel how to squash when I get the chance to see him (not today).

@roglo
Copy link
Contributor Author

roglo commented Dec 5, 2019

Well, this PR still contains 6 commits instead of just one or two. I can show Daniel how to squash when I get the chance to see him (not today).

I just made it, thanks to @herbelin

@Zimmi48 Zimmi48 removed the needs: squashing Some commits should be squashed together. label Dec 5, 2019
herbelin added a commit that referenced this pull request Dec 6, 2019
Ack-by: Zimmi48
Ack-by: herbelin
@herbelin herbelin merged commit ff4fd94 into coq:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New user-facing feature request or implementation. part: standard library The standard library stdlib.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants