Skip to content

Conversation

@affeldt-aist
Copy link
Member

@affeldt-aist affeldt-aist commented Nov 13, 2024

Motivation for this change
Checklist
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers

Reference: How to document

Reminder to reviewers

@affeldt-aist affeldt-aist added the enhancement ✨ This issue/PR is about adding new features enhancing the library label Nov 13, 2024
@affeldt-aist affeldt-aist added this to the 1.7.0 milestone Nov 13, 2024
@affeldt-aist
Copy link
Member Author

Maybe it is better to rename expectation_prod to expectation_mul since the original intent was expectationM.

@affeldt-aist affeldt-aist modified the milestones: 1.7.0, 1.8.0 Nov 22, 2024
@affeldt-aist affeldt-aist marked this pull request as draft December 3, 2024 05:42
@affeldt-aist affeldt-aist force-pushed the probability_20241105 branch 2 times, most recently from 0895272 to bc59196 Compare December 3, 2024 06:03
@affeldt-aist affeldt-aist force-pushed the probability_20241105 branch 2 times, most recently from 538b914 to d32696d Compare December 3, 2024 07:12
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 reviewed lines 0 -- 878 and quickly looked through 879-.
The latter things need some cleaning.

@affeldt-aist affeldt-aist force-pushed the probability_20241105 branch 5 times, most recently from 0ab14bf to a1eb371 Compare December 4, 2024 09:09
@affeldt-aist affeldt-aist force-pushed the probability_20241105 branch 2 times, most recently from aabd8b3 to a811b46 Compare December 18, 2024 22:43
@affeldt-aist affeldt-aist modified the milestones: 1.8.0, 1.9.0 Dec 18, 2024
@affeldt-aist affeldt-aist force-pushed the probability_20241105 branch 4 times, most recently from a93338c to 1c8f2b0 Compare January 10, 2025 15:54
@affeldt-aist affeldt-aist modified the milestones: 1.9.0, 1.10.0 Feb 5, 2025
@affeldt-aist affeldt-aist modified the milestones: 1.14.0, 1.15.0 Oct 30, 2025
@affeldt-aist affeldt-aist changed the title expectation of product independence, expectation of product Dec 31, 2025
@affeldt-aist affeldt-aist modified the milestones: 1.15.0, 1.16.0 Dec 31, 2025
@t6s
Copy link
Member

t6s commented Jan 5, 2026

I forgot the context for this draft PR. What is the current status?

@affeldt-aist
Copy link
Member Author

I forgot the context for this draft PR. What is the current status?

Rebased but for reasons I forgot some things look duplicated in probability.v and independence.v.
If I remember correctly, we introduced definitions of independence following Klenke's book and
were able to reproduce a few, non-trivial lemmas.
What about we remove duplications and PR only an independence.v file with what we have so far?
(That would save me the trouble of regular rebasings and certainly these definitions will be wanted at some point.)

@affeldt-aist affeldt-aist marked this pull request as ready for review January 6, 2026 04:12
@affeldt-aist
Copy link
Member Author

affeldt-aist commented Jan 6, 2026

I removed duplicates and unused lemmas and did some cleaning.
@t6s About the status: I think that this PR is really proposing definitions and justifying them with standard theorems from the literature.
If one finds it useful to have these definitions in master we can maybe think of merging at some point after review with some "experimental" proviso in the header file (like we did in the past for probability.v).
What do you think @hoheinzollern ?
fyi: @CohenCyril @proux01

Comment on lines 784 to 789
Lemma funrD_Dpos f g : f \+ g = (f \+ g)^\+ \- (f \+ g)^\-.
Proof.
apply/funext => x; rewrite /funrpos /funrneg/=; have [|/ltW] := lerP 0 (f x + g x).
- by rewrite -{1}oppr0 -lerNl => /max_idPr ->; rewrite subr0.
- by rewrite -{1}oppr0 -lerNr => /max_idPl ->; rewrite opprK add0r.
Qed.
Copy link
Member

Choose a reason for hiding this comment

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

This lemma should be removed as it is just an instance of funrposneg above.

- by rewrite -{1}oppr0 -lerNr => /max_idPl ->; rewrite opprK add0r.
Qed.

Lemma funrD_posD f g : f \+ g = (f^\+ \+ g^\+) \- (f^\- \+ g^\-).
Copy link
Member

Choose a reason for hiding this comment

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

This one, on the other hand, is nontrivial and should be kept.

Copy link
Member

Choose a reason for hiding this comment

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

But the name looks bad and I have no good suggestion for now.

Copy link
Member

Choose a reason for hiding this comment

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

funrD_posBneg would be better.

This can be seen as a form of distributivity where ^\+ and ^\- parallelly distributes over \+ inside
expressions of the form _^\+ \- _^\-. I do not know how to name it.

Copy link
Member Author

@affeldt-aist affeldt-aist Jan 6, 2026

Choose a reason for hiding this comment

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

In fact this lemma has a short proof once one observes that it almost corresponds to interchange with addition and subtraction (most if not all uses of interchange in MathComp use twice the same operator). interchange lemmas are suffixed with ACA like addrACA but that might be an overkill here to abide by this naming scheme because we mix two operators and moreover on functions (calling for a fctE suffix) so maybe addBr could be enough to suggests interchange sub add and therefore the name could just be funrDB (and funeDB for the corresponding lemmas for extended real numbers).

Copy link
Member

Choose a reason for hiding this comment

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

interchange is indeed another structure involved here, and I also thought about incorporating ACA in its name, though not coming up with a tidy result.

funrDB is neat but looks a bit too stripped off since it does not clearly indicate that it is about ^+ and ^-.
I am however not sure how to restore that info without elongating the name, and weakly approving funrDB.

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 reviewed lines 0 -- 878 and quickly looked through 879-. The latter things need some cleaning.

It looks like I reviewed independence.v once, and the file looks not so bad. @hoheinzollern can you double check?

I have read the other files and put some comments requesting some changes.

@affeldt-aist
Copy link
Member Author

I have read the other files and put some comments requesting some changes.

Thanks for the comments that triggered very welcomed improvements.

Local Open Scope ereal_scope.

Definition independent_events (I : set I0) (E : I0 -> set T) :=
(forall i, I i -> measurable (E i)) /\
Copy link
Member

@CohenCyril CohenCyril Jan 6, 2026

Choose a reason for hiding this comment

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

why is measurability built in independence of variables? I would have expected measurability to be a side condition. (Same remark in each definition below)

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

Labels

enhancement ✨ This issue/PR is about adding new features enhancing the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants