More Archimedean lemmas#1510
Conversation
|
MCA still uses Definition bound (x : R) := (truncn `|x|).+1. |
f0fac3a to
24c11d8
Compare
24c11d8 to
934a425
Compare
934a425 to
2188e06
Compare
|
Rebased. I will take a fresh look at the PR and fix the naming issue this afternoon. |
2188e06 to
84df4f1
Compare
| (* TODO1: rename to real_eq_floor? *) | ||
| (* TODO2: add a general version using to_real, and derive (to_)real_floor_itvP from it *) | ||
| Lemma real_floor_eq x n : x \is real_num -> | ||
| (floor x == n) = (n%:~R <= x < (n + 1)%:~R). | ||
| Proof. by move=> ?; apply/eqP/real_floor_itvP. Qed. | ||
|
|
||
| (* TODO: rename? *) | ||
| Lemma floor_def x n : n%:~R <= x < (n + 1)%:~R -> floor x = n. |
There was a problem hiding this comment.
Any opinion on the renaming of these lemmas? I think real_floor_eq should be called something like real_eq_floor or real_eq_floor_itv, cf., meet_idPl and eq_meetl.
There was a problem hiding this comment.
IMO, floor_def is almost the definition of floor, but only for the case where x \is real_num.
There was a problem hiding this comment.
and floor_default: x \isn't real_num -> floor x = 0
There was a problem hiding this comment.
@CohenCyril Am I right that your suggestion was to rename (real_)floor_eq to (real_)eq_floor and then rename floor_def to floor_eq? (We can do the latter renaming only after releasing MC 2.7.)
There was a problem hiding this comment.
And I prefer to add floor_default in a subsequent PR.
84df4f1 to
16f0e30
Compare
|
@CohenCyril @affeldt-aist @proux01 @hoheinzollern While this PR is far from ready, I think I have done almost everything I can. Since this PR addresses the issue you reported (#1377) or implements the solution you proposed (#1377 (comment)), your input is necessary at this point. |
16f0e30 to
8bc40dc
Compare
2401b4f to
5677272
Compare
5677272 to
56f1f2e
Compare
56f1f2e to
35d1b4f
Compare
pi8027
left a comment
There was a problem hiding this comment.
I made some progress. I isolated the renaming of existing lemmas into the first commit. We can consider merging it first.
5c2589f to
fc46e67
Compare
fc46e67 to
b2f972b
Compare
pi8027
left a comment
There was a problem hiding this comment.
I think this PR is ready for another round of review. Currently, the first commit does all the renamings of existing lemmas, and the second commit does the other changes. Perhaps the former part can be merged quickly. (If it is the case, I will split the PR.)
b2f972b to
9195dc8
Compare
|
@CohenCyril @affeldt-aist @proux01 @hoheinzollern This PR is waiting for review. |
|
I'll do it but this may take me a bit of time to get to it. |
200e30b to
b504f5d
Compare
|
@affeldt-aist FYI, this PR breaks infotheo. However, I won't fix it. |
| Lemma ceilNfloor x : ceil x = - floor (- x). | ||
| Proof. exact: ceil_subproof. Qed. | ||
|
|
||
| Lemma truncEfloor x : truncn x = if floor x is Posz n then n else 0. |
There was a problem hiding this comment.
Shouldn't you write:
if 0 <= x then `|floor x|%N else 0%N;
like in truncn_subproof
| Lemma truncn_floor x : truncn x = if 0 <= x then `|floor x|%N else 0%N. | ||
| Proof. exact: truncn_subproof. Qed. | ||
|
|
||
| Lemma truncEfloor x : truncn x = if floor x is Posz n then n else 0. |
There was a problem hiding this comment.
Note that this lemma already exists in the master branch. I moved the lemma, but the statement is unchanged. Changing it would require deprecation.
There was a problem hiding this comment.
And, since this PR has been open for 6 months, I would rather do the suggested change in another PR.
hoheinzollern
left a comment
There was a problem hiding this comment.
Apart from the open comments, the PR looks good to me.
|
Of course, it needed rebase (now done) and docs. |
|
I added changelog entries. @CohenCyril @proux01 Could you double-check and merge this PR after the release of MC 2.6? It targets MC 2.7, and I won't change it to 2.6. (I'm against to merge any PR in a rush before a release.) |
Motivation for this change
This PR adds some lemmas for
archiNumDomainTypeandarchiRealDomainTypeusingto_real(alsoto_nneg) suggested by @CohenCyril (cf. #1377 (comment)).Most of these lemmas for
floorandceilgeneralize existing lemmas requiring theNum.realcondition on a variable. Since the names of these lemmas have the prefixreal_, the names of their general versions replace it withto_real_for the moment. Similarly, some of the new lemmas fortruncnhave the prefixto_nneg_. (We probably need to think a bit more about the naming convention here.)In the end, I didn't find
floorP,ceilP, andtruncnPstated usingspecdatatypes very useful (cf. #1377 (comment)). I keep their statements as comments for the moment.I suggest extensively testing the new lemmas in MCA before merging this PR.
(Eventually) Fix #1377
Dependencies
archimedean.v#1526Minimal TODO list
doc/changelog/make-entry.shSee this Checklist for details.
Automatic note to reviewers
Read this Checklist.