Skip to content

Comments

Add lemma le0_expectation_cdf#1847

Open
Yosuke-Ito-345 wants to merge 3 commits intomath-comp:masterfrom
Yosuke-Ito-345:le0_expectation_cdf
Open

Add lemma le0_expectation_cdf#1847
Yosuke-Ito-345 wants to merge 3 commits intomath-comp:masterfrom
Yosuke-Ito-345:le0_expectation_cdf

Conversation

@Yosuke-Ito-345
Copy link
Contributor

Motivation for this change

Add lemma le0_expectation_cdf, which is the counterpart of lemma ge0_expectation_ccdf.

Checklist
  • added corresponding entries in CHANGELOG_UNRELEASED.md
    N.B. I created CHANGELOG_UNRELEASED_new.md because the current CHANGELOG_UNRELEASED.md appeared to be old.

  • 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

@Yosuke-Ito-345
Copy link
Contributor Author

@affeldt-aist @t6s
I would appreciate your review. m(. .)m

Copy link
Member

@t6s t6s left a comment

Choose a reason for hiding this comment

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

I quickly checked the changes and added a few comments. I will further look into the proofs of two main additions.


HB.instance Definition _ f g := min_mfun_subproof f g.

Definition min_mfun f g : {mfun aT >-> _} := f \min g.
Copy link
Member

Choose a reason for hiding this comment

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

min_mfun should be added to the header doc.


Let mu : {measure set _ -> \bar R} := @lebesgue_measure R.

Lemma lebesgue_measure_oppr A (mA : measurable A) :
Copy link
Member

Choose a reason for hiding this comment

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

I suggest renaming this to lebesgue_measureN.

- by rewrite set_itv_ge ?wlength0// bnd_simp -leNgt.
Qed.

Lemma ge0_integral_oppr (f : R -> \bar R)
Copy link
Member

Choose a reason for hiding this comment

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

I suggest ge0_integral_pushforwardN.

by apply: eq_set => r; rewrite in_itv/= s_ge0.
Qed.

Lemma ge0_expectation_prob_ge (X : {RV P >-> R}) : (forall x, 0 <= X x)%R ->
Copy link
Member

Choose a reason for hiding this comment

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

What about giving a name to this integrand?
It should be equal to the "closed version" of ccdf.

Definition ccdf P X r := distribution P X `]r, +oo[.
Definition this_integrand P X r := distribution P X `[r, +oo[.

(However I myself do not come up with a good name.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only an auxiliary lemma for the subsequent lemma le0_expectation_cdf.
If I should not take this as an independent lemma, I would incorporate this into the proof of the lemma le0_expectation_cdf.

Copy link
Member

Choose a reason for hiding this comment

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

Keeping this proof independent would contribute to the readability.
You can do Local Lemma ge0_expectation_prob_ge or Let ge0_expecation_prob_ge, so that
this will not be exported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All right. I changed this Lemma to Let.
Thank you for the suggestion.

Copy link
Member

@t6s t6s left a comment

Choose a reason for hiding this comment

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

I have further added a few minor suggestions, but the code now generally looks good.

Comment on lines +140 to +141
Context {d} {T : measurableType d} {R : realType}.
Variables (P : probability T R).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Context {d} {T : measurableType d} {R : realType}.
Variables (P : probability T R).
Context {d} {T : measurableType d} {R : realType} (P : probability T R).

+ definition `min_mfun`

- in random_variable.v
+ lemmas `lebesgue_integral_pmf`, `cdf_measurable`, `ccdf_measurable`, `ge0_expectation_prob_ge`, `le0_expectation_cdf`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ lemmas `lebesgue_integral_pmf`, `cdf_measurable`, `ccdf_measurable`, `ge0_expectation_prob_ge`, `le0_expectation_cdf`
+ lemmas `lebesgue_integral_pmf`, `cdf_measurable`, `ccdf_measurable`,
`ge0_expectation_prob_ge`, `le0_expectation_cdf`

@t6s
Copy link
Member

t6s commented Feb 19, 2026

Reviewing the proofs, I experimented generalizing cdf to

Definition gen_cdf d (T : measurableType d) (R : realType) (P : probability T R)
  (X : {RV P >-> R}) b (r : R) := distribution P X [set` Interval -oo%O (BSide b r)].

The current proofs seem to work without changes at many steps.

@Yosuke-Ito-345
Copy link
Contributor Author

@t6s
Thank you for the review. Let me clarify your suggestion.
Is your idea to replace the definition of cdf to gen_cdf? If so, I will try to replace proofs in the sections cumulative_distribution_function, cdf_of_lebesgue_stieltjes_measure, lebesgue_stieltjes_measure_of_cdf and tail_expectation_formula. Maybe I should try to generalize ccdf in accordance with gen_cdf.

@t6s
Copy link
Member

t6s commented Feb 20, 2026

@Yosuke-Ito-345 My last comment was not meant to be a clear suggestion, but a naive report on my experiment.
I am not convinced enough because my proof attempt is not completed (you can see a broken wip at t6s@21868b3 ).

This attempt may simplify the proofs and save lines of code, and then ccdf should also be generalized.
The cdf and ccdf would be defined by specializing gen_cdf, gen_ccdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants