Alphabeta Math
TheoremStatement: AI-adaptedProof: AI-generatedprecheck 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 m≥1 the number of weak compositions of n into m parts is (n+m−1m−1), and the number of compositions is (n−1m−1) for n≥1

Statement

Let m≥1 and write m=σ(M), so M=m−1. Then for every n∈N

∣W(n,m)∣=(n+m−1 m−1 )=(n+MM),

and the map k↦{ (∑j<σ(i)kj)+i : i<M } is a bijection of W(n,m) onto the set of M-element subsets of n+M.

Moreover, for m≥1 and n≥1,

∣C(n,m)∣=(n−1 m−1 ).

The hypothesis m≥1 is not decoration. At m=0 the expression (n+m−1m−1) would require the value m−1 at m=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 and ∣W(n,0)∣=0 for n≥1. The hypothesis n≥1 in the second display is equally load bearing: at n=0, m=1 the formula would give (00)=1 while C(0,1)=∅.

Facts & Assumptions

Given: Naturals n and m=σ(M) with M∈N; the sets W(n,m) and 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 and ∏k<nak in N.

[L2]

Finite sums in N (Finite sums and finite products of natural numbers, ∑k<nak and ∏k<nak in N, Laws of finite sums and products in N, and ι(∑k<nak)=∑k<nι(ak)): the recursion clauses; additivity; the constant clause ∑k<Nc=N⋅c; splitting at p≤N; and the fact that a partial sum ∑j<Pkj with P≤N satisfies ∑j<Pkj≤∑j<Nkj, which is splitting together with x≤x+t.

[L3]

Binomial coefficients (The set [A]k of k-element subsets and the binomial coefficient (nk):=∣[n]k∣): ∣[X]j∣=(∣X∣j); (N0)=1; (Nj)=0 for j>N.

[L4]

The hockey-stick identity ∑i<σ(N)(ij)=(σ(N)σ(j)) (Pascal's rule (n+1k+1)=(nk)+(nk+1), and the hockey-stick identity ∑i≤n(ik)=(n+1k+1), clause 2).

[L6]

Cardinality and subsets (The cardinality ∣A∣ of a finite set, A subset of a finite set is finite, with ∣B∣≤∣A∣, and equality holds if and only if B=A): transport; a subset of a finite set is finite; a subset of the same cardinality as the whole is the whole.

[L7]

Maps (Injection, surjection, bijection, Equinumerous sets, A≈B and A⪯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: σ(a)=a+1; a+σ(b)=σ(a+b); addition is commutative and cancellative; a≤b and b≤c give a≤c; trichotomy; a≠0 is the same as 1≤a (Order on the natural numbers, Addition is cancellative, Addition is commutative, Order is compatible with addition, Trichotomy of the order on N, Discreteness: σ(n) is the immediate successor, The natural numbers N (von Neumann)).

[L9]

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

Proof

technique · induction
1.1

The last-part decomposition, valid for every M∈N and every n. The map k↦(∑i<Mki, k↾M) sends W(n,σ(M)) into the union of the pairwise disjoint sets {j}×W(j,M) for j<σ(n): writing j:=∑i<Mki, the recursion clause gives j+kM=n, so j≤n and k↾M∈W(j,M). Its two-sided inverse sends (j,κ) to the tuple extending κ by the value n−j at M, whose sum is j+(n−j)=n. Hence ∣W(n,σ(M))∣=∑j<σ(n)∣W(j,M)∣ by [L5].

L2L5L7L8construct
1.2

Base case, M=0, that is m=1. A weak composition of n into one part is a function k:1→N with ∑i<1ki=k0=n, and there is exactly one such function; so ∣W(n,1)∣=1=(n+00) by [L3].

baseL2L3
1.3

Inductive hypothesis: fix M and assume ∣W(n,σ(M))∣=(n+MM) for every n∈N.

ih
1.4

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

L2L3L8
2.1

Inductive step. Applying step 1.1 with σ(M) in place of M, then the hypothesis of step 1.3, then step 1.4 and finally the hockey-stick identity [L4] with N=n+M and j=M: ∣W(n,σ(σ(M)))∣=∑j<σ(n)∣W(j,σ(M))∣=∑j<σ(n)(j+MM)=∑i<σ(n+M)(iM)=(σ(n+M)σ(M))=(n+σ(M)σ(M)), the last equality because σ(n+M)=n+σ(M). That is the claim at σ(M).

step 1.1step 1.3step 1.4L4L8
3.1

By step 1.2, step 2.1 and induction, ∣W(n,σ(M))∣=(n+MM) for every M and every n, which is the first display since m=σ(M) and M=m−1.

step 1.2step 2.1L1
4.1

The explicit bijection. For k∈W(n,σ(M)) and i<M put si:=(∑j<σ(i)kj)+i and S(k):={ si:i<M }. The list is strictly increasing, since sσ(i)=(∑j<σ(i)kj+kσ(i))+σ(i)=si+kσ(i)+1; and si<n+M, since ∑j<σ(i)kj≤∑j<σ(M)kj=n by [L2] and i≤M−1. So S(k) is a subset of n+M with exactly M elements, and S maps W(n,σ(M)) into [ n+M ]M. It is injective: a strictly increasing list enumerating a finite subset of 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~) forces si=s~i for all i<M; then k0=s0 and kσ(i)=sσ(i)−si−1 recover k on M, and kM=n−∑j<Mkj recovers the last part. Since both sets have (n+MM) elements by step 3.1 and [L3], the image of S is a subset of [ n+M ]M of the same cardinality, hence all of it by [L6]. So S is a bijection.

step 3.1L2L3L6L7L8L9construct
4.2

The count of compositions, for m=σ(M)≥1 and n≥1. If m≤n, the map k↦k′ with ki′:=ki−1 sends C(n,m) into W(n−m,m): each ki≥1, so ki=ki′+1, and ∑i<mki=∑i<mki′+∑i<m1=∑i<mki′+m by additivity and the constant clause, whence ∑i<mki′=n−m. Its two-sided inverse adds 1 to every part. So ∣C(n,m)∣=∣W(n−m,m)∣=((n−m)+MM) by step 3.1, and (n−m)+M=n−1 because (n−m)+m=n and M=m−1 with m≥1. If instead m>n, then every k∈C(n,m) would satisfy n=∑i<mki≥∑i<m1=m by monotonicity, which is false; so C(n,m)=∅, and (n−1m−1)=0 as well, since m>n≥1 gives m−1>n−1. In both cases ∣C(n,m)∣=(n−1m−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 S. Lay out n stars and M bars in a row of n+M places; the bars split the stars into σ(M)=m runs, whose lengths are the parts. The set 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.

tikz \begin{tikzpicture}[x=0.85cm,y=1cm] \node at (2.55,1.25) {$k=(2,0,3)$}; \node at (0,0) {$\star$}; \node at (0.85,0) {$\star$}; \draw[line width=1pt] (1.7,-0.3) -- (1.7,0.3); \draw[line width=1pt] (2.55,-0.3) -- (2.55,0.3); \node at (3.4,0) {$\star$}; \node at (4.25,0) {$\star$}; \node at (5.1,0) {$\star$}; \node at (0,-0.65) {$0$}; \node at (0.85,-0.65) {$1$}; \node at (1.7,-0.65) {$2$}; \node at (2.55,-0.65) {$3$}; \node at (3.4,-0.65) {$4$}; \node at (4.25,-0.65) {$5$}; \node at (5.1,-0.65) {$6$}; \node at (2.55,-1.35) {$S(k)=\{2,3\}\subseteq 7$}; \end{tikzpicture}

  • Why the count is proved by induction and not by the bijection alone. Building the inverse of S by hand needs the increasing enumeration of an arbitrary M-element subset of n+M, which is more machinery than the hockey-stick induction. The induction gives the number, and the number then gives the surjectivity of S.

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

Depends on

Used by

Dependency tree · two levels

55 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources