-
Notifications
You must be signed in to change notification settings - Fork 642
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
[stdlib] stronger div, mod lemmas via module type #16203
Conversation
For |
Could it be possible to rely on the module system to keep the same name for strong statements as for weak ones? thus avoiding the use of |
6cee188
to
628441f
Compare
I'm not sure what is the best way here and I am open to suggestions. Shadowing the existing A good compromise is still to have the weak lemmas marked as deprecated (as in the other PR) and after a transition rename the strong ones to their proper names. |
628441f
to
06cdf66
Compare
Talking about the final target (not considering the deprecation phase yet), I would imagine for example creating a |
Oh yes, replacing weak lemmas in |
I now added stronger @olaure01 What is the status of I see two options.
Option 2 would be easier on the users. Option 1 would entail e.g. the |
I am not sure. Similar files like
Since deprecation phases are long (in particular when we want to reuse old names), I am in general in favor of starting them as soon as possible.
I agree that in the present situation going back and forth through Would it be reasonable to consider settling now the architecture of the final target of the process (with strong statements available under
|
I'm not sure whether I like the idea. It creates a third competing module, which will surely take over a year to again deprecate.
|
The idea would be to be clear about the status of these modules (and probably mention their existence in changelog only):
|
I am such a developer of a (undecidability) library with over 100K LOC. |
I understand the wish to avoid in productive code Require Import PeanoNat.
Module Nat := Nat.Div0. should locally shadow old |
While trying to sideways refactor Also, we cannot deprecate the module types such as I will shift my focus solely on |
The job library:ci-fiat_crypto_legacy has failed in allow failure mode |
302acd3
to
f60b91d
Compare
0ad940d
to
d3d5424
Compare
@olaure01 I finally figured out (for |
I'm not sure why, the |
In the editor I see no slowdown in |
@Alizter What did you change in the ci that |
@mrhaandi I reran it yesterday. Sometimes the CI takes its time. It was unrelated to SchemeEquality.v. |
@olaure01 Did you want to have a look? Otherwise I will merge soon. |
@Alizter I planned to have look next week or the week after, but if it is OK with you, please go. |
@olaure01 In that case I will wait for your review. No rush. |
d3d5424
to
cc38f26
Compare
The job library:ci-fiat_crypto_legacy has failed in allow failure mode |
cce0725
to
42874f4
Compare
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.
I think the work on induction in NZOrder
and on Bezout in NGcd
should be documented in changelog.
You could also mention more about the future in changelog: planned deprecation phases, and the trick to directly go close to the end following: Module Nat := Nat.Div0.
Yes, I forgot to add a note on
Yes. |
@coq/doc-maintainers This PR both adds, removes, changes and deprecates things. Is the changelog OK, or would it be better to split it into separated Added / Changed / Deprecated / ... entries? |
I think splitting up the changelog entry would be a good idea. |
I now split the changelog entries into three orthogonal bullet points. Is this the standard approach, or should I create distinct changelog files? |
That's fine, no need for distinct files. |
I will merge this soon. @proux01 are you still having a look? |
added stronger Nat.Div0, Nat.Lcm0 modules added stronger N.Div0, N.Lcm0 modules added stronger NExtraProp0 module type added NZDivSpec0 added measure_right_induction, measure_left_induction to NZOrder added measure_induction to NOrder removed rs'_rs'', rbase, A'A_right, ls_ls', ls'_ls'', lbase, A'A_left from NZOrder simplified NGcd proofs deprecated weak NGcd lemmas
d3926bb
to
82773da
Compare
Squashed and rebased to be on the safe side. |
@coqbot merge now |
@mrhaandi Has any investigation been done into removing the useless hypotheses from the Z lemmas? |
Unfortunately, the situation with |
@mrhaandi would you be willing to describe what the drawbacks and considerations are? I've been considering doing this work myself, if I ever find the time for it, and would be interested in not retreading known dead-ends and having a better sense up front what the rough design trade-offs are. |
This is a follow-up to uniformization of
div
andmod
in #14086.As a consequence, we can uniformly derive stronger lemmas for
Nat
andN
assuminga / 0 == 0
anda mod 0 == a
.Closes #16186
The basic idea is to have an abstract, optional specification
In addition, modules
NDiv0.NDivProp0
(as apposed toNDiv.NDivProp
) andNLcm0.NLcmProp0
(as apposed toNLcm.NLcmProp
) provide stronger lemmas based onNZDivSpec0
. For example:Any number system which satisfies
NZDivSpec0
may for free benefit from the stronger lemmas.PeanoNat.Nat
andBinNat.N
as above.NDivProp
orNLcmProp
, which are valid (and useful) for number systems that do not satisfyNZDivSpec0
.Z
, which is a separate concern.Deprecation Phases
We aim for maximal compatibility for each phase with deprecation warnings.
Phase 1
Div0
andLcm0
modules.Notation
with adeprecated
attribute.Search
does not display weaker lemmas due toPrivate_
prefix.Phase 2
Div0
andLcm0
modules.Div0
andLcm0
modules are deprecated.Phase 3
Div0
andLcm0
are removed.