[Merged by Bors] - feat(Combinatorics): Glaisher's theorem#30618
[Merged by Bors] - feat(Combinatorics): Glaisher's theorem#30618wwylele wants to merge 3 commits intoleanprover-community:masterfrom
Conversation
PR summary be5e7c6163Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
This PR/issue depends on: |
557b7de to
8998668
Compare
|
This is now ready for review |
|
This pull request has conflicts, please merge |
b-mehta
left a comment
There was a problem hiding this comment.
This looks good to me, but I'd like to hear @AntoineChambert-Loir's opinion on the two new power series lemmas. I think they're useful special cases of PowerSeries.WithPiTopology.multipliable_one_add_of_tendsto_order_atTop_nhds_top, and so should be included in the same way we have "specific limits" and "special functions" in mathlib; but it may be that there's a more useful version I'm not currently seeing.
|
|
||
| @[expose] public section | ||
|
|
||
| variable (R) [TopologicalSpace R] [T2Space R] |
There was a problem hiding this comment.
The results here should not depend on the choice of a topological structure on R, nor that it is T2.
There was a problem hiding this comment.
For theorems that doesn't use topology in the statement (powerSeriesMk_card_restricted_eq_powerSeriesMk_card_countRestricted and card_restricted_eq_card_countRestricted), I dropped [TopologicalSpace R] from them. All other intermediate lemmas uses the topology in the statement for the infinite sum (and T2 to ensure the sum is unique).
I can change the entire file to just use discrete topology, but isn't it weaker than what it is written here? Having [TopologicalSpace R] as the theorem input precisely means "the results are independent on the choice of a topological structure, and it is true for any structure"
There was a problem hiding this comment.
Yes, but the user will have to provide a structure of a topological space to apply the result.
There was a problem hiding this comment.
Yes, but then the user can just provide discrete topology. This provide the user the options to use different topology if they already have one in their context.
| $$ | ||
| \prod_{i \mem p} \sum_{j = 0}^{\infty} X^{ij} | ||
| $$ -/ | ||
| theorem hasProd_powerSeriesMk_card_restricted [IsTopologicalSemiring R] |
There was a problem hiding this comment.
I would like that the mention to the topological structure be erased from the statement. You can endow R with the discrete structure in the proof if needed.
There was a problem hiding this comment.
See the same comment above why I think that would make the lemma weaker
| \prod_{i = 1}^{\infty} \sum_{j = 0}^{m - 1} X^{ij} | ||
| $$ -/ | ||
| theorem hasProd_powerSeriesMk_card_countRestricted {m : ℕ} (hm : 0 < m) : | ||
| HasProd (fun i ↦ ∑ j ∈ range m, X ^ ((i + 1) * j)) |
There was a problem hiding this comment.
Before stating HasProd, which relies on some topology, you could state the algebraic property that implies the existence of this product (this stuff minus one has order going to infinity).
There was a problem hiding this comment.
This is proved as a direct consequence of hasProd_genFun instead of arguing about the order directly (which was done inside hasProd_genFun). I don't think I should restate the argument about the order
There was a problem hiding this comment.
I think making the order statement about genFun would make sense then
There was a problem hiding this comment.
@b-mehta the problem is that hasProd_genFun was not proved using the fact about the order either, but it was proved by directly comparing the coefficients at the limit between LHS and RHS, and I am pretty sure it is shorter that way. Do I still need to state the fact about the order separately? It don't find any value in it
There was a problem hiding this comment.
The value, again, is that the result can be used without reference to a topology on the ring. docs#MvPowerSeries.WithPiTopology.summable_of_tendsto_order_atTop_nhds_top will show the relation, and I am surprised not to find the converse when the topology is discrete. But that means you are not forced to change your proof.
There was a problem hiding this comment.
The usage of WithPiTopology.summable_of_tendsto_order_atTop_nhds_top in summable_genFun_term is to show the inner infinite summation makes sense, but the proof of the outer product doesn't use argument about the order. As for application in countRestricted, the inner summation collapse to a finite one so no need to prove the summability any more. Though, for hasProd_powerSeriesMk_card_restricted, the inner summation is still infinite, so I can see the argument of giving the direct statement about the order there.
In any case, if you feel strongly about it, I can add all the facts about order. I just want to clarify how the order argument is used
There was a problem hiding this comment.
I feel indeed strongly about it, and maybe I shouldn't. To give an analogy (and it is more than that), this PR defines a constant as a function of an additional parameter — on which it does not depend. (This would be off topic, but there exist power series with rational coefficients that converge both in C and Q_5, to different elements, and one should be able to arrange that their limits are distinct rational numbers.)
There was a problem hiding this comment.
So I started adding lemma about the order of involved power series. Here is some additional thoughts
tendsto_order_genFun_term_atTop_nhds_topfor summation in thegenFun. Added without problem in the last commit- order argument for the multiplication in
genFun. The statement would look like
theorem tendsto_order_genFun_atTop_nhds_top (f : ℕ → ℕ → R) :
Tendsto (fun i ↦ (∑' j, f (i + 1) (j + 1) • (X : R⟦X⟧) ^ ((i + 1) * (j + 1))).order) atTop (nhds ⊤) := by
sorry
But this has a few issues
- To even state it, it already has
∑'inside and thus require topology, nullifying the goal to state only about algebra - Naturally it needs some lemma about
PowerSeries.orderand tsum. Do I need to create another dependent PR, even though this just goes unused by the main theorem here? Can I do that later?
- The specialized version of the summation for
Partition.restrictwould be just thatfun j ↦ X ^ ((i + 1) * j)increases in order, but this looks too trivial to be a lemma (and again, it is unused)
There was a problem hiding this comment.
- Another possible lemma is for the multipliability related to
hasProd_powerSeriesMk_card_countRestricted, which doesn't involve infinite sum and is indeed purely algebraic. However, the hypothetical lemma
theorem tendsto_order_sum_X_pow_sub_one_atTop_nhds_top (m : ℕ) :
Filter.Tendsto (fun i ↦ ((∑ j ∈ range m, (X : R⟦X⟧) ^ ((i + 1) * j)) - (1 : R⟦X⟧)).order) Filter.atTop (nhds ⊤)
doesn't type check, because the entire section has been in Semiring R, and there is no subtraction. I could either make this specifically for Ring R, or just remove the first term from the sum so it is (fun i ↦ ((∑ j ∈ Finset.Ico 1 m, (X : R⟦X⟧) ^ ((i + 1) * j))).order), but now it loses the connection with hasProd_powerSeriesMk_card_countRestricted and just be there for no reason.
There was a problem hiding this comment.
I see your points and I believe they beat mine.
Ad 1. OK
Ad 2. I have no clear answer to propose.
Ad 3. Another possibility would be to define a variant of order that doesn't look at the initial term, etc., but while this may be interesting in the long range, this would be useless work for here only.
| · simp_rw [genFun, countRestricted, card_filter, Finsupp.prod, prod_boole] | ||
| simp | ||
|
|
||
| theorem multipliable_powerSeriesMk_card_countRestricted (m : ℕ) : |
There was a problem hiding this comment.
Same remark.
| section Ring | ||
| variable [CommRing R] [NoZeroDivisors R] | ||
|
|
||
| private theorem aux_mul_one_sub_X_pow [IsTopologicalRing R] {m : ℕ} (hm : 0 < m) : |
There was a problem hiding this comment.
again, I am not sure the topological structure is used here.
|
Hi @AntoineChambert-Loir and @b-mehta, sorry that I didn't agree with the last batch of comment. They seems to contradict to advice I received (do the more general version of the theorem; only include essential code change in PR to make it easier to review). But I don't have strong opinion on them and am ok to accept them if you feel strongly about them. Please let me know if I should make the change anyway. |
|
To conclude here, LGTM. The points I wanted to make are not worth the API that would be necessary to implement them. The solution to require the user to add some topology (even if it is less needed than what it looks) is clearly simpler. |
This proves Glaisher's theorem, one of the 1000+ theorems. It is also a generalization of [Euler's partition theorem](https://github.com/leanprover-community/mathlib4/blob/master/Archive/Wiedijk100Theorems/Partition.lean), which can be rewritten as a collorary of this (will be in a different PR)
|
Pull request successfully merged into master. Build succeeded: |
This proves Glaisher's theorem, one of the 1000+ theorems. It is also a generalization of Euler's partition theorem, which can be rewritten as a collorary of this (will be in a different PR)