-
Notifications
You must be signed in to change notification settings - Fork 47
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
minor additions and generalizations #1289
Conversation
Thanks, I totally forgot about this notation. |
theories/derive.v
Outdated
Lemma deriveX_id {R : numFieldType} n x v : | ||
'D_v (@GRing.exp R ^~ n.+1) x = n.+1%:R *: x ^+ n *: v. |
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.
Why suffix _id
?
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.
As a special case of:
Lemma deriveX f n (x v : V) : derivable f x v ->
'D_v (f ^+ n.+1) x = (n.+1%:R * f x ^+ n) *: 'D_v f 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.
This reminds me of mul_continuous
and cvgM
(and continuousM
).
In fact these are all equivalent and the bridge is composition.
We should come up with a consistent naming scheme if we are going that way and I do not think id
is very informative here...
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.
In lebesgue_measure.v
, we did that:
Lemma measurable_exprn D n : measurable_fun D (fun x => x ^+ n).
(* coming first *)
Lemma measurable_fun_pow D f n : measurable_fun D f ->
measurable_fun D (fun x => f x ^+ n).
(* proved using measurable_comp *)
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.
Oh, this is bad... the head symbol's name is exp
in both case and pow
is now booked for the power function R -> R -> R
(which in fairness should probably swapped, but that's a completely different question).
Anyway we should not solve the problem by introducing duplicate names for existing symbols (let's not have prod
as an alternative for mul
nor plus
as an alternative for add
😉), but by finding a uniform naming scheme which encompasses all the cases for continuity, measurability and various notions of derivability.
My suggestion is we align with the conventions for continuity with the following rationale:
- when a lemma is about a composite, like the current
cvgM
,continuousM
,deriveX
ormeasurable_fun_pow
, we use the single letter suffix (when it exists) as incvgM
,continuousM
,deriveX
, ormeasurable_funX
- when a lemma is about applied function, we use the multi-letter prefix instead as in
mul_continuous
,exp_derive
orexp_measurable_fun
.
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 that we chose to use measurable
instead of measurable_fun
when the suffix suggests a function.
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 guess this shortcut is only acceptable when it does not cause ambiguity, I'll try your proposal fixes asap.
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.
when the prefix is a function name I guess it makes sense indeed
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.
So maybe use X
for the cardinal product and Xn
for GRing.exp
?
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.
(well funX
is clear enough maybe)
bb8e668
to
13c501f
Compare
@CohenCyril ok to merge in the current state? |
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.
Aside from my (minor) comment. LGTM
Motivation for this change
The lemmas proposed by this PR are slight generalizations (e.g., parameters of
derivable_cst
,derive_cst
that generalizedderive1_cst
) or lemmas that are specialized variants ofalready existing lemmas (e.g.,
deriveX_id
,deriveMr
,derive_id
). Specialized variants mightlook superfluous at first sight but they do save several micro steps in practical examples and
moreover since we have a naming convention (this PR documents it) for the file
derive.v
these variants are expected results of
Search
. Certainly, there is more to do in this file butthat might already be a useful step.
Checklist
CHANGELOG_UNRELEASED.md
Reference: How to document
Reminder to reviewers