Skip to content

Commit cc46b34

Browse files
Merge master into nightly-testing
2 parents db12a4c + 6789ae6 commit cc46b34

File tree

11 files changed

+48
-394
lines changed

11 files changed

+48
-394
lines changed

Archive.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import Archive.Wiedijk100Theorems.FriendshipGraphs
7474
import Archive.Wiedijk100Theorems.HeronsFormula
7575
import Archive.Wiedijk100Theorems.InverseTriangleSum
7676
import Archive.Wiedijk100Theorems.Konigsberg
77-
import Archive.Wiedijk100Theorems.Partition
7877
import Archive.Wiedijk100Theorems.PerfectNumbers
7978
import Archive.Wiedijk100Theorems.SolutionOfCubicQuartic
8079
import Archive.Wiedijk100Theorems.SumOfPrimeReciprocalsDiverges

Archive/Wiedijk100Theorems/Partition.lean

Lines changed: 0 additions & 384 deletions
This file was deleted.

Mathlib/Combinatorics/Enumerative/Partition/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ def odds (n : ℕ) : Finset n.Partition := restricted n (¬ Even ·)
220220
def distincts (n : ℕ) : Finset n.Partition :=
221221
Finset.univ.filter fun c => c.parts.Nodup
222222

223+
theorem countRestricted_two (n : ℕ) : countRestricted n 2 = distincts n := by
224+
congrm Finset.univ.filter fun x ↦ ?_
225+
rw [Multiset.nodup_iff_count_le_one]
226+
grind [Multiset.count_eq_zero]
227+
223228
/-- The finset of those partitions in which every part is odd and used at most once. -/
224229
def oddDistincts (n : ℕ) : Finset n.Partition :=
225230
odds n ∩ distincts n

Mathlib/Combinatorics/Enumerative/Partition/Glaisher.lean

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ times.
1717
1818
## Main declarations
1919
* `Nat.Partition.card_restricted_eq_card_countRestricted`: Glaisher's theorem.
20+
* `Nat.Partition.card_odds_eq_card_distincts`: Euler's partition theorem, a special case
21+
of Glaisher's theorem when `m = 2`. This is also Theorem 45 from the
22+
[100 Theorems List](https://www.cs.ru.nl/~freek/100/).
23+
24+
## Proof outline
25+
26+
The proof is based on the generating functions for `restricted` and `countRestricted` partitions,
27+
which turn out to be equal:
28+
29+
$$\prod_{i=1,i\nmid m}^\infty\frac{1}{1-X^i}=\prod_{i=0}^\infty (1+X^{i+1}+\cdots+X^{(m-1)(i+1)})$$
2030
2131
## References
2232
https://en.wikipedia.org/wiki/Glaisher%27s_theorem
@@ -34,7 +44,7 @@ variable [CommSemiring R]
3444

3545
/-- The generating function of `Nat.Partition.restricted n p` is
3646
$$
37-
\prod_{i \mem p} \sum_{j = 0}^{\infty} X^{ij}
47+
\prod_{i \in p} \sum_{j = 0}^{\infty} X^{ij}
3848
$$ -/
3949
theorem hasProd_powerSeriesMk_card_restricted [IsTopologicalSemiring R]
4050
(p : ℕ → Prop) [DecidablePred p] :
@@ -145,4 +155,8 @@ theorem card_restricted_eq_card_countRestricted (n : ℕ) {m : ℕ} (hm : 0 < m)
145155
simpa using PowerSeries.ext_iff.mp
146156
(powerSeriesMk_card_restricted_eq_powerSeriesMk_card_countRestricted ℤ hm) n
147157

158+
theorem card_odds_eq_card_distincts (n : ℕ) : #(odds n) = #(distincts n) := by
159+
simp_rw [← countRestricted_two, odds, even_iff_two_dvd]
160+
exact card_restricted_eq_card_countRestricted n (by norm_num)
161+
148162
end Nat.Partition

Mathlib/Tactic/Linter/PrivateModule.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ See also the type `Lean.ReservedNameAction`, invocations of `registerReservedNam
4747
4848
Note that metaprograms should not add public declarations when run in private scopes. Doing so would
4949
likely be a bug in the metaprogram. As such, we do not perform further checks for automatically
50-
generated declarations such as those in `isAutoDecl`.
50+
generated declarations such as those detected by `isAutoDecl` or `isInternalDetail`, which would
51+
wrongly exclude e.g. public declarations generated by `initialize`.
5152
-/
5253

5354
meta section
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module
2+
3+
import Mathlib.Tactic.Linter.PrivateModule
4+
5+
set_option linter.privateModule true
6+
7+
open Lean
8+
9+
-- Should not fire, since `initialize` creates a genuinely public declaration.
10+
initialize pure ()
11+
12+
/- Check that we have indeed created a declaration, and aren't not linting just due to being an
13+
empty file: -/
14+
/-- info: [initFn✝] -/
15+
#guard_msgs in
16+
run_cmd do
17+
logInfo m!"{(← getEnv).constants.map₂.toArray.map (MessageData.ofConstName ·.1)}"

docs/100.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@
185185
authors: Chris Hughes
186186
45:
187187
title : The Partition Theorem
188-
authors: Bhavik Mehta and Aaron Anderson
189-
decl : Theorems100.partition_theorem
188+
authors: Bhavik Mehta, Aaron Anderson, and Weiyi Wang
189+
decl : Nat.Partition.card_odds_eq_card_distincts
190190
46:
191191
title : The Solution of the General Quartic Equation
192192
decl : Theorems100.quartic_eq_zero_iff

docs/1000.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,8 +1300,8 @@ Q1077741:
13001300

13011301
Q1082910:
13021302
title: Euler's partition theorem
1303-
authors: Bhavik Mehta and Aaron Anderson
1304-
decl: Theorems100.partition_theorem
1303+
authors: Bhavik Mehta, Aaron Anderson, and Weiyi Wang
1304+
decl: Nat.Partition.card_odds_eq_card_distincts
13051305

13061306
Q1095330:
13071307
title: Apéry's theorem

docs/overview.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ Analysis:
373373
First Main Theorem of Value Distribution Theory: 'ValueDistribution.characteristic_sub_characteristic_inv_le'
374374

375375
Distribution theory:
376+
Test functions: 'TestFunction'
376377
Schwartz space: 'SchwartzMap'
378+
Distributions: 'Distribution'
377379

378380
Fourier analysis:
379381
Fourier transform as an integral: 'Real.fourier_eq'

docs/undergrad.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,13 @@ Probability Theory:
586586
# 12.
587587
Distribution calculus:
588588
Spaces $\mathcal{D}(\R^d)$:
589-
smooth functions with compact support on $\R^d$: ''
589+
smooth functions with compact support on $\R^d$: 'TestFunction'
590590
stability by derivation: ''
591591
stability by multiplication by a smooth function: ''
592592
partitions of unity: ''
593593
constructing approximations of probability density functions in spaces of common functions (trig, exp, rational, log, etc): ''
594594
Distributions on $\R^d$:
595-
definition of distributions: ''
595+
definition of distributions: 'Distribution'
596596
locally integrable functions as distributions: ''
597597
derivative of a distribution: ''
598598
Dirac measures: ''

0 commit comments

Comments
 (0)