Alphabeta Math
TheoremStatement: AI-adaptedProof: AI-generatedSession-authored (Fable 5 assisted)precheck passjudge pass (z-ai/glm-5.2)audited 2026-07-29
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

For m1m \ge 1 the number of weak compositions of nn into mm parts is (n+m1m1)\binom{n+m-1}{m-1}, and the number of compositions is (n1m1)\binom{n-1}{m-1} for n1n \ge 1

Statement

Let m1m \ge 1 and write m=σ(M)m = \sigma(M), so M=m1M = m-1. Then for every nNn \in \mathbb{N}

W(n,m)=(n+m1m1)=(n+MM),\big\lvert\mathcal{W}(n,m)\big\rvert = \binom{n+m-1}{\,m-1\,} = \binom{n+M}{M},

and the map k{(j<σ(i)kj)+i : i<M}k \mapsto \big\{\, \big(\sum_{j<\sigma(i)} k_j\big) + i \ :\ i < M \,\big\} is a bijection of W(n,m)\mathcal{W}(n,m) onto the set of MM-element subsets of n+Mn+M.

Moreover, for m1m \ge 1 and n1n \ge 1,

C(n,m)=(n1m1).\big\lvert\mathcal{C}(n,m)\big\rvert = \binom{n-1}{\,m-1\,}.

The hypothesis m1m \ge 1 is not decoration. At m=0m = 0 the expression (n+m1m1)\binom{n+m-1}{m-1} would require the value m1m-1 at m=0m = 0, and Compositions and weak compositions of a natural number into a fixed number of parts records the true counts there: W(0,0)=1\lvert\mathcal{W}(0,0)\rvert = 1 and W(n,0)=0\lvert\mathcal{W}(n,0)\rvert = 0 for n1n \ge 1. The hypothesis n1n \ge 1 in the second display is equally load bearing: at n=0n = 0, m=1m = 1 the formula would give (00)=1\binom{0}{0} = 1 while C(0,1)=\mathcal{C}(0,1) = \varnothing.

Facts & Assumptions

Given: Naturals nn and m=σ(M)m = \sigma(M) with MNM \in \mathbb{N}; the sets W(n,m)\mathcal{W}(n,m) and C(n,m)\mathcal{C}(n,m) of Compositions and weak compositions of a natural number into a fixed number of parts; and the truncated difference of Finite sums and finite products of natural numbers, k<nak\sum_{k<n} a_k and k<nak\prod_{k<n} a_k in N\mathbb{N}.

[L2]

Finite sums in N\mathbb{N} (Finite sums and finite products of natural numbers, k<nak\sum_{k<n} a_k and k<nak\prod_{k<n} a_k in N\mathbb{N}, Laws of finite sums and products in N\mathbb{N}, and ι(k<nak)=k<nι(ak)\iota\big(\sum_{k<n} a_k\big) = \sum_{k<n} \iota(a_k)): the recursion clauses; additivity; the constant clause k<Nc=Nc\sum_{k<N} c = N\cdot c; splitting at pNp \le N; and the fact that a partial sum j<Pkj\sum_{j<P}k_j with PNP \le N satisfies j<Pkjj<Nkj\sum_{j<P}k_j \le \sum_{j<N}k_j, which is splitting together with xx+tx \le x + t.

[L3]

Binomial coefficients (The set [A]k[A]^{k} of kk-element subsets and the binomial coefficient (nk):=[n]k\binom{n}{k} := \lvert [n]^{k}\rvert): [X]j=(Xj)\lvert [X]^{j}\rvert = \binom{\lvert X\rvert}{j}; (N0)=1\binom{N}{0} = 1; (Nj)=0\binom{N}{j} = 0 for j>Nj > N.

[L4]

The hockey-stick identity i<σ(N)(ij)=(σ(N)σ(j))\sum_{i<\sigma(N)}\binom{i}{j} = \binom{\sigma(N)}{\sigma(j)} (Pascal's rule (n+1k+1)=(nk)+(nk+1)\binom{n+1}{k+1} = \binom{n}{k} + \binom{n}{k+1}, and the hockey-stick identity in(ik)=(n+1k+1)\sum_{i \le n}\binom{i}{k} = \binom{n+1}{k+1}, clause 2).

[L7]

Maps (Injection, surjection, bijection, Equinumerous sets, ABA \approx B and ABA \preceq B): a map with a two-sided inverse is a bijection; an injection is a bijection onto its image.

[L8]

Arithmetic and order in N\mathbb{N}: σ(a)=a+1\sigma(a) = a+1; a+σ(b)=σ(a+b)a + \sigma(b) = \sigma(a+b); addition is commutative and cancellative; aba \le b and bcb \le c give aca \le c; trichotomy; a0a \ne 0 is the same as 1a1 \le a (Order on the natural numbers, Addition is cancellative, Addition is commutative, Order is compatible with addition, Trichotomy of the order on N\mathbb{N}, Discreteness: σ(n)\sigma(n) is the immediate successor, The natural numbers N\mathbb{N} (von Neumann)).

[L9]

Every nonempty subset of N\mathbb{N} has a least element (The well-ordering principle).

Proof

technique · induction
1.1

The last-part decomposition, valid for every MNM \in \mathbb{N} and every nn. The map k(i<Mki, kM)k \mapsto \big(\sum_{i<M}k_i,\ k\restriction M\big) sends W(n,σ(M))\mathcal{W}(n,\sigma(M)) into the union of the pairwise disjoint sets {j}×W(j,M)\{j\}\times\mathcal{W}(j,M) for j<σ(n)j < \sigma(n): writing j:=i<Mkij := \sum_{i<M}k_i, the recursion clause gives j+kM=nj + k_M = n, so jnj \le n and kMW(j,M)k \restriction M \in \mathcal{W}(j,M). Its two-sided inverse sends (j,κ)(j,\kappa) to the tuple extending κ\kappa by the value njn-j at MM, whose sum is j+(nj)=nj + (n-j) = n. Hence W(n,σ(M))=j<σ(n)W(j,M)\lvert\mathcal{W}(n,\sigma(M))\rvert = \sum_{j<\sigma(n)}\lvert\mathcal{W}(j,M)\rvert by [L5].

L2L5L7L8construct
1.2

Base case, M=0M = 0, that is m=1m = 1. A weak composition of nn into one part is a function k:1Nk : 1 \to \mathbb{N} with i<1ki=k0=n\sum_{i<1}k_i = k_0 = n, and there is exactly one such function; so W(n,1)=1=(n+00)\lvert\mathcal{W}(n,1)\rvert = 1 = \binom{n+0}{0} by [L3].

baseL2L3
1.3

Inductive hypothesis: fix MM and assume W(n,σ(M))=(n+MM)\lvert\mathcal{W}(n,\sigma(M))\rvert = \binom{n+M}{M} for every nNn \in \mathbb{N}.

ih
1.4

A reindexing identity: j<σ(n)(j+MM)=i<σ(n+M)(iM)\sum_{j<\sigma(n)}\binom{j+M}{M} = \sum_{i<\sigma(n+M)}\binom{i}{M}. Split the right-hand side at p=Mp = M, legitimate since Mσ(n+M)M \le \sigma(n+M): it becomes i<M(iM)+j<σ(n+M)M(M+jM)\sum_{i<M}\binom{i}{M} + \sum_{j<\sigma(n+M)-M}\binom{M+j}{M}. The first sum vanishes, every term being (iM)=0\binom{i}{M} = 0 for i<Mi < M by [L3] and a sum of zeros being 00 by the constant clause; and σ(n+M)M=σ(n)\sigma(n+M)-M = \sigma(n), because M+σ(n)=σ(M+n)=σ(n+M)M + \sigma(n) = \sigma(M+n) = \sigma(n+M).

L2L3L8
2.1

Inductive step. Applying step 1.1 with σ(M)\sigma(M) in place of MM, then the hypothesis of step 1.3, then step 1.4 and finally the hockey-stick identity [L4] with N=n+MN = n+M and j=Mj = M: W(n,σ(σ(M)))=j<σ(n)W(j,σ(M))=j<σ(n)(j+MM)=i<σ(n+M)(iM)=(σ(n+M)σ(M))=(n+σ(M)σ(M))\lvert\mathcal{W}(n,\sigma(\sigma(M)))\rvert = \sum_{j<\sigma(n)}\lvert\mathcal{W}(j,\sigma(M))\rvert = \sum_{j<\sigma(n)}\binom{j+M}{M} = \sum_{i<\sigma(n+M)}\binom{i}{M} = \binom{\sigma(n+M)}{\sigma(M)} = \binom{n+\sigma(M)}{\sigma(M)}, the last equality because σ(n+M)=n+σ(M)\sigma(n+M) = n+\sigma(M). That is the claim at σ(M)\sigma(M).

step 1.1step 1.3step 1.4L4L8
3.1

By step 1.2, step 2.1 and induction, W(n,σ(M))=(n+MM)\lvert\mathcal{W}(n,\sigma(M))\rvert = \binom{n+M}{M} for every MM and every nn, which is the first display since m=σ(M)m = \sigma(M) and M=m1M = m-1.

step 1.2step 2.1L1
4.1

The explicit bijection. For kW(n,σ(M))k \in \mathcal{W}(n,\sigma(M)) and i<Mi < M put si:=(j<σ(i)kj)+is_i := \big(\sum_{j<\sigma(i)}k_j\big) + i and S(k):={si:i<M}S(k) := \{\, s_i : i < M \,\}. The list is strictly increasing, since sσ(i)=(j<σ(i)kj+kσ(i))+σ(i)=si+kσ(i)+1s_{\sigma(i)} = \big(\sum_{j<\sigma(i)}k_j + k_{\sigma(i)}\big) + \sigma(i) = s_i + k_{\sigma(i)} + 1; and si<n+Ms_i < n+M, since j<σ(i)kjj<σ(M)kj=n\sum_{j<\sigma(i)}k_j \le \sum_{j<\sigma(M)}k_j = n by [L2] and iM1i \le M-1. So S(k)S(k) is a subset of n+Mn+M with exactly MM elements, and SS maps W(n,σ(M))\mathcal{W}(n,\sigma(M)) into [n+M]M[\,n+M\,]^{M}. It is injective: a strictly increasing list enumerating a finite subset of N\mathbb{N} is determined by that subset, since its first entry is the least element and each later entry is the least element strictly above the previous one ([L9] and induction), so S(k)=S(k~)S(k) = S(\tilde k) forces si=s~is_i = \tilde s_i for all i<Mi < M; then k0=s0k_0 = s_0 and kσ(i)=sσ(i)si1k_{\sigma(i)} = s_{\sigma(i)} - s_i - 1 recover kk on MM, and kM=nj<Mkjk_M = n - \sum_{j<M}k_j recovers the last part. Since both sets have (n+MM)\binom{n+M}{M} elements by step 3.1 and [L3], the image of SS is a subset of [n+M]M[\,n+M\,]^{M} of the same cardinality, hence all of it by [L6]. So SS is a bijection.

step 3.1L2L3L6L7L8L9construct
4.2

The count of compositions, for m=σ(M)1m = \sigma(M) \ge 1 and n1n \ge 1. If mnm \le n, the map kkk \mapsto k' with ki:=ki1k'_i := k_i - 1 sends C(n,m)\mathcal{C}(n,m) into W(nm,m)\mathcal{W}(n-m,m): each ki1k_i \ge 1, so ki=ki+1k_i = k'_i + 1, and i<mki=i<mki+i<m1=i<mki+m\sum_{i<m}k_i = \sum_{i<m}k'_i + \sum_{i<m}1 = \sum_{i<m}k'_i + m by additivity and the constant clause, whence i<mki=nm\sum_{i<m}k'_i = n-m. Its two-sided inverse adds 11 to every part. So C(n,m)=W(nm,m)=((nm)+MM)\lvert\mathcal{C}(n,m)\rvert = \lvert\mathcal{W}(n-m,m)\rvert = \binom{(n-m)+M}{M} by step 3.1, and (nm)+M=n1(n-m)+M = n-1 because (nm)+m=n(n-m)+m = n and M=m1M = m-1 with m1m \ge 1. If instead m>nm > n, then every kC(n,m)k \in \mathcal{C}(n,m) would satisfy n=i<mkii<m1=mn = \sum_{i<m}k_i \ge \sum_{i<m}1 = m by monotonicity, which is false; so C(n,m)=\mathcal{C}(n,m) = \varnothing, and (n1m1)=0\binom{n-1}{m-1} = 0 as well, since m>n1m > n \ge 1 gives m1>n1m-1 > n-1. In both cases C(n,m)=(n1m1)\lvert\mathcal{C}(n,m)\rvert = \binom{n-1}{m-1}.

step 3.1L2L3L6L7L8
5.1

The count of weak compositions is step 3.1, the bijection realising it is step 4.1, and the count of compositions is step 4.2.

step 3.1step 4.1step 4.2discharge-induction

Remarks

  • The picture behind SS. Lay out nn stars and MM bars in a row of n+Mn+M places; the bars split the stars into σ(M)=m\sigma(M) = m runs, whose lengths are the parts. The set S(k)S(k) is the set of positions of the bars, and step 4.1 is that picture made precise. Surjectivity is obtained from the count rather than by constructing the inverse directly, which spares an appeal to the increasing enumeration of an arbitrary subset.
k=(2;0;3)?????0123456S(k)=f2;3gµ7
  • Why the count is proved by induction and not by the bijection alone. Building the inverse of SS by hand needs the increasing enumeration of an arbitrary MM-element subset of n+Mn+M, which is more machinery than the hockey-stick induction. The induction gives the number, and the number then gives the surjectivity of SS.

  • Both hypotheses are visible. The failure at m=0m = 0 is recorded on the companion page as a false statement; the failure at n=0n = 0 of the composition formula is recorded in the Statement above.

Depends on

Used by

Dependency tree · next 3 levels

Direct dependencies and their dependencies through the next three levels: 84 results over 32 levels. An arrow runs from a result to what uses it, and this result sits at the bottom with a heavier outline. Click the chart to enlarge it.

Sources