Skip to content

feat(Analysis/Calculus): define absolutely monotone functions#38026

Open
mrdouglasny wants to merge 5 commits intoleanprover-community:masterfrom
mrdouglasny:absolutely-monotone-def
Open

feat(Analysis/Calculus): define absolutely monotone functions#38026
mrdouglasny wants to merge 5 commits intoleanprover-community:masterfrom
mrdouglasny:absolutely-monotone-def

Conversation

@mrdouglasny
Copy link
Copy Markdown
Contributor

Summary

  • Define AbsolutelyMonotoneOn f s for functions f : ℝ → ℝ that are smooth on s with all iterated derivatives within s nonneg
  • Prove closure under add, smul, mul
  • Show exp, cosh, constants, and powers are absolutely monotone on appropriate domains

This is the first part of a split of #37879. Follow-up PRs will add:

  • Bernstein backward direction (nonneg coefficients → absolutely monotone)
  • Bernstein forward direction (absolutely monotone → analytic at 0)
  • Matrix applications (Schur product theorem for power series, entrywise exp)

Test plan

  • CI passes (build + lint)
  • Verify AbsolutelyMonotoneOn structure and examples type-check

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Define `AbsolutelyMonotoneOn f s` for functions with nonneg iterated
derivatives within a set. Prove closure under addition, scalar
multiplication, and multiplication, plus show exp, cosh, constants,
and powers are absolutely monotone on appropriate domains.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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 Apr 14, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

PR summary 2ff88851d5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.Calculus.AbsolutelyMonotone (new file) 1802

Declarations diff

+ AbsolutelyMonotoneOn
+ add
+ mul
+ of_contDiff
+ smul

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-analysis Analysis (normed *, calculus) label Apr 14, 2026
# Absolutely Monotone Functions

A function `f : ℝ → ℝ` is absolutely monotone on a set `s` if it is smooth
on `s` and all its iterated derivatives within `s` are nonneg on `s`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
on `s` and all its iterated derivatives within `s` are nonneg on `s`.
on `s` and all its iterated derivatives within `s` are nonnegative on `s`.

exact h n x hx

/-- Nonneg Taylor coefficients at any point in `s`. -/
theorem nonneg_taylor_coeffs {f : ℝ → ℝ} {s : Set ℝ}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems redundant to me, since it follows immediately from 0 ≤ iteratedDerivWithin n f s x.


end AbsolutelyMonotoneOn

/-! ### Examples -/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think these examples should go in separate files. This definition shouldn't require Real.cosh in order to be imported, for instance.

simp only [iteratedDeriv_const]
split
· exact hc
· exact le_refl 0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
· exact le_refl 0
· rfl

@wwylele
Copy link
Copy Markdown
Collaborator

wwylele commented Apr 14, 2026

Could you format the code to fill up the 100-character limit per line?
(Why is this a recurring problem from Claude code? This should be trivial to solve, either by human or AI)

@themathqueen themathqueen added the LLM-generated PRs with substantial input from LLMs - review accordingly label Apr 14, 2026
- "nonneg" → "nonnegative" in docstrings
- Remove redundant `nonneg_taylor_coeffs`
- Move examples (exp, cosh, const, pow) out to avoid pulling heavy
  imports — they will go in a follow-up file
- Fill lines to 100-char limit
- Trim unused imports (only IteratedDeriv.Lemmas needed for def + closure)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@j-loreaux
Copy link
Copy Markdown
Contributor

I know very little about absolutely monotone functions and what are the correct design choices, so I am going to remove my assignment on this PR. Maybe @sgouezel wants to take it up?

@j-loreaux j-loreaux removed their assignment Apr 15, 2026
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, but it not my area of expertise.


## References

* Widder, D.V. (1941). *The Laplace Transform*.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be added to the .bib file as an actual reference, and linked here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe worth double-checking it isn't an AI hallucinated reference.

Comment on lines +42 to +43
/-- Constructor from global `ContDiff` and global `iteratedDeriv`. Works for any `UniqueDiffOn`
set (includes open sets, `Ici a`, convex sets with nonempty interior, etc.). -/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/-- Constructor from global `ContDiff` and global `iteratedDeriv`. Works for any `UniqueDiffOn`
set (includes open sets, `Ici a`, convex sets with nonempty interior, etc.). -/
/-- A globally smooth function all of whose iterated derivatives are nonnegative on a set `s`
satisfying `UniqueDiffOn` is absolutely monotone on `s`. Such sets `s` include open sets,
`Set.Ici`, and convex sets with nonempty interior. -/

@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 15, 2026
mrdouglasny and others added 2 commits April 15, 2026 01:56
- Add Widder, *The Laplace Transform* (1941) to references.bib and
  link via bibkey in the module doc
- Clarify `of_contDiff` docstring (vs generic "Constructor from ...")

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lint-bib.sh uses bibtool case-insensitive sort — lowercase 'widder'
comes before 'Wielandt', not after.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mrdouglasny
Copy link
Copy Markdown
Contributor Author

Addressed all review comments:

  • Examples split out: exp, cosh, pow, const, and Bernstein theorems removed from this PR (will go in a follow-up)
  • Widder reference: added widder1941 entry to references.bib and linked in the docstring
  • Line wrapping: reformatted to 100-char limit
  • Docstrings: applied suggested rewording (nonneg to nonnegative, expanded of_contDiff docstring)
  • Redundant lemma: removed nonneg_taylor_coeffs

Re: the Widder reference -- it is real, not hallucinated: The Laplace Transform by David V. Widder (1941) on Amazon

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mrdouglasny
Copy link
Copy Markdown
Contributor Author

All reviewer comments have been addressed. Could a maintainer please remove the awaiting-author label? Thanks.

@wwylele
Copy link
Copy Markdown
Collaborator

wwylele commented Apr 19, 2026

You can remove it yourself by typing "-awaiting-author". For more information about PR lifecycle, you can read https://leanprover-community.github.io/contribute/index.html

@mrdouglasny
Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 19, 2026
@ADedecker
Copy link
Copy Markdown
Member

Sorry, I am going to remove my assignment because I would rather dedicate my scarce reviewing time to human-written code.

@ADedecker ADedecker removed their assignment Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants