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

[Merged by Bors] - feat: Lemma for fderiv of scalar function #14502

Closed
wants to merge 7 commits into from

Conversation

adomasbaliuka
Copy link
Collaborator

@adomasbaliuka adomasbaliuka commented Jul 8, 2024

Adds lemma for simplifying the Fréchet derivative when applied to a function maping scalars to scalars.

This (currently named fderiv_deriv') is a special case of fderiv_deriv. Neither of simp, fun_prop, aesop, exact? , apply? currently seems to make progress on it.

Possibly, it should be instead stated as (fderiv 𝕜 f x : 𝕜 → 𝕜) = ((deriv f x) * ·) if that makes it more likely to be applied by simp?

I think it should be marked @[simp] because one would basically always prefer the right hand side to the left hand side of the equality. Does that make sense?

I also think fderiv_deriv should be marked @[simp], though maybe there is a reason why it isn't. Marking it such requires a change to the proof of deriv_fderiv, which was using a simp rather than a simp only (not a non-terminal simp but still to be avoided, I would assume?). Maybe other things are also likely to break, however, if those are added to simp?


Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jul 8, 2024

This comment was marked as outdated.

@grunweg grunweg added awaiting-review t-analysis Analysis (normed *, calculus) labels Jul 8, 2024
@grunweg
Copy link
Collaborator

grunweg commented Jul 8, 2024

Thanks for your contribution to mathlib! I guess you'd like code to be reviewed - hence I have labelled it awaiting-review. (You can read more about this and related labels here.

@eric-wieser eric-wieser changed the title Lemma for fderiv of scalar function feat: Lemma for fderiv of scalar function Jul 8, 2024
@fpvandoorn fpvandoorn added the awaiting-author A reviewer has asked the author a question or requested changes label Jul 13, 2024
@fpvandoorn
Copy link
Member

This lemma looks good to me. I would like a different name though (we want to avoid primes, and also the other two names are not great).

@fpvandoorn
Copy link
Member

Actually, can you add a version for f : 𝕜 → F where the right-hand-side is y \bu deriv f x?

@fpvandoorn
Copy link
Member

fpvandoorn commented Jul 13, 2024

And it makes sense to me to make fderiv_deriv a simp-lemma. Feel free to do that. That might need some fixes in other places. Actually, this is not necessary if the new lemma is a simp-lemma.

@adomasbaliuka adomasbaliuka removed the awaiting-author A reviewer has asked the author a question or requested changes label Jul 13, 2024
@fpvandoorn
Copy link
Member

Thanks!

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Jul 14, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 14, 2024
Adds lemma for simplifying the Fréchet derivative when applied to a function maping scalars to scalars. 

This (currently named `fderiv_deriv'`) is a special case of `fderiv_deriv`. Neither of `simp`, `fun_prop`, `aesop`, `exact?` , `apply?` currently seems to make progress on it.

Possibly, it should be instead stated as `(fderiv 𝕜 f x : 𝕜 → 𝕜) = ((deriv f x) * ·)` if that makes it more likely to be applied by `simp`?

I think it should be marked `@[simp]` because one would basically always prefer the right hand side to the left hand side of the equality. Does that make sense?

I also think `fderiv_deriv` should be marked `@[simp]`, though maybe there is a reason why it isn't. Marking it such requires a change to the proof of `deriv_fderiv`, which was using a `simp` rather than a `simp only` (not a [non-terminal simp](https://leanprover-community.github.io/glossary.html#non-terminal-simp) but still to be avoided, I would assume?). Maybe other things are also likely to break, however, if those are added to simp?
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 14, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Lemma for fderiv of scalar function [Merged by Bors] - feat: Lemma for fderiv of scalar function Jul 14, 2024
@mathlib-bors mathlib-bors bot closed this Jul 14, 2024
@mathlib-bors mathlib-bors bot deleted the adomas_fderiv_deriv_scalar branch July 14, 2024 12:33
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants