Main derivation
S01 · definition
Before
\text{ordered and unordered selections of }k\text{ objects from }XAfter
P(n,k)=|\mathcal{P}_k(X)|,\quad C(n,k)=|\mathcal{C}_k(X)|Conditions: 0\le k\le n
Rule: def_intro · Uses: G1, G2
Leaf basis: def_intro + mko_perm_comb
Write the two things being counted as sets. Under the MKO's assumptions, an ordered selection is a k-tuple (x_i)_{i=1}^{k} of pairwise distinct elements of X, and a different order is a different selection; an unordered selection is a k-element subset of X and records only which objects were chosen. P(n,k) and C(n,k) are the numbers of elements of these two sets. What is proved below is that these numbers equal the MKO's formulas; the formulas are not taken as definitions.
S02 · implies
Before
m!\ (m\in\mathbb{N})After
m!\geq 1,\ \text{hence}\ m!\neq 0Conditions: m\in\mathbb{N}
Rule: L_fact_pos · Uses: mko_factorial_def
Leaf basis: nat_induction + mko_factorial_def + order_basics
Later steps divide by n!, (n−k)! and k!, so first make sure a factorial is never zero. By Lemma L_fact_pos every m! is at least 1; the proof by induction is in S02.1 and S02.2.
S03 · induction_base
Before
\mathcal{P}_0(X)After
\mathcal{P}_0(X)=\{()\},\quad |\mathcal{P}_0(X)|=1=\frac{n!}{(n-0)!}Conditions: n!\neq 0
Rule: tuple_eq · Uses: G1, G2, S02, tuple_eq
Leaf basis: tuple_eq + frac_rules + L_fact_pos
The only 0-tuple is the empty tuple (); it has no entries, so pairwise distinctness holds vacuously and 𝒫_0(X)={()} has exactly 1 element. On the other side n!/(n−0)!=n!/n!=1, where the division needs n!≠0 (S02). This is the base of the induction on k, and it is the MKO's statement that the empty permutation counts once.
S04 · implies
Before
\mathcal{P}_{k+1}(X)\quad(k+1\le n)After
\mathcal{P}_{k+1}(X)=\bigcup_{t\in\mathcal{P}_k(X)}E(t),\quad E(t)=\{t^\frown x\mid x\in X\setminus\operatorname{set}(t)\},\ \text{pairwise disjoint}Conditions: k+1\le n
Rule: set_extensionality · Uses: G2, tuple_eq
Leaf basis: set_extensionality + tuple_eq + set_operations_def
Fix k with k+1≤n. Sort each ordered selection of k+1 objects by its first k entries: E(t) collects the tuples that begin with t and continue with one object not already in t. Sub-steps S04.1 and S04.2 prove the two inclusions, and S04.3 proves that the classes are disjoint.
S05 · implies
Before
E(t)\quad(t\in\mathcal{P}_k(X))After
|E(t)|=n-k\geq 1
Conditions: k+1\le n
Rule: L_complement_count · Uses: G1, G2, S04
Leaf basis: L_complement_count + finite_counting_basics + injective_surjective_def
Each class E(t) has exactly n−k elements, whichever tuple t is; this is what makes a product count legitimate (the counting-principle MKO requires the number of options at each stage to be explicit). The proof has three sub-steps: counting a complement (S05.1), set(t) having exactly k elements (S05.2), and x↦t⌢x being a bijection (S05.3). Since k+1≤n, n−k≥1.
S06 · implies
Before
\mathcal{P}_{k+1}(X)=\bigcup_{t\in\mathcal{P}_k(X)}E(t)After
|\mathcal{P}_{k+1}(X)|=|\mathcal{P}_k(X)|\cdot(n-k)Conditions: k+1\le n
Rule: disjoint_union_count · Uses: S04, S04.3, S05
Leaf basis: disjoint_union_count + finite_counting_basics
S04 writes 𝒫_{k+1}(X) as the union of the pairwise disjoint classes E(t) indexed by t∈𝒫_k(X), and S05 says every class has exactly n−k elements. By disjoint_union_count (c=n−k) the total is |𝒫_k(X)|·(n−k). This is the precise form of the MKO's remark that the numbers of choices are n, n−1 and so on: at choice number k+1 there are n−k options.
S07 · induction_step
Before
|\mathcal{P}_k(X)|=\frac{n!}{(n-k)!}After
|\mathcal{P}_{k+1}(X)|=\frac{n!}{(n-(k+1))!}Conditions: k+1\le n
Rule: frac_rules · Uses: S06, S02, mko_factorial_def
Leaf basis: frac_rules + mko_factorial_def + L_fact_pos
Assume the induction hypothesis |𝒫_k(X)|=n!/(n−k)! and k+1≤n. By S06, |𝒫_{k+1}(X)|=n!(n−k)/(n−k)!. Sub-step S07.1 splits (n−k)! as (n−k)·(n−k−1)!, and S07.2 cancels the common factor n−k to reach n!/(n−(k+1))!.
S08 · implies
Before
Q(k):\ k\le n\Rightarrow|\mathcal{P}_k(X)|=\frac{n!}{(n-k)!}After
P(n,k)=\frac{n!}{(n-k)!}\quad\text{for all}\ 0\le k\le nConditions: none
Rule: nat_induction · Uses: S03, S07
Leaf basis: nat_induction + forall_intro + imp_intro
Induct on k for Q(k): 'if k≤n then |𝒫_k(X)|=n!/(n−k)!'. Q(0) is S03. Assume Q(k): if k+1≤n then k≤n, so Q(k) gives |𝒫_k(X)|=n!/(n−k)!, and S07 gives Q(k+1); if k+1>n, the hypothesis of Q(k+1) fails and Q(k+1) holds vacuously. By the induction principle Q(k) holds for every k. The proof used only |X|=n and the distinctness of the elements, nothing about which elements X has, so it holds for every n-element set (forall_intro).
S09 · definition
Before
t\in\mathcal{P}_k(X)After
\sigma(t)=\operatorname{set}(t)\in\mathcal{C}_k(X)Conditions: none
Rule: function_def · Uses: G2, S05.2
Leaf basis: function_def + def_intro
Define σ:𝒫_k(X)→𝒞_k(X) sending an ordered selection to the set of objects it selects, that is, forgetting the order. σ is well defined: by the reasoning of S05.2, set(t) is a subset of X with exactly k elements, so set(t)∈𝒞_k(X), and each t gives a single set.
S10 · implies
Before
\sigma^{-1}(\{A\})\quad(A\in\mathcal{C}_k(X))After
\sigma^{-1}(\{A\})=\mathcal{P}_k(A)Conditions: A\subseteq X,\ |A|=k
Rule: set_extensionality · Uses: S09
Leaf basis: set_extensionality + image_preimage_def + L_same_size_subset
For each k-element subset A, the ordered selections that σ sends to A are exactly the k-tuples of distinct elements of A, that is, the orderings of A. The two inclusions are S10.1 and S10.3, and S10.2 proves the finite-set lemma they need.
S11 · theorem_application
Before
|\sigma^{-1}(\{A\})|=|\mathcal{P}_k(A)|After
|\sigma^{-1}(\{A\})|=\frac{k!}{(k-k)!}=\frac{k!}{0!}=k!Conditions: |A|=k
Rule: forall_elim · Uses: S08, S10
Leaf basis: forall_elim + mko_factorial_def + numeric_evaluation
S08 holds for every n-element set and every 0≤k≤n. Applying it to the k-element set A (n replaced by k, with k objects still selected and 0≤k≤k true) gives |𝒫_k(A)|=k!/(k−k)!=k!/0!=k!, since 0!=1. So each k-element subset has exactly k! orderings, which is the MKO's reason for dividing by k!.
S12 · implies
Before
\mathcal{P}_k(X)=\bigcup_{A\in\mathcal{C}_k(X)}\sigma^{-1}(\{A\})After
P(n,k)=C(n,k)\cdot k!
Conditions: none
Rule: disjoint_union_count · Uses: S09, S10, S11
Leaf basis: disjoint_union_count + function_def + image_preimage_def
Each t∈𝒫_k(X) lies in exactly one fibre, namely σ^{-1}({σ(t)}) (σ is a function and gives t a single image), so the fibres are pairwise disjoint and their union is 𝒫_k(X). Every fibre has exactly k! elements (S11), and there are |𝒞_k(X)|=C(n,k) fibres. By disjoint_union_count (c=k!), P(n,k)=C(n,k)·k!.
S13 · equivalent
Before
P(n,k)=C(n,k)\cdot k!
After
C(n,k)=\frac{P(n,k)}{k!}=\frac{n!}{k!\,(n-k)!}Conditions: k!\neq 0
Rule: mul_inverse_nonzero · Uses: S12, S08, S02
Leaf basis: mul_inverse_nonzero + frac_rules + eq_replace + L_fact_pos
Since k!≠0 (S02), multiplying both sides by 1/k! gives C(n,k)=P(n,k)/k!; substituting P(n,k)=n!/(n−k)! from S08 and using frac_rules gives n!/(k!(n−k)!).
S14 · implies
Before
k=0
After
P(n,0)=\frac{n!}{n!}=1,\quad C(n,0)=\frac{n!}{0!\,n!}=1,\quad \mathcal{C}_0(X)=\{\varnothing\}Conditions: 0!=1; n!\neq 0
Rule: forall_elim · Uses: S08, S13, G2
Leaf basis: forall_elim + mko_factorial_def + frac_rules
Substitute k=0: P(n,0)=n!/n!=1 and C(n,0)=n!/(0!·n!)=n!/n!=1 (0!=1). The sets agree directly: the only subset with no elements is the empty set, so 𝒞_0(X)={∅}, and the empty selection counts as one, as in MKO assumption a2; this also holds for n=0 (X empty).
S15 · implies
Before
n=5,\ k=3
After
P(5,3)=60,\quad C(5,3)=10,\quad 10\cdot 3!=60
Conditions: 0\le 3\le 5
Rule: forall_elim · Uses: G3, S06, S08, S13
Leaf basis: forall_elim + numeric_evaluation
Substitute n=5 and k=3: P(5,3)=5!/2!=120/2=60, which matches the recursion of S06, 1, 5, 20, 60 (multiplying by 5, 4 and 3 in turn); C(5,3)=5!/(3!·2!)=120/12=10. Check S12: 10·3!=60. For A={a,b,c}, its fibre is exactly the 6 ordered selections (a,b,c), (a,c,b), (b,a,c), (b,c,a), (c,a,b), (c,b,a), and 3!=6.
Substeps and lemmas
S02.1 · induction_base
Before
0!
After
0!=1\geq 1
Conditions: none
Rule: mko_factorial_def · Uses: mko_factorial_def
Leaf basis: mko_factorial_def
By definition F(0)=1, so 0!=1≥1. Note that 0! is 1, not 0; the factorial MKO warns against the common error of taking 0! to be 0.
S02.2 · induction_step
Before
m!\geq 1
After
(m+1)!=(m+1)\,m!\geq m!\geq 1
Conditions: m\geq 0
Rule: order_basics · Uses: S02.1, mko_factorial_def, order_basics
Leaf basis: order_basics + mko_factorial_def + nat_induction
Assume m!≥1. By the recursion (m+1)!=(m+1)·m!. Since m≥0, (m+1)·m!−m!=m·m!≥0 (a product of nonnegative numbers is nonnegative), so (m+1)!≥m!≥1. By the induction principle, S02.1 and S02.2 together prove Lemma L_fact_pos for every m.
S04.1 · implies
Before
u\in\mathcal{P}_{k+1}(X)After
u=t^\frown x,\ t\in\mathcal{P}_k(X),\ x\in X\setminus\operatorname{set}(t)Conditions: none
Rule: tuple_eq · Uses: G2, tuple_eq
Leaf basis: tuple_eq + set_operations_def + subset_def
Take any u∈𝒫_{k+1}(X). By tuple_eq, u=t⌢x with t the first k entries of u and x its last entry. The entries of t are entries of u, so they lie in X and are pairwise distinct: t∈𝒫_k(X). The entry x differs from every other entry of u, that is, x∉set(t), so x∈X∖set(t) and u∈E(t).
S04.2 · implies
Before
t\in\mathcal{P}_k(X),\ x\in X\setminus\operatorname{set}(t)After
t^\frown x\in\mathcal{P}_{k+1}(X)Conditions: x\notin\operatorname{set}(t)
Rule: tuple_eq · Uses: G2, tuple_eq, S04.1
Leaf basis: tuple_eq + set_operations_def + set_extensionality
Conversely, let t∈𝒫_k(X), x∈X and x∉set(t). The first k entries of t⌢x are pairwise distinct and the last entry x differs from each of them, so all k+1 entries are pairwise distinct and lie in X: t⌢x∈𝒫_{k+1}(X). S04.1 and S04.2 together give the set equality of S04 by set_extensionality.
S04.3 · implies
Before
t^\frown x=s^\frown y
After
t=s\ \land\ x=y
Conditions: none
Rule: tuple_eq · Uses: tuple_eq
Leaf basis: tuple_eq + and_intro_elim
If t⌢x=s⌢y, the tuples agree position by position: the first k entries give t=s and the last entry gives x=y. Hence E(t) and E(s) share no element when t≠s, and inside one E(t) different x give different tuples.
S05.1 · implies
Before
A\subseteq Y,\ Y\ \text{finite}After
|Y\setminus A|=|Y|-|A|
Conditions: A\subseteq Y
Rule: finite_counting_basics · Uses: finite_counting_basics, set_operations_def
Leaf basis: finite_counting_basics + set_operations_def + eq_congruence
Since A⊆Y, Y=A∪(Y∖A), and A and Y∖A are disjoint (elements of Y∖A are not in A). By finite_counting_basics, |Y|=|A|+|Y∖A|; subtracting |A| from both sides gives |Y∖A|=|Y|−|A|. This proves Lemma L_complement_count.
S05.2 · implies
Before
t=(x_i)_{i=1}^{k}\in\mathcal{P}_k(X)After
|\operatorname{set}(t)|=k,\quad |X\setminus\operatorname{set}(t)|=n-kConditions: none
Rule: finite_counting_basics · Uses: G2, S05.1
Leaf basis: injective_surjective_def + finite_counting_basics + L_complement_count
The map i↦x_i from the set of positions {i∈ℕ ∣ 1≤i≤k} to set(t) is onto (set(t) is the set of entries) and one-to-one (the entries are pairwise distinct). By the bijection clause of finite_counting_basics, |set(t)|=k. Also set(t)⊆X, so by S05.1 (Y=X, A=set(t)), |X∖set(t)|=n−k. This reasoning holds for every t∈𝒫_k(X) and is used again in S09 and S10.3.
S05.3 · implies
Before
x\mapsto t^\frown x:\ X\setminus\operatorname{set}(t)\to E(t)After
|E(t)|=|X\setminus\operatorname{set}(t)|=n-kConditions: none
Rule: injective_surjective_def · Uses: S04.3, S05.2
Leaf basis: injective_surjective_def + finite_counting_basics
By the definition of E(t), each of its elements is t⌢x for some x∈X∖set(t), so the map is onto; by S04.3, t⌢x=t⌢y gives x=y, so it is one-to-one. Finite sets in bijection have the same number of elements, so |E(t)|=n−k.
S07.1 · equivalent
Before
(n-k)!
After
(n-k)\cdot(n-k-1)!
Conditions: n-k-1\in\mathbb{N}
Rule: mko_factorial_def · Uses: mko_factorial_def
Leaf basis: mko_factorial_def + eq_replace
Let m=n−k−1; since k+1≤n, m is a natural number and n−k=m+1. By the recursion F(m+1)=(m+1)F(m), (n−k)!=(n−k)·(n−k−1)!.
S07.2 · equivalent
Before
\frac{n!\,(n-k)}{(n-k)\cdot(n-k-1)!}After
\frac{n!}{(n-k-1)!}=\frac{n!}{(n-(k+1))!}Conditions: n-k\neq 0; (n-k-1)!\neq 0
Rule: frac_rules · Uses: S07.1, S02
Leaf basis: frac_rules + L_fact_pos + eq_replace
By the rule in frac_rules that multiplying numerator and denominator by the same nonzero number does not change a fraction, cancel the nonzero common factor n−k from numerator and denominator; (n−k−1)!≠0 holds by S02. Finally n−k−1=n−(k+1).
S10.1 · implies
Before
t\in\mathcal{P}_k(X),\ \sigma(t)=AAfter
t\in\mathcal{P}_k(A)Conditions: none
Rule: image_preimage_def · Uses: S09, image_preimage_def
Leaf basis: image_preimage_def + def_unfold
If σ(t)=A, every entry of t lies in set(t)=A, and the entries are pairwise distinct, so t is a k-tuple of distinct elements of A: t∈𝒫_k(A).
S10.2 · implies
Before
B\subseteq A,\ |B|=|A|,\ A\ \text{finite}After
B=A
Conditions: A\ \text{finite}
Rule: L_complement_count · Uses: S05.1, set_operations_def
Leaf basis: L_complement_count + set_extensionality + set_operations_def
By L_complement_count (S05.1 with Y=A), |A∖B|=|A|−|B|=0, so A∖B is empty: every element of A lies in B, so A⊆B. Together with B⊆A, set_extensionality gives B=A. This proves Lemma L_same_size_subset.
S10.3 · implies
Before
t\in\mathcal{P}_k(A)After
t\in\mathcal{P}_k(X)\ \land\ \sigma(t)=AConditions: A\subseteq X
Rule: L_same_size_subset · Uses: S05.2, S10.2, G2
Leaf basis: L_same_size_subset + subset_def + set_extensionality
Let t∈𝒫_k(A). Since A⊆X, t is also a k-tuple of distinct elements of X, so t∈𝒫_k(X). By the reasoning of S05.2, |set(t)|=k=|A|, and set(t)⊆A; by L_same_size_subset, set(t)=A, that is σ(t)=A. S10.1 and S10.3 together give σ^{-1}({A})=𝒫_k(A).
Error controls and negative controls
Decide order, distinctness and replacement first
The common error named in the MKO is to apply a formula before checking the conditions. Choosing 3 from {a,b,c,d,e}: if order matters and there is no repetition (president, vice-president and secretary), use P(5,3)=60; if only who is chosen matters (a three-person committee), use C(5,3)=10; if repetition is allowed (a three-letter code whose letters may repeat), each position has 5 options, giving 5³=125, and neither P nor C applies. Every step here relies on distinctness and no replacement: S04.1 needs x not in t, and S05.2 needs the entries to be pairwise distinct.
Dividing by k! needs exactly k! orderings for every subset
S12 can be written as C(n,k)·k! because every fibre has exactly k! elements (S11), and that rests on the objects being distinct. With indistinguishable objects, for example the letters A, A, B in three positions, there are only three different results, AAB, ABA and BAA, not 3!=6; taking 3! as the count doubles it. Such cases need a different counting model (MKO para2).
0!=1 and the empty selection
For k=0 there is exactly one ordered and one unordered selection: the empty tuple and the empty set (S03, S14). Taking 0! to be 0 would make C(n,0)=n!/(0!·n!) a division by zero; thinking that choosing nothing does not count would wrongly give C(5,0)=0.
- Three-letter codes from {a,b,c,d,e} with repetition allowed number P(5,3)=60 →
reject — With repetition each position has 5 options, giving 5³=125; P(5,3) counts only ordered selections with pairwise distinct entries. - The number of ways to choose a president and a secretary (two different posts) from 5 people is C(5,2)=10 →
reject — The posts distinguish order: A as president with B as secretary differs from B as president with A as secretary, so the count is P(5,2)=20=10·2!. - The letters A, A, B have 3!=6 different arrangements →
reject — The objects are not distinct; there are only AAB, ABA and BAA, three arrangements, and this lies outside the MKO's model of distinct objects. - C(5,0)=0 because nothing is chosen →
reject — The empty selection counts as one: 5!/(0!·5!)=1, and 𝒞_0(X)={∅}.