-
Notifications
You must be signed in to change notification settings - Fork 640
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
Generalize exp_ineq1 and add exp_ineq1_le, which holds forall Reals. #13582
Conversation
Note that you can use Also, this addition to the standard library, as any addition, will need a changelog entry. See https://github.com/coq/coq/tree/master/doc/changelog#how-to-add-an-entry |
206a520
to
f40ad34
Compare
Thank 🧒
…On Sun, 6 Dec 2020, 16:45 Laurent Théry, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In theories/Reals/Rpower.v
<#13582 (comment)>:
> @@ -233,6 +233,44 @@ Proof.
apply H.
Qed.
+Lemma exp_gt1 (x : R) : 0 < x -> 1 < exp x.
+Proof.
+ intro xgt.
+ generalize (exp_ineq1 x xgt); intros.
+ apply Rlt_trans with (r2 := 1+x); lra.
+Qed.
+
+Lemma exp_ineq2 (x : R) : 0 > x -> 1 + x < exp x.
Maybe we should only have exp_ineq1 be :
Lemma exp_ineq1 (x : R) : x <> 0 -> 1 + x < exp x.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13582 (review)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARDLQ5OWAU3W5K562WN3PZTSTOYI7ANCNFSM4UO76WNQ>
.
|
should I update the PR as suggested above? Note that I believe it would be a (minorly) breaking change (hence the original proposal). |
|
1ffa4f9
to
67a065b
Compare
It turns out that there is one external project among the ones we test in CI that was using this lemma (https://gitlab.inria.fr/coquelicot/coquelicot/-/blob/master/theories/ElemFct.v#L604). Since his maintainer is also a maintainer of the real library, let's ping him here (@silene). What are the paths to making a backward-compatible fix for this project possible? A Note that in the current state of this PR (as opposed to the initial state), the type of changelog entry should be Changed instead of Added. |
9ee9784
to
646759d
Compare
Looks like @silene could use the new |
Maybe we could get rid of the
|
@thery updated. Given that the current form of the proof is yours, should I include some form of attribution in the commit message? If so, what? |
One way is to put a "with help from" or "with review of Laurent Théry" in the changelog entry. |
The original (which holds only for positive numbers) is now called exp_ineq1_pos. A version that holds only for negative numbers is added as exp_ineq1_neg. Adds exp_ineq1_le, which holds for all reals (but is a <= instead of a <). Co-authored-by: Barry M. Trager <bmt@us.ibm.com>
@shinnar the proof is yours I have just reshaped it. |
fine with me, thanks for your contribution! |
ok the overlay is in coquelicot #4, so we can merge |
@coqbot: merge now |
@thery: You can't merge the PR because you're not among the assignees. |
@coqbot: merge now |
|
||
(`#13582 <https://github.com/coq/coq/pull/13582>`_, | ||
by Avi Shinnar and Barry Trager, with help from Laurent Théry | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The white line an final parenthesis seem to generate errors when adding new changelogs after this one (see for example CI errors in #13671 ).
If I am right and since this is already merged, what is the best way to make a modification? create an adhoc new PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right about the diagnosis. You can either open an ad hoc PR or fix it in your own PR, especially if your own PR shouldn't take too long to merge.
Adds exp_ineq2, the negative counterpart to exp_ineq1.
Adds exp_ineq, which holds for all reals (but is a <= instead of a <).
Rpower currently defines exp_ineq1 : forall x:R, 0 < x -> 1 + x < exp x.
This PR adds the corresponding lemma for negative R: exp_ineq2 : forall x:R, 0 > x -> 1 + x < exp x
and the (slightly weaker) version for all R: exp_ineq : forall x:R, 1 + x <= exp x
These minor additions are nice to add for completeness, and are useful for users.
This proof was mostly done by Barry Trager (@bmtrager), and is being submitted with his permission (and at his request).
Kind: documentation / bug fix / feature / performance / infrastructure.
library addition / minor feature
Fixes / closes #????