Skip to content
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

Merged
merged 8 commits into from
Aug 18, 2024

Conversation

affeldt-aist
Copy link
Member

Motivation for this change

The lemmas proposed by this PR are slight generalizations (e.g., parameters of derivable_cst, derive_cst that generalized derive1_cst) or lemmas that are specialized variants of
already existing lemmas (e.g., deriveX_id, deriveMr, derive_id). Specialized variants might
look 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 but
that might already be a useful step.

Checklist
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers

Reference: How to document

Reminder to reviewers

@affeldt-aist affeldt-aist added the enhancement ✨ This issue/PR is about adding new features enhancing the library label Aug 9, 2024
@affeldt-aist affeldt-aist added this to the 1.4.0 milestone Aug 9, 2024
theories/derive.v Outdated Show resolved Hide resolved
theories/derive.v Outdated Show resolved Hide resolved
@affeldt-aist
Copy link
Member Author

Thanks, I totally forgot about this notation.

Comment on lines 1385 to 1383
Lemma deriveX_id {R : numFieldType} n x v :
'D_v (@GRing.exp R ^~ n.+1) x = n.+1%:R *: x ^+ n *: v.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why suffix _id?

Copy link
Member Author

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.

Copy link
Member

@CohenCyril CohenCyril Aug 9, 2024

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...

Copy link
Member Author

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 *)

Copy link
Member

@CohenCyril CohenCyril Aug 9, 2024

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 or measurable_fun_pow, we use the single letter suffix (when it exists) as in cvgM, continuousM, deriveX, or measurable_funX
  • when a lemma is about applied function, we use the multi-letter prefix instead as in mul_continuous, exp_derive or exp_measurable_fun.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member Author

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)

@affeldt-aist
Copy link
Member Author

@CohenCyril ok to merge in the current state?

classical/functions.v Outdated Show resolved Hide resolved
Copy link
Member

@CohenCyril CohenCyril left a 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

@affeldt-aist affeldt-aist merged commit d142eae into math-comp:master Aug 18, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ This issue/PR is about adding new features enhancing the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants