Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(topology/algebra/infinite_sum): Multiplicativise #18405

Closed
wants to merge 18 commits into from
Closed

Conversation

YaelDillies
Copy link
Collaborator

@YaelDillies YaelDillies commented Feb 8, 2023

Multiplicativise has_sum, summable, tsum and their API to get has_prod, prodable, tprod.

The diff is mostly additivizing lemmas. However extra attention should be paid to the following:

  • I rename cauchy_seq_finset_iff_vanishing to cauchy_seq_finset_sum_iff_vanishing as otherwise the name wouldn't be multiplicativisable
  • There's an unfortunate name clash between prod and finset.prod. Concretely, we have the lemmas tsum_sum, tsum_prod, tsum_prod' which want to be multiplicativised to tprod_prod, tprod_prod, tprod_prod'. I am instead multiplicativising them to tprod_prod'', tprod_prod, tprod_prod'
  • I am expanding the module docs, and am not sure whether I'm using "unconditionally convergent" correctly

Requested by @pechersky

Open in Gitpod

@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) t-topology Topological spaces, uniform spaces, metric spaces, filters labels Feb 8, 2023
@eric-wieser
Copy link
Member

  • There's an unfortunate name clash between prod and finset.prod. Concretely, we have the lemmas tsum_sum, tsum_prod, tsum_prod' which want to be multiplicativised to tprod_prod, tprod_prod, tprod_prod'. I am instead multiplicativising them to tprod_prod'', tprod_prod, tprod_prod'

Another way out would be to rename the existing tsum_prod to tsum_prod_index etc. If that seems reasonable, I think it would make sense in a separate PR.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

Please edit the mathlib4 porting comments to indicate that porting this file is blocked by this refactor; that way we don't end up wasting work porting the old version.

If this becomes on the critical part for porting, it's possible we won't wait for this refactor; but if the comment is in the yaml file then that certainly shouldn't happen without a Zulip discussion.

src/topology/algebra/infinite_sum.lean Outdated Show resolved Hide resolved
@sgouezel
Copy link
Collaborator

sgouezel commented Feb 9, 2023

You say that "The manually additivized lemma names tprod and prodable don't automatically get translated to tsum and summable". Can't you fix that by updating the dictionary of to_additive (Line 202 of tactic/to_additive.lean)?

@YaelDillies YaelDillies added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Feb 9, 2023
@YaelDillies YaelDillies requested a review from a team as a code owner February 10, 2023 01:03
bors bot pushed a commit that referenced this pull request Feb 15, 2023
Over the past five years, `topology.algebra.infinite_sum` has grown pretty big. This PR splits off a third of it to three new files. Precisely, split `topology.algebra.infinite_sum` into:
* `topology.algebra.infinite_sum.basic`: Definitions and theory in monoids. All this will be multiplicativised in #18405.
* `topology.algebra.infinite_sum.ring`: Interaction of infinite sums and (scalar) multiplication. This mostly cannot be multiplicativised.
* `topology.algebra.infinite_sum.order`: Interaction of infinite sums and order. Most of this will be multiplicativised in #18405.

Incidentally, this brings down some files' imports by quite a lot.

Also move the `star` and `mul_opposite` material to the end of the file to facilitate multiplicativisation in #18405.

Johannes wrote some of all these files, except `topology.algebra.infinite_sum.real` whose first lemma I could trace back as coming from #753, with the others coming from #1739.
bors bot pushed a commit that referenced this pull request Feb 15, 2023
Over the past five years, `topology.algebra.infinite_sum` has grown pretty big. This PR splits off a third of it to three new files. Precisely, split `topology.algebra.infinite_sum` into:
* `topology.algebra.infinite_sum.basic`: Definitions and theory in monoids. All this will be multiplicativised in #18405.
* `topology.algebra.infinite_sum.ring`: Interaction of infinite sums and (scalar) multiplication. This mostly cannot be multiplicativised.
* `topology.algebra.infinite_sum.order`: Interaction of infinite sums and order. Most of this will be multiplicativised in #18405.

Incidentally, this brings down some files' imports by quite a lot.

Also move the `star` and `mul_opposite` material to the end of the file to facilitate multiplicativisation in #18405.

Johannes wrote some of all these files, except `topology.algebra.infinite_sum.real` whose first lemma I could trace back as coming from #753, with the others coming from #1739.
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Feb 15, 2023
@mathlib-dependent-issues-bot
Copy link
Collaborator

This PR/issue depends on:

@eric-wieser eric-wieser added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 16, 2023
@YaelDillies YaelDillies added awaiting-CI The author would like to see what CI has to say before doing more work. and removed merge-conflict Please `git merge origin/master` then a bot will remove this label. labels Feb 16, 2023
@eric-wieser
Copy link
Member

Can you update the PR description to reflect the file split now having happened already?

@YaelDillies
Copy link
Collaborator Author

Thank you, I forgot.

@YaelDillies
Copy link
Collaborator Author

I don't understand why I am getting all those elaboration timeouts 😢
I tried fixing the one in measure_theory.integral.set_integral for a while to no avail.

@YaelDillies YaelDillies added the help-wanted The author needs attention to resolve issues label Feb 18, 2023
@kim-em kim-em added the wait-requested-on #port-comments requests that a port waits on this PR. label May 24, 2023
@github-actions github-actions bot added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label May 26, 2023
@collares
Copy link
Collaborator

collares commented May 26, 2023

All non-trivial changes in this PR are to files that were ported in early March, so I am removing the wait-requested-on label.

@collares collares removed the wait-requested-on #port-comments requests that a port waits on this PR. label May 26, 2023
@kim-em kim-em added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
@kim-em kim-em removed request for a team August 6, 2023 09:54
@YaelDillies
Copy link
Collaborator Author

This will need redoing in Lean 4 and it seems we haven't yet decided what multiplicativising should even look like.

@YaelDillies YaelDillies deleted the tprod branch March 23, 2024 21:41
mathlib-bors bot pushed a commit to leanprover-community/mathlib4 that referenced this pull request Mar 30, 2024
Last year, YaelDillies made a pull request to mathlib3 that unfortunately never got merged in: leanprover-community/mathlib3#18405. This is the mathlib4 version of that pull request.

We define arbitrarily indexed products in a commutative monoid with a topology. This is done by "multiplicativizing" the currently existing definitions and theorems about arbitrarily indexed sums. That is, the existing code is rewritten in the multiplicative setting, and the original definitions and theorems are recovered using `@[to_additive]`. Please see this thread on Zulip for information on why this approach was chosen: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Infinite.20products

As YaelDillies wrote in the description of leanprover-community/mathlib3#18405, there are a few small technical issues that arise when directly "multiplicativizing" theorems in this way:
- I have renamed `cauchySeq_finset_iff_vanishing` to `cauchySeq_finset_iff_sum_vanishing` to make the name multiplicativizable. This is slightly different from the name `cauchy_seq_finset_sum_iff_vanishing` that YaelDillies used, and it is meant to parallel the existing name `cauchySeq_finset_iff_tsum_vanishing`.
- Currently, on master, there is a theorem called `tsum_sum` about taking the `tsum` of a `sum`, and a theorem called `tsum_prod` about taking a `tsum` on a product of two index sets. I have called the multiplicative versions `tprod_of_prod` and `tprod_prod`. This is slightly different from the names `tprod_prod''` and `tprod_prod` that YaelDillies used. eric-wieser suggested renaming `tsum_prod` to `tsum_prod_index` to get around this issue, which I can do in a separate pull request.
Louddy pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 15, 2024
Last year, YaelDillies made a pull request to mathlib3 that unfortunately never got merged in: leanprover-community/mathlib3#18405. This is the mathlib4 version of that pull request.

We define arbitrarily indexed products in a commutative monoid with a topology. This is done by "multiplicativizing" the currently existing definitions and theorems about arbitrarily indexed sums. That is, the existing code is rewritten in the multiplicative setting, and the original definitions and theorems are recovered using `@[to_additive]`. Please see this thread on Zulip for information on why this approach was chosen: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Infinite.20products

As YaelDillies wrote in the description of leanprover-community/mathlib3#18405, there are a few small technical issues that arise when directly "multiplicativizing" theorems in this way:
- I have renamed `cauchySeq_finset_iff_vanishing` to `cauchySeq_finset_iff_sum_vanishing` to make the name multiplicativizable. This is slightly different from the name `cauchy_seq_finset_sum_iff_vanishing` that YaelDillies used, and it is meant to parallel the existing name `cauchySeq_finset_iff_tsum_vanishing`.
- Currently, on master, there is a theorem called `tsum_sum` about taking the `tsum` of a `sum`, and a theorem called `tsum_prod` about taking a `tsum` on a product of two index sets. I have called the multiplicative versions `tprod_of_prod` and `tprod_prod`. This is slightly different from the names `tprod_prod''` and `tprod_prod` that YaelDillies used. eric-wieser suggested renaming `tsum_prod` to `tsum_prod_index` to get around this issue, which I can do in a separate pull request.
atarnoam pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 16, 2024
Last year, YaelDillies made a pull request to mathlib3 that unfortunately never got merged in: leanprover-community/mathlib3#18405. This is the mathlib4 version of that pull request.

We define arbitrarily indexed products in a commutative monoid with a topology. This is done by "multiplicativizing" the currently existing definitions and theorems about arbitrarily indexed sums. That is, the existing code is rewritten in the multiplicative setting, and the original definitions and theorems are recovered using `@[to_additive]`. Please see this thread on Zulip for information on why this approach was chosen: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Infinite.20products

As YaelDillies wrote in the description of leanprover-community/mathlib3#18405, there are a few small technical issues that arise when directly "multiplicativizing" theorems in this way:
- I have renamed `cauchySeq_finset_iff_vanishing` to `cauchySeq_finset_iff_sum_vanishing` to make the name multiplicativizable. This is slightly different from the name `cauchy_seq_finset_sum_iff_vanishing` that YaelDillies used, and it is meant to parallel the existing name `cauchySeq_finset_iff_tsum_vanishing`.
- Currently, on master, there is a theorem called `tsum_sum` about taking the `tsum` of a `sum`, and a theorem called `tsum_prod` about taking a `tsum` on a product of two index sets. I have called the multiplicative versions `tprod_of_prod` and `tprod_prod`. This is slightly different from the names `tprod_prod''` and `tprod_prod` that YaelDillies used. eric-wieser suggested renaming `tsum_prod` to `tsum_prod_index` to get around this issue, which I can do in a separate pull request.
uniwuni pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 19, 2024
Last year, YaelDillies made a pull request to mathlib3 that unfortunately never got merged in: leanprover-community/mathlib3#18405. This is the mathlib4 version of that pull request.

We define arbitrarily indexed products in a commutative monoid with a topology. This is done by "multiplicativizing" the currently existing definitions and theorems about arbitrarily indexed sums. That is, the existing code is rewritten in the multiplicative setting, and the original definitions and theorems are recovered using `@[to_additive]`. Please see this thread on Zulip for information on why this approach was chosen: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Infinite.20products

As YaelDillies wrote in the description of leanprover-community/mathlib3#18405, there are a few small technical issues that arise when directly "multiplicativizing" theorems in this way:
- I have renamed `cauchySeq_finset_iff_vanishing` to `cauchySeq_finset_iff_sum_vanishing` to make the name multiplicativizable. This is slightly different from the name `cauchy_seq_finset_sum_iff_vanishing` that YaelDillies used, and it is meant to parallel the existing name `cauchySeq_finset_iff_tsum_vanishing`.
- Currently, on master, there is a theorem called `tsum_sum` about taking the `tsum` of a `sum`, and a theorem called `tsum_prod` about taking a `tsum` on a product of two index sets. I have called the multiplicative versions `tprod_of_prod` and `tprod_prod`. This is slightly different from the names `tprod_prod''` and `tprod_prod` that YaelDillies used. eric-wieser suggested renaming `tsum_prod` to `tsum_prod_index` to get around this issue, which I can do in a separate pull request.
callesonne pushed a commit to leanprover-community/mathlib4 that referenced this pull request Apr 22, 2024
Last year, YaelDillies made a pull request to mathlib3 that unfortunately never got merged in: leanprover-community/mathlib3#18405. This is the mathlib4 version of that pull request.

We define arbitrarily indexed products in a commutative monoid with a topology. This is done by "multiplicativizing" the currently existing definitions and theorems about arbitrarily indexed sums. That is, the existing code is rewritten in the multiplicative setting, and the original definitions and theorems are recovered using `@[to_additive]`. Please see this thread on Zulip for information on why this approach was chosen: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Infinite.20products

As YaelDillies wrote in the description of leanprover-community/mathlib3#18405, there are a few small technical issues that arise when directly "multiplicativizing" theorems in this way:
- I have renamed `cauchySeq_finset_iff_vanishing` to `cauchySeq_finset_iff_sum_vanishing` to make the name multiplicativizable. This is slightly different from the name `cauchy_seq_finset_sum_iff_vanishing` that YaelDillies used, and it is meant to parallel the existing name `cauchySeq_finset_iff_tsum_vanishing`.
- Currently, on master, there is a theorem called `tsum_sum` about taking the `tsum` of a `sum`, and a theorem called `tsum_prod` about taking a `tsum` on a product of two index sets. I have called the multiplicative versions `tprod_of_prod` and `tprod_prod`. This is slightly different from the names `tprod_prod''` and `tprod_prod` that YaelDillies used. eric-wieser suggested renaming `tsum_prod` to `tsum_prod_index` to get around this issue, which I can do in a separate pull request.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-CI The author would like to see what CI has to say before doing more work. awaiting-review The author would like community review of the PR help-wanted The author needs attention to resolve issues modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. t-algebra Algebra (groups, rings, fields etc) t-topology Topological spaces, uniform spaces, metric spaces, filters too-late This PR was ready too late for inclusion in mathlib3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants