Add lemma le0_expectation_cdf#1847
Conversation
|
@affeldt-aist @t6s |
t6s
left a comment
There was a problem hiding this comment.
I quickly checked the changes and added a few comments. I will further look into the proofs of two main additions.
t6s
left a comment
There was a problem hiding this comment.
I have further added a few minor suggestions, but the code now generally looks good.
|
Reviewing the proofs, I experimented generalizing The current proofs seem to work without changes at many steps. |
|
@t6s |
|
@Yosuke-Ito-345 My last comment was not meant to be a clear suggestion, but a naive report on my experiment. This attempt may simplify the proofs and save lines of code, and then |
|
I made a first pass, I will take a look at naming later here are a few comments:
|
|
PS: There are maybe more symmetries/simplifications to discover with a better user of preimage or generalizations to generic intervals but this is not requirement to merge the PR imo |
|
(oops, I haven't figured out yet the CI errors...) |
| by rewrite pmf0NP; exact: measurableC. | ||
| by move=> x _; rewrite lee_fin pmf_ge0. |
There was a problem hiding this comment.
According to the contribution guide, shouldn't we add - in the first two subgoals?
- by rewrite pmf0NP; exact: measurableC.
- by move=> x _; rewrite lee_fin pmf_ge0.
There was a problem hiding this comment.
This is indeed what is written but we rarely apply this rule in MathComp-Analysis.
For example, when there are two technical subgoals that are generated and that these subgoals are so simple that they can be proved with one line and that morally they should be automatically discharged, we often write:
rewrite tactic1; last 2 first.
by tactic2.
by tactic3
rest_of_the_proof.I guess that this is because the last 2 first and the leading by tactical and/or the coloring are enough indications to tell the reader "this is not fundamental, skip on a cursory reading", and also because that kind of situations appears less often in MathComp than in MathComp-Analysis (where we are quickly bothered by measurability/derivability/continuity/etc. subgoals).
Of course, it is fine to apply the "official" rule. Maybe we should propose an amendment to the contribution guide. What do you think? (@CohenCyril ?)
PS: Loosely connected topic: it is very likely that in a near future the default order of generation of subgoals will change when rewriting, and that measurability/derivability/continuity/etc. subgoals will be handled more automatically (in a bit more distant future). That could impact style.
There was a problem hiding this comment.
Thank you for the detail explanation. Now I understand the policy, I do not require to add - in this proof.
Personally, I think this policy should be written down somewhere. I support proposing an amendment to the contribution guide.
|
I think I figured out the CI problem. This was specific to the dev version of Rocq, the behavior of |
Co-authored-by: Takafumi Saikawa <tscompor@gmail.com>
| by apply: eq_set => r; rewrite in_itv/= s_ge0. | ||
| Qed. | ||
|
|
||
| Let ge0_expectation_prob_ge (X : {RV P >-> R}) : (forall x, 0 <= X x)%R -> |
There was a problem hiding this comment.
Since the (large) inequality that was on the right-hand side has disappears in favor of preimage maybe ge0_expectation_preimage is a bit more appropriate now.
There was a problem hiding this comment.
Yes, I agree with you on changing ge0_expectation_prob_ge to ge0_expectation_preimage.
|
(CI should be fixed now, with the last commit) |
| by rewrite !lte_fin ltrN2 opprK addrC. | ||
| Qed. | ||
|
|
||
| Lemma ge0_integral_pushforwardN (f : R -> \bar R) : |
There was a problem hiding this comment.
pushforward does not appear in the statement so maybe it'd better not appear in the name.
By the way, this is a variant of ge0_integration_by_substitutionNy in ftc.v (fyi: @IshiguroYoshihiro) (maybe even a strict generalization provided the constant bound is generalized).
I'd like to give a bit more thought to naming, generalization, and potentially trying to use the general version when possible to see what can be gained in other files.
There was a problem hiding this comment.
No obvious generalization, I propose to go with the name ge0_integration_by_substitution0 which is a bit long but more uniform with the similar lemmas in ftc.v: by choosing this name, when somebody searches for lemmas with the substring "substitution", they might find this along the others and maybe benefit from the weaker assumption.
There was a problem hiding this comment.
I agree with your proposal.
By the way, I am considering formalizing the substitution formula for the Lebesgue integral in which the continuity of the integrand is not assumed. In fact, the integrand only needs to be measurable.
I think it is not easy and takes time, so I will send another pull request.
There was a problem hiding this comment.
That would be great. By the way, @IshiguroYoshihiro knows best about these lemmas.
affeldt-aist
left a comment
There was a problem hiding this comment.
Thank you very much for the contribution and for your patience during the conversation!
|
We ll merge after fixing the changelog |
Motivation for this change
Add lemma
le0_expectation_cdf, which is the counterpart of lemmage0_expectation_ccdf.Checklist
added corresponding entries in
CHANGELOG_UNRELEASED.mdN.B. I created
CHANGELOG_UNRELEASED_new.mdbecause the currentCHANGELOG_UNRELEASED.mdappeared to be old.added corresponding documentation in the headers
Reference: How to document
Merge policy
As a rule of thumb:
all compile are preferentially merged into master.
Reminder to reviewers