Partition number arrays
DefinitionExtension of a vector by zero#✓fully proved
A vector \((a_0, \dots, a_{n-1})\) of natural numbers extends to the sequence \(\mathbb{N} \to \mathbb{N}\) that sends \(j\) to \(a_j\) for \(j < n\) and to \(0\) for \(j \ge n\).
DefinitionIndex-weighted partial sum#✓fully proved
For \(n \in \mathbb{N}\) and a function \(f \colon \mathbb{N} \to \mathbb{N}\), this is the sum \(\sum_{i=0}^{n-1} (i + 1)\,f(i)\).
def weightSumAux : Nat → (Nat → Nat) → Nat
| 0, _ => 0
| n + 1, f => weightSumAux n f + (n + 1) * f n
Used by 1
DefinitionSum of the first n values of a sequence#✓fully proved
For a natural number \(n\) and a sequence \(f \colon \mathbb{N} \to \mathbb{N}\), this is the natural number \(\sum_{i=0}^{n-1} f(i)\).
Used by 1
DefinitionWeighted size of a multiplicity vector#✓fully proved
For \(n \in \mathbb{N}\) and nonnegative integers \(a_1, \dots, a_n\), the weighted size is \(\sum_{j=1}^{n} j\,a_j\), the sum of the parts of the partition with \(a_j\) parts equal to \(j\).
def multWeightSum (n : Nat) (a : Fin n → Nat) : Nat :=
weightSumAux n (extendA n a)
def weightSumAux : Nat → (Nat → Nat) → Nat
| 0, _ => 0
| n + 1, f => weightSumAux n f + (n + 1) * f n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:32
def extendA (n : Nat) (a : Fin n → Nat) (j : Nat) : Nat :=
if h : j < n then a ⟨j, h⟩ else 0
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:26
Uses 2 · Used by 1
DefinitionNumber of parts of an exponent vector#✓fully proved
For a vector \((a_1, \dots, a_n)\) of natural numbers, this is the natural number \(\sum_{j=1}^{n} a_j\).
When \(a_j\) is the number of parts equal to \(j\) in a partition of \(n\), this is the number of parts of the partition.
def countSum (n : Nat) (a : Fin n → Nat) : Nat :=
countSumAux n (extendA n a)
def countSumAux : Nat → (Nat → Nat) → Nat
| 0, _ => 0
| n + 1, f => countSumAux n f + f n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:39
def extendA (n : Nat) (a : Fin n → Nat) (j : Nat) : Nat :=
if h : j < n then a ⟨j, h⟩ else 0
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:26
Uses 2 · Used by 1
StructurePartition multiplicity vectors#✓fully proved
A partition multiplicity vector of \(n \in \mathbb{N}\) is a tuple \((a_1, \dots, a_n)\) of nonnegative integers with \(\sum_{j=1}^{n} j\,a_j = n\). It encodes the partition of \(n\) that has \(a_j\) parts equal to \(j\).
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
def multWeightSum (n : Nat) (a : Fin n → Nat) : Nat :=
weightSumAux n (extendA n a)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:46
vec : Fin n → Nat
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:61
Uses 1 · Used by 7
DefinitionNumber of parts of a partition#✓fully proved
Let \((a_1, \dots, a_n)\) be a partition multiplicity vector of \(n\), that is, nonnegative integers with \(\sum_{j=1}^{n} j\,a_j = n\), where \(a_j\) counts the parts equal to \(j\). Its part count is \(\sum_{j=1}^{n} a_j\).
def partCount {n : Nat} (p : PartitionMultiplicity n) : Nat :=
countSum n p.vec
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def countSum (n : Nat) (a : Fin n → Nat) : Nat :=
countSumAux n (extendA n a)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:52
Uses 2
DefinitionGeneralized Stirling numbers of the second kind with parameter k#✓fully proved
For a positive integer \(k\), the numbers \(S_2(k; n, m)\), for natural numbers \(n\) and \(m\), are defined by \(S_2(k; 0, 0) = 1\), by \(S_2(k; 0, m) = 0\) and \(S_2(k; m, 0) = 0\) for \(m \ge 1\), and by
def genStirlingSecond (k : { k : Nat // 0 < k }) : Nat → Nat → Nat
| 0, 0 => 1
| 0, _m + 1 => 0
| _n + 1, 0 => 0
| n + 1, m + 1 =>
((k.val - 1) * n + (m + 1)) * genStirlingSecond k n (m + 1) +
genStirlingSecond k n m
Used by 1
DefinitionFactorial product of a sequence#✓fully proved
For a natural number \(n\) and a sequence \(g \colon \mathbb{N} \to \mathbb{N}\), this is the natural number \(\prod_{i=0}^{n-1} g(i)!\,\bigl((i+1)!\bigr)^{g(i)}\).
def denomProdAux : Nat → (Nat → Nat) → Nat
| 0, _ => 1
| n + 1, g =>
denomProdAux n g * (Nat.factorial (g n) * (Nat.factorial (n + 1)) ^ (g n))
Used by 1
DefinitionFinite power product#✓fully proved
For \(n \in \mathbb{N}\) and functions \(g, f \colon \mathbb{N} \to \mathbb{N}\), this is the product \(\prod_{i=0}^{n-1} f(i)^{g(i)}\), with the convention \(0^0 = 1\).
def powProdAux : Nat → (Nat → Nat) → (Nat → Nat) → Nat
| 0, _, _ => 1
| n + 1, g, f => powProdAux n g f * (f n) ^ (g n)
Used by 1
DefinitionDenominator of the M3 partition number#✓fully proved
Let \(p\) be a partition of \(n\) with multiplicity vector \((a_1, \dots, a_n)\), so that exactly \(a_j\) parts of \(p\) equal \(j\) and \(\sum_j j a_j = n\). The \(M_3\) denominator of \(p\) is the natural number \(\prod_{j=1}^{n} a_j!\,(j!)^{a_j}\).
def m3DenomProd {n : Nat} (p : PartitionMultiplicity n) : Nat :=
denomProdAux n (extendA n p.vec)
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def denomProdAux : Nat → (Nat → Nat) → Nat
| 0, _ => 1
| n + 1, g =>
denomProdAux n g * (Nat.factorial (g n) * (Nat.factorial (n + 1)) ^ (g n))
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:88
def extendA (n : Nat) (a : Fin n → Nat) (j : Nat) : Nat :=
if h : j < n then a ⟨j, h⟩ else 0
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:26
Uses 3 · Used by 1
DefinitionThe M3 partition number#✓fully proved
Let \(p\) be a partition of \(n\) with multiplicity vector \((a_1, \dots, a_n)\), so that exactly \(a_j\) parts of \(p\) equal \(j\) and \(\sum_j j a_j = n\). The number \(M_3(p)\) is the quotient of \(n!\) by \(\prod_{j=1}^{n} a_j!\,(j!)^{a_j}\) in natural-number division.
This division is exact, so \(M_3(p) = n! / \prod_{j=1}^{n} a_j!\,(j!)^{a_j}\).
def M3 {n : Nat} (p : PartitionMultiplicity n) : Nat :=
Nat.factorial n / m3DenomProd p
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def m3DenomProd {n : Nat} (p : PartitionMultiplicity n) : Nat :=
denomProdAux n (extendA n p.vec)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:104
Uses 2 · Used by 2
DefinitionProduct of powers over a partition#✓fully proved
Let \(p\) be a partition of \(n\) with multiplicity vector \((a_1, \dots, a_n)\), so that exactly \(a_j\) parts of \(p\) equal \(j\) and \(\sum_j j a_j = n\). For natural numbers \(f_1, \dots, f_n\), the product of powers of \(f\) over \(p\) is the natural number \(\prod_{j=1}^{n} f_j^{a_j}\).
def arrayPowProd {n : Nat} (p : PartitionMultiplicity n) (f : Fin n → Nat) : Nat :=
powProdAux n (extendA n p.vec) (extendA n f)
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def powProdAux : Nat → (Nat → Nat) → (Nat → Nat) → Nat
| 0, _, _ => 1
| n + 1, g, f => powProdAux n g f * (f n) ^ (g n)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:96
def extendA (n : Nat) (a : Fin n → Nat) (j : Nat) : Nat :=
if h : j < n then a ⟨j, h⟩ else 0
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:26
Uses 3 · Used by 2
DefinitionThe hat M32 partition number array#✓fully proved
Let \(k\) be a positive integer and let \(p\) be a partition of \(n\) with multiplicity vector \((a_1, \dots, a_n)\), so that exactly \(a_j\) parts of \(p\) equal \(j\) and \(\sum_j j a_j = n\). Write \(S_2(k; j, 1)\) for the generalized Stirling numbers of the second kind with parameter \(k\). The entry \(\widehat{M}_{32}(k; p)\) is the natural number \(\prod_{j=1}^{n} S_2(k; j, 1)^{a_j}\).
def hatM32 (k : { k : Nat // 0 < k }) {n : Nat} (p : PartitionMultiplicity n) : Nat :=
arrayPowProd p (fun i => genStirlingSecond k (i.val + 1) 1)
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def arrayPowProd {n : Nat} (p : PartitionMultiplicity n) (f : Fin n → Nat) : Nat :=
powProdAux n (extendA n p.vec) (extendA n f)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:117
def genStirlingSecond (k : { k : Nat // 0 < k }) : Nat → Nat → Nat
| 0, 0 => 1
| 0, _m + 1 => 0
| _n + 1, 0 => 0
| n + 1, m + 1 =>
((k.val - 1) * n + (m + 1)) * genStirlingSecond k n (m + 1) +
genStirlingSecond k n m
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:76
Uses 3 · Used by 1
DefinitionThe partition number array \(M_{32}(k)\)#✓fully proved
Let \(k\) be a positive integer and let \(a = (a_1, \dots, a_n)\) be a partition multiplicity vector of \(n\), that is, nonnegative integers with \(\sum_{j=1}^{n} j\,a_j = n\), where \(a_j\) counts the parts equal to \(j\). Then \(M_{32}(k; a) = M_3(a) \prod_{j=1}^{n} S_2(k; j, 1)^{a_j}\), where \(M_3(a)\) is \(n!\) divided by \(\prod_{j=1}^{n} a_j!\,(j!)^{a_j}\) (the division is exact), and \(S_2(k; j, 1) = \prod_{i=1}^{j-1} ((k - 1)i + 1)\) is the first column of the generalized Stirling numbers of the second kind.
def M32 (k : { k : Nat // 0 < k }) {n : Nat} (p : PartitionMultiplicity n) : Nat :=
M3 p * hatM32 k p
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def M3 {n : Nat} (p : PartitionMultiplicity n) : Nat :=
Nat.factorial n / m3DenomProd p
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:111
def hatM32 (k : { k : Nat // 0 < k }) {n : Nat} (p : PartitionMultiplicity n) : Nat :=
arrayPowProd p (fun i => genStirlingSecond k (i.val + 1) 1)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:123
Uses 3
DefinitionAbsolute first column of the generalized Stirling numbers of the first kind#✓fully proved
For positive integers \(k\) and \(j\), the absolute value \(|S_1(k; j, 1)|\) is defined as the quotient \((j + k - 2)!/(k - 1)!\).
def stirlingFirstAbsFirstCol (k : { k : Nat // 0 < k }) (j : { j : Nat // 0 < j }) : Nat :=
Nat.factorial (j.val + k.val - 2) / Nat.factorial (k.val - 1)
Used by 1
DefinitionThe M31 partition number array#✓fully proved
Let \(k\) be a positive integer and let \(p\) be a partition of \(n\) with multiplicity vector \((a_1, \dots, a_n)\), so that exactly \(a_j\) parts of \(p\) equal \(j\) and \(\sum_j j a_j = n\). Write \(M_3(p)\) for the M3 partition number of \(p\), and for \(j \ge 1\) write \(c_j = (j + k - 2)!/(k - 1)!\), the absolute value of the generalized Stirling number of the first kind \(S_1(k; j, 1)\). The entry \(M_{31}(k; p)\) is the natural number \(M_3(p) \prod_{j=1}^{n} c_j^{a_j}\).
def M31 (k : { k : Nat // 0 < k }) {n : Nat} (p : PartitionMultiplicity n) : Nat :=
M3 p * arrayPowProd p (fun i => stirlingFirstAbsFirstCol k ⟨i.val + 1, Nat.succ_pos _⟩)
structure PartitionMultiplicity (n : Nat) where
/-- Exponent coordinates. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
vec : Fin n → Nat
/-- Weighted-sum certificate. Concept `jis_sem_4bcead3a4bcda58a1d4dbb9f`;
source D3 `jis_352979520d341b10e3330dad`. -/
weighted : multWeightSum n vec = n
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:58
def M3 {n : Nat} (p : PartitionMultiplicity n) : Nat :=
Nat.factorial n / m3DenomProd p
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:111
def arrayPowProd {n : Nat} (p : PartitionMultiplicity n) (f : Fin n → Nat) : Nat :=
powProdAux n (extendA n p.vec) (extendA n f)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:117
def stirlingFirstAbsFirstCol (k : { k : Nat // 0 < k }) (j : { j : Nat // 0 < j }) : Nat :=
Nat.factorial (j.val + k.val - 2) / Nat.factorial (k.val - 1)
MathlibExt/Combinatorics/Enumerative/PartitionNumberArray.lean:136
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.