Alphabeta Math
TheoremStatement: AI-adaptedProof: AI-adaptedSession-authored (Fable 5 assisted)precheck passverified 2026-08-03 (gpt-5.6-sol-codex-subscription)
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.

The number of surjections from an nn-element set onto a kk-element set is i<k+1(1)i(ki)(ki)n\sum_{i<k+1}(-1)^{i}\binom{k}{i}(k-i)^{n}, read in R\mathbb{R} through ι\iota

Statement

Let AA and BB be finite sets, n:=An := \lvert A\rvert and k:=Bk := \lvert B\rvert, and write

Surj(A,B):={f:f is a surjection AB}\operatorname{Surj}(A,B) := \{\, f : f \text{ is a surjection } A \to B \,\}

(Injection, surjection, bijection). Then Surj(A,B)\operatorname{Surj}(A,B) is finite and, in R\mathbb{R},

ιSurj(A,B)  =  i<k+1(1)iι(ki)ι((ki)n),\iota\lvert \operatorname{Surj}(A,B)\rvert \;=\; \sum_{i<k+1}(-1)^{i}\,\iota\binom{k}{i}\,\iota\big((k-i)^{\,n}\big),

where ι\iota is the canonical natural (The canonical natural ι(n)=n1F\iota(n) = n \cdot 1_F of a field), (ki)n(k-i)^{n} is the N\mathbb{N}-valued power of Exponentiation of natural numbers, mnm^{n}, and its agreement with the integer power in R\mathbb{R}, and kik-i is 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}, which is the ordinary one throughout the range iki \le k of the sum.

All three degenerate readings are part of the statement, and each is computed rather than stipulated.

Facts & Assumptions

Given: Finite sets AA and BB with n:=An := \lvert A\rvert and k:=Bk := \lvert B\rvert; the set Map(A,B)\operatorname{Map}(A,B) of all functions ABA \to B; and, for bBb \in B, the set Fb:={fMap(A,B):bf[A]}F_b := \{\, f \in \operatorname{Map}(A,B) : b \notin f[A] \,\} of functions missing the value bb.

[L1]

Map(A,B)\operatorname{Map}(A,B) is finite with Map(A,B)=kn\lvert\operatorname{Map}(A,B)\rvert = k^{\,n}. This is The set ABA^{B} of functions BAB \to A between finite sets is finite, with AB=AB\lvert A^{B}\rvert = \lvert A\rvert^{\lvert B\rvert} with its AA taken to be BB and its BB taken to be AA, so that its ABA^{B} is the set of functions ABA \to B and its formula reads BA=kn\lvert B\rvert^{\lvert A\rvert} = k^{\,n} (Exponentiation of natural numbers, mnm^{n}, and its agreement with the integer power in R\mathbb{R}).

[L2]

(Fb)bB(F_b)_{b \in B} is a family of subsets of the finite set X:=Map(A,B)X := \operatorname{Map}(A,B) indexed by the finite set BB, hence a sieve family with ambient set XX, and its intersections FJF_J for JBJ \subseteq B satisfy F=XF_\varnothing = X (A finite family (Ai)iI(A_i)_{i \in I} of subsets of a finite set XX, the intersections AJA_J for JIJ \subseteq I, and the convention A=XA_\varnothing = X, A subset of a finite set is finite, with BA\lvert B\rvert \le \lvert A\rvert, and equality holds if and only if B=AB = A, The cardinality A\lvert A\rvert of a finite set).

[L3]

fMap(A,B)f \in \operatorname{Map}(A,B) is a surjection exactly when f[A]=Bf[A] = B, that is exactly when there is no bBb \in B with bf[A]b \notin f[A] (Injection, surjection, bijection). Hence Surj(A,B)=XbBFb\operatorname{Surj}(A,B) = X \setminus \bigcup_{b \in B}F_b, and it is finite as a subset of XX (A subset of a finite set is finite, with BA\lvert B\rvert \le \lvert A\rvert, and equality holds if and only if B=AB = A).

[L4]

For a finite sieve family (Fb)bB(F_b)_{b\in B} in XX with F=XF_\varnothing=X, the complementary identity is ιXbBFb=JP(B)(1)JιFJ\iota|X\setminus\bigcup_{b\in B}F_b|=\sum_{J\in\mathcal P(B)}(-1)^{|J|}\iota|F_J| (Inclusion and exclusion: ιiIAi=JI(1)J+1ιAJ\iota\lvert\bigcup_{i \in I} A_i\rvert = \sum_{\varnothing \ne J \subseteq I}(-1)^{\lvert J\rvert + 1}\,\iota\lvert A_J\rvert, together with the complementary form counting the elements in none of the AiA_i, clause 2).

[L6]

Partition of a power set by cardinality: the sets [B]i[B]^{i} for iσ(k)i \in \sigma(k) are pairwise disjoint with union P(B)\mathcal{P}(B), since a subset of BB has exactly one cardinality and it is at most kk; and [B]i=(ki)\lvert [B]^{i}\rvert = \binom{k}{i} (A subset of a finite set is finite, with BA\lvert B\rvert \le \lvert A\rvert, and equality holds if and only if B=AB = A, clause 2, The set [A]k[A]^{k} of kk-element subsets and the binomial coefficient (nk):=[n]k\binom{n}{k} := \lvert [n]^{k}\rvert, P(A)=2A\lvert\mathcal{P}(A)\rvert = 2^{\lvert A\rvert} for finite AA).

[L7]

Splitting a sum along a partition of its index set (The sum rule: a finite disjoint union is finite with AB=A+B\lvert A \cup B\rvert = \lvert A\rvert + \lvert B\rvert and iIAi=iIAi\lvert\bigcup_{i \in I} A_i\rvert = \sum_{i \in I}\lvert A_i\rvert, and a sum over a finite index set splits along a partition, clause 3); a constant real summand pSλ=ι(S)λ\sum_{p \in S}\lambda = \iota(\lvert S\rvert)\lambda and the bridge inui=i<nui\sum_{i \in n}u_i = \sum_{i<n}u_i (The sum iSai\sum_{i \in S} a_i over a finite index set, and its product form, clauses (a) and (c)); and the real finite sum itself (Finite sums and finite products, by recursion).

Proof

technique · direct
1.1

The ambient set. Put X:=Map(A,B)X := \operatorname{Map}(A,B); it is finite with X=kn\lvert X\rvert = k^{\,n} by [L1].

L1
1.2

The sieve family. For bBb \in B the set FbF_b of functions missing bb is a subset of XX, and by [L3] a function fXf \in X is a surjection exactly when fbBFbf \notin \bigcup_{b \in B}F_b; so Surj(A,B)=XbBFb\operatorname{Surj}(A,B) = X \setminus \bigcup_{b \in B}F_b is the complement of the union of the sieve family (Fb)bB(F_b)_{b \in B} inside XX.

L2L3construct
1.3

The intersections are function sets. For every JBJ \subseteq B, FJ=Map(A,BJ)F_J = \operatorname{Map}(A, B\setminus J): for JJ \ne \varnothing, fFJf \in F_J says that ff misses every bJb \in J, that is that ff takes all its values in BJB \setminus J; and for J=J = \varnothing both sides are Map(A,B)\operatorname{Map}(A,B), the left by the stipulation F=XF_\varnothing = X of [L2]. Hence FJ=BJn=(kJ)n\lvert F_J\rvert = \lvert B\setminus J\rvert^{\,n} = (k - \lvert J\rvert)^{\,n} by [L1] applied to BJB \setminus J and by [L5].

L1L2L5
2.1

The sieve. Applying [L4] to the family of step 1.2 and substituting step 1.3, ιSurj(A,B)=JP(B)(1)JιFJ=JP(B)(1)Jι((kJ)n)\iota\lvert\operatorname{Surj}(A,B)\rvert = \sum_{J \in \mathcal{P}(B)}(-1)^{\lvert J\rvert}\,\iota\lvert F_J\rvert = \sum_{J \in \mathcal{P}(B)}(-1)^{\lvert J\rvert}\,\iota\big((k-\lvert J\rvert)^{\,n}\big).

step 1.2step 1.3L4
3.1

Grouping the subsets of BB by size. Splitting the last sum along the partition of [L6] and using the constant clause of [L7] on each block, where the summand depends on JJ only through J=i\lvert J\rvert = i, gives JP(B)(1)Jι((kJ)n)=i<k+1ι(ki)(1)iι((ki)n)\sum_{J \in \mathcal{P}(B)}(-1)^{\lvert J\rvert}\iota\big((k-\lvert J\rvert)^{\,n}\big) = \sum_{i<k+1}\iota\binom{k}{i}\,(-1)^{i}\,\iota\big((k-i)^{\,n}\big).

step 2.1L6L7
4.1

Combining steps 2.1 and 3.1 gives ιSurj(A,B)=i<k+1(1)iι(ki)ι((ki)n)\iota\lvert\operatorname{Surj}(A,B)\rvert = \sum_{i<k+1}(-1)^{i}\,\iota\binom{k}{i}\,\iota\big((k-i)^{\,n}\big), and Surj(A,B)\operatorname{Surj}(A,B) is finite by [L3]; since ι\iota is injective, the identity determines the count in N\mathbb{N}.

step 2.1step 3.1L3L8

Remarks

  • The convention 00=10^{0} = 1 is load bearing exactly once, at n=0n = 0 and k=0k = 0, where the formula returns ι(00)\iota(0^{0}) and the truth is that the empty function is a surjection onto the empty set. It is not a convenience: it is the base clause of the recursion defining natural exponentiation, and changing it would make the formula false at that single point.

  • Why the family is indexed by BB and not by AA. The sieve removes the functions that miss a value, and there is one condition per element of the codomain. This is also why the alternating sum runs to kk and not to nn.

  • The count is a natural number. The identity is stated in R\mathbb{R} because it carries signs, and ι\iota is injective, so it pins down the natural number Surj(A,B)\lvert\operatorname{Surj}(A,B)\rvert exactly.

Depends on

Used by

Dependency tree · next 3 levels

Direct dependencies and their dependencies through the next three levels: 89 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