Skip to content

Prove some admitted lemmas in experimental_reals#2007

Open
ethanlee515 wants to merge 4 commits into
math-comp:masterfrom
ethanlee515:experimental-reals-fixes
Open

Prove some admitted lemmas in experimental_reals#2007
ethanlee515 wants to merge 4 commits into
math-comp:masterfrom
ethanlee515:experimental-reals-fixes

Conversation

@ethanlee515

Copy link
Copy Markdown
Motivation for this change

Prove three admitted lemmas in experimental_reals/realsum.v:

  • psumB
  • interchange_sup
  • interchange_psum

Un-deprecate the following, as they no longer depend on unproven lemmas:

  • dlet_dlet
  • dmargin_dlet
  • dlet_dmargin
  • dfst_dswap
  • dsnd_dswap
  • dsndE
  • pr_dlet
Checklist
  • 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

@affeldt-aist

Copy link
Copy Markdown
Member

Excellent! Note that psumB was also proved in the meantime in https://github.com/math-comp/analysis/pull/1978 (under review). fyi @t6s @strub @lyonel2017

@affeldt-aist
affeldt-aist force-pushed the experimental-reals-fixes branch from a978375 to e5c6b8f Compare June 28, 2026 16:17
@affeldt-aist
affeldt-aist requested a review from strub June 28, 2026 16:19
@affeldt-aist affeldt-aist added this to the 1.17.0 milestone Jul 21, 2026
@lyonel2017

Copy link
Copy Markdown
Contributor

Another way to prove interchange_psum is to use the lemmas esum_psum and exchange_esum. Here is an example:
https://github.com/lyonel2017/analysis/blob/a73e8162a88214015e8f9cd452104ceb15bb2f8c/experimental_reals/realsum.v#L1156. I think this proof could be shorter

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp>
Co-authored-by: Lionel Blatter <lionel.blatter@wanadoo.fr>
@ethanlee515
ethanlee515 force-pushed the experimental-reals-fixes branch from e5c6b8f to 1b49580 Compare July 24, 2026 09:25
@ethanlee515

ethanlee515 commented Jul 24, 2026

Copy link
Copy Markdown
Author

I've updated the proof of interchange_psum to use esum_psum and exchange_esum as suggested. I also noticed that my PR earlier changed the statement of interchange_sup by accident; I've changed it back.

- use = everywhere
- use classical_sets notations
- avoid detours in script
@affeldt-aist

Copy link
Copy Markdown
Member

What about the following for interchange_psum?
A bit shorter and more "primitive" (does not rely on esum.v).

Section PSumInterchange.
Context {R : realType} {X Y : choiceType}.

Let summable_pair_from_rows_psum (S : X -> Y -> R) :
    (forall x, summable (S x)) -> summable (PosSum.psum \o S) ->
  summable (fun xy => S xy.1 xy.2).
Proof.
move=> sumS sum_psumS.
exists (PosSum.psum (PosSum.psum \o S)) => J.
rewrite (big_fset_seq (fun xy => `|S xy.1 xy.2|))/=.
rewrite (partition_big_imfset _ fst J (fun xy => `|S xy.1 xy.2|))/=.
pose J1 := [fset xy.1 | xy in J]%fset.
have := gerfin_psum J1 sum_psumS.
rewrite (big_fset_seq (fun x => `|PosSum.psum (S x)|))/=.
apply: le_trans; apply: ler_sum => x _.
rewrite ger0_norm ?ge0_psum//.
pose F := [fset xy in J | xy.1 == x]%fset.
rewrite [leLHS](_ : _ = \sum_(xy <- F) `|S x xy.2|).
  by rewrite /F big_fset /=; apply: eq_bigr => xy /eqP ->.
rewrite -(big_map snd predT (fun y => `|S x y|)).
apply: gerfinseq_psum => //.
rewrite map_inj_in_uniq; last exact: uniq_fset_keys.
move=> [x1 y1] [x2 y2] /[!in_fset] /= /[!inE] /=.
by move=> /andP[_ /eqP ->] /andP[_ /eqP /= ->] ->.
Qed.

Lemma interchange_psum (S : X -> Y -> R) :
    (forall x, summable (S x)) -> summable (PosSum.psum \o S) ->
  PosSum.psum (PosSum.psum \o S) =
  PosSum.psum (fun y => PosSum.psum (S ^~ y)).
Proof.
move=> row_summable rows_summable.
pose P (xy : X * Y) := S xy.1 xy.2.
suff sumP : summable P.
  by rewrite -[LHS](psum_pair sumP)// [LHS](psum_pair_swap sumP).
apply: summable_pair_from_rows_psum.
- exact: row_summable.
- exact: eq_summable rows_summable.
Qed.

End PSumInterchange.

@affeldt-aist

Copy link
Copy Markdown
Member

Though the many small lemmas by @lyonel2017 look worth having... :-/

@affeldt-aist

Copy link
Copy Markdown
Member

In order to merge this PR quickly (because it is a progress and because the release of the next version is near---hopefully next week),
I propose the following:

  • tell me whether you prefer the above proof script for interchange_psum
  • make an issue for @lyonel2017 to later come up with a new proof using lemmas about esum and psum (the usefulness of which we can then discuss)

@ethanlee515

Copy link
Copy Markdown
Author

ah, my bad, didn't know the changes to interchange_sup (i.e. use of range) was intended.

On the interchange_psum side, I feel I unfortunately know too little to have an informed opinion or strong preference one way or the other. I'm happy with anything that everyone else agrees on :)

@affeldt-aist

affeldt-aist commented Jul 25, 2026

Copy link
Copy Markdown
Member

ah, my bad, didn't know the changes to interchange_sup (i.e. use of range) was intended.

it was: we'd better use the existing notations when they exist

PS: closing the PR was unintentional

Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp>
@ethanlee515

Copy link
Copy Markdown
Author

Replaced the interchange_psum proof with the version above by @affeldt-aist. As for opening a new issue, I don't know if I'm the right person to coordinate this.

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.

3 participants