Skip to content

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

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

feat(Analysis/Calculus): define absolutely monotone functions#38026
mrdouglasny wants to merge 2 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>
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.

4 participants