Skip to content

feat(Analysis/Calculus/Gradient): add toDual_gradient and companions#39202

Open
FordUniver wants to merge 2 commits into
leanprover-community:masterfrom
FordUniver:feat/gradient-toDual
Open

feat(Analysis/Calculus/Gradient): add toDual_gradient and companions#39202
FordUniver wants to merge 2 commits into
leanprover-community:masterfrom
FordUniver:feat/gradient-toDual

Conversation

@FordUniver
Copy link
Copy Markdown
Collaborator

@FordUniver FordUniver commented May 11, 2026

Add toDual_gradient, toDual_gradientWithin, and the composed variants toDual_comp_gradient, toDual_comp_gradientWithin — the natural inverse direction of the gradient's defining equation ∇ f x := (toDual 𝕜 F).symm (fderiv 𝕜 f x). These identify (toDual 𝕜 F) (∇ f x) with fderiv 𝕜 f x (and the gradientWithin and composed forms with the corresponding fderiv versions), making the Riesz isomorphism between the two derivative views explicit. The proofs of DifferentiableAt.hasGradientAt and DifferentiableWithinAt.hasGradientWithinAt in the same file are simplified to use them.


Came up while formalizing the descent lemma for Lipschitz-smooth functions, where being able to switch between LipschitzWith K (fderiv ℝ f) and LipschitzWith K (∇ f) is helpful, which with this PR becomes toDual_comp_gradient ▸ (toDual ℝ F).isometry.lipschitzWith_iff K. Also slightly simplifies two call sites in mathlib.

Expose the Riesz isomorphism `InnerProductSpace.toDual` directly on
the gradient: four new lemmas relating `(toDual 𝕜 F) (∇ f)` to
`fderiv 𝕜 f` (and the `gradientWithin` and composed versions).

These are the natural identifications: the gradient is defined by
applying `(toDual 𝕜 F).symm` to the Fréchet derivative, so `toDual`
recovers the latter. Useful when transferring statements about
`fderiv` (Lipschitz constants, etc.) to the gradient via the Riesz
isometry.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

PR summary 45f0cc9e9b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ toDual_comp_gradient
+ toDual_comp_gradientWithin
+ toDual_gradient
+ toDual_gradientWithin

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

@FordUniver FordUniver requested review from Komyyy and urkud May 11, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant