Skip to content

refactor(Analysis/Calculus/Gradient): ungate inner_gradient lemmas#39203

Open
FordUniver wants to merge 1 commit into
leanprover-community:masterfrom
FordUniver:refactor/gradient-ungate-inner-lemmas
Open

refactor(Analysis/Calculus/Gradient): ungate inner_gradient lemmas#39203
FordUniver wants to merge 1 commit into
leanprover-community:masterfrom
FordUniver:refactor/gradient-ungate-inner-lemmas

Conversation

@FordUniver
Copy link
Copy Markdown
Collaborator

Removes superfluous differentiability hypotheses (plus UniqueDiffWithinAt for the Within versions) from the four inner_gradient[Within]_[left|right] lemmas: gradient is defined as (toDual 𝕜 F).symm (fderiv 𝕜 f x), so ⟪∇ f x, y⟫ = fderiv 𝕜 f x y holds unconditionally since both sides are zero when f is not differentiable at x.


Genuinely unsure about this one because the only call I currently have in my code itself has the differentiability hypothesis. But including unused (or unnecessary) assumptions seems not intentional? My best guess is that the hypotheses were included by analogy with HasGradientAt.fderiv_apply, which genuinely needs them. This PR drops the hypotheses and rewrites the proofs through the isomorphism directly; no existing mathlib callers pass the now-redundant arguments.

The four `inner_gradient[Within]_[left|right]` lemmas in
`Mathlib/Analysis/Calculus/Gradient/Basic.lean` required differentiability
hypotheses (`DifferentiableAt`, `DifferentiableWithinAt`, plus
`UniqueDiffWithinAt` for the `Within` versions). These were never
necessary: `gradient` is *defined* via the Riesz isomorphism from
`fderiv`, so the identification `⟪∇ f x, y⟫ = fderiv 𝕜 f x y` holds
unconditionally — both sides are zero when `f` is not differentiable.

Removes the hypotheses and rewrites the proofs to go through
`toDual_apply_apply` and `LinearIsometryEquiv.apply_symm_apply` directly.
No call-site updates needed (no current mathlib callers pass the now-redundant arguments).
@FordUniver FordUniver requested a review from urkud May 11, 2026 14:26
@github-actions
Copy link
Copy Markdown

PR summary d59f7b3264

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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 a review from Komyyy May 11, 2026 14:27
@github-actions github-actions Bot added the t-analysis Analysis (normed *, calculus) label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant