analysis icon indicating copy to clipboard operation
analysis copied to clipboard

Generalize integration_by_parts

Open IshiguroYoshihiro opened this issue 5 months ago • 6 comments

Motivation for this change

Add a part of generalized version of integration by parts for unbound intervals `[a, +oo[. This PR is over #1656 and #1662. I don't sure that I should add 4 more lemmas and complete all variation of integration by parts for unbound intervals. I think that 8 similar lemmas would be a mess. So, I'd like to somehow make them up into one or two lemmas, but I don't have an idea.

Checklist
  • [x] added corresponding entries in CHANGELOG_UNRELEASED.md
  • [ ] added corresponding documentation in the headers

Reference: How to document

Merge policy

As a rule of thumb:

  • PRs with several commits that make sense individually and that all compile are preferentially merged into master.
  • PRs with disorganized commits are very likely to be squash-rebased.
Reminder to reviewers

IshiguroYoshihiro avatar Jul 04 '25 08:07 IshiguroYoshihiro

Are not all 4 versions the same, the only difference being whether the minus is inside or outside the integral?

Tragicus avatar Jul 15 '25 07:07 Tragicus

Are not all 4 versions the same, the only difference being whether the minus is inside or outside the integral?

If you said that these lemmas can be proved with one of them, I think it is no. As you can see, the version of le0_ge0 and le0_le0 can be proved with ge0_ge0 or ge0_le0, but ge0_le0 can not proved from ge0_ge0. Because that integration by substitusion using a transformation F -> F \o -%R change the unbounded side of the interval from `[a, +oo[ to `[-oo, - a[, I may have to set 4 more variations of this lemma for `[-oo, -a[. It will makes messy for the use to set 8 variation of the lemma. So I will consider some good way.

IshiguroYoshihiro avatar Jul 28 '25 07:07 IshiguroYoshihiro

Are not all 4 versions the same, the only difference being whether the minus is inside or outside the integral?

Indeed le0_le0 is the same as ge0_ge0 (and it is proved as such). Similarly, for ge0_le0 vs. le0_ge0. I don't think we can have more sharing. Do you think that we should work towards a general version? A single lemma encompassing them all?

affeldt-aist avatar Oct 30 '25 09:10 affeldt-aist

Are not all 4 versions the same, the only difference being whether the minus is inside or outside the integral?

Indeed le0_le0 is the same as ge0_ge0 (and it is proved as such). Similarly, for ge0_le0 vs. le0_ge0. I don't think we can have more sharing. Do you think that we should work towards a general version? A single lemma encompassing them all?

To give a bit of context, these lemmas have been written this way after having been tested to formalize the Gamma function. Maybe their apparent specialization is the result of practical considerations? @IshiguroYoshihiro can you confirm? (Or am I remembering wrong?)

affeldt-aist avatar Oct 30 '25 09:10 affeldt-aist

To give a bit of context, these lemmas have been written this way after having been tested to formalize the Gamma function.

FYI, here is the PR that formalizes the Gamma function: https://github.com/math-comp/analysis/pull/1762

One way to factorize would be to ask for the relevant functions to have constant sign. I was also wondering whether we want to generalize over the interval, instead of [a, +oo[. We would require that the relevant functions are derivable on the interior of the interval and have limits at the boundaries.

This has not been tested yet (by lack of time). :-(

Some of the following suggestions are quite ugly but save a lot of time, what do you think?

We have merged all of them. Thanks for identifying the performance issues, that helps.

affeldt-aist avatar Nov 21 '25 16:11 affeldt-aist

I suggest keeping 4 lemmas as is, and additionally, provide a unified interface lemma that use the constant_sign predicate

t6s avatar Dec 11 '25 07:12 t6s