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
Rework of PR #281: Archimedean structures on top of num/real domain/field/closedField #682
Conversation
It seems that group notations and ring notations are mixed almost everywhere in Arguments fun_of_cfun [gT] [B] _ _%g. |
I guess |
Yes! And |
And they should be in the mixin, so as to make the computations for |
Make sense. Allowing the use of |
@CohenCyril Could you confirm this is what you mean? (* Module ArchiNumDomain. *)
Record mixin_of (R : numDomainType) := Mixin {
trunc : R -> nat;
is_nat : pred R;
is_int : pred R;
_ : forall x, 0 <= x -> (trunc x)%:R <= x < (trunc x).+1%:R;
_ : forall x, is_nat x = ((trunc x)%:R == x);
_ : forall x, is_int x = is_nat x || is_nat (- x);
}. |
Yes roughly, except the truncation has no reason to be only for non negative numbers, I would prefer the function in the mixin to be more general, knowing that there could be a factory providing opaque I had planned to wait for HB to make this kind of changes... I am a bit surprised you are willing to go through so much work while we intend to trivialize all of this... |
The problem is that we have to relocate the basic part of
Reworking an existing branch is easier to do now rather than later. Also, IMO actual difficulties appear in places other than the definitions of structures, as in the breakage of |
7dcf27f
to
9105450
Compare
|
74f45f7
to
e465294
Compare
Almost done except that |
Here is a summary of possible solutions:
|
Yet another solution: dispatching the contents of ssrint between ssralg and ssrnum. |
@CohenCyril That is what I meant in solution 3 IIUC. |
Indeed. It was not clear to me whether you were suggesting to remove the file ssrint, which is what I suggest here. |
Anyway, I like solution 4... it makes a lot of sense to me. How would you envision the transitiom though? Having files with new names required by files with old names? |
I did not suggest removing
In the first step, we try to relocate definitions and lemmas about the Archimedean structures as much as possible, to a new file, say |
BTW, why CI disappeared from the checklist here? |
no idea, that's very strange |
This is now fixed (cf #706 (comment)). In principle, if you rebased this PR for example, github would show the status of the CI. Although I believe with the ongoing stuff on HB it would not make sense to rebase it. Just so you know |
6b3153e
to
e1b688f
Compare
@pi8027 @CohenCyril now that 2.0 is out, I rebased this and CI is green. I'd like to merge by the end of the week if there is no more comments (I'll open an issue to remember the above points about |
The remaining comments will be addressed in #1030 depending on this. |
No more comments apparently so I'll merge on Friday. |
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.
Just a few remarks befor we merge.
mathcomp/algebra/ssrnum.v
Outdated
Definition Rnat : qualifier 1 R := [qualify a x : R | is_nat x]. | ||
Definition Rint : qualifier 1 R := [qualify a x : R | is_int x]. |
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 R
in Rnat
and Rint
does not respect any existing convention. It should either be documented or renamed.
I am in favor of naming them nat_num
and int_num
inside this file, and then nat
and int
directly so that they can be used through Num.nat
and Num.int
later on.
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.
Done, I thus renamed "Rnat" in lemma names to "nat" or "natr". This yields a few conflicts with "natr" already used for %:R
which I solved using a few "nat_num". This is not perfect but I think it's acceptable.
Also note that we already had Rpos
, Rneg
and Rreal
which should probably be deprecated/renamed pos_num
, neg_num
and real_num
in a separate 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.
Done, I thus renamed "Rnat" in lemma names to "nat" or "natr". This yields a few conflicts with "natr" already used for
%:R
which I solved using a few "nat_num". This is not perfect but I think it's acceptable.
I'm not sure having natr
for lemmas about nat_num
is desirable...
Also note that we already had
Rpos
,Rneg
andRreal
which should probably be deprecated/renamedpos_num
,neg_num
andreal_num
in a separate PR.
Sure we should also deal with Rpos
, Rneg
and Rreal
7e89e8f
to
decbfad
Compare
Co-authored-by: Kazuhiko Sakaguchi <pi8027@gmail.com>
Co-authored-by: Kazuhiko Sakaguchi <pi8027@gmail.com> Co-authored-by: Pierre Roux <pierre.roux@onera.fr>
Motivation for this change
This PR renames the
archiFieldType
structure toarchiRealFieldType
and introduces 5 new Archimedean ring/field structures. These structures are currently defined inssrnum.v
, but will be relocated to a new filearchimedean.v
in a future release. We also generalize truncation (truncC
), floor (floorC
), the subset of natural integers (Cnat
,Qnat
, andZnat
), and the subset of integers (Cint
andQint
) to Archimedean rings, which are nowNum.trunc
,Num.floor
,Num.nat
, andNum.int
respectively.Closes #281
Things done/to do
CHANGELOG_UNRELEASED.md
(do not edit former entries)CI overlays
Automatic note to reviewers
Read this Checklist and make sure there is a milestone.