Goal and scope
Let A={1,2,3,4,5}, B={1,2,3} and the function table f: (1,2),(2,1),(3,3),(4,2),(5,1). Confirm f is a total function A→B, find the range f[A] and the preimages, decide whether f is surjective and find the first preimage of t=2; then replace the codomain by B2={1,2,3,4} and by B3={1,2}, deciding legality and surjectivity; finally treat ∅→∅ and ∅→{7}.
Works inside the MKO's scope: an explicit domain, codomain and finite total function table. Proves two small general lemmas (f[A]⊆B; f surjective ⇔ f[A]=B), decides this example by a complete check, and shows when a change of codomain is legitimate. Results concern this table only and are not extended to other functions; the canonical MKO and its English edition are not changed.
Main derivation
S01 · implies
Before
f:\ (1,2),(2,1),(3,3),(4,2),(5,1)
After
f:A\to B\ \text{total};\ f(1)=2,f(2)=1,f(3)=3,f(4)=2,f(5)=1Conditions: none
Rule: table_function · Uses: G1, G2, table_function
Leaf basis: table_function + roster_membership
MKO assumption a1: domain, codomain and total function must be explicit. Each of the five inputs of A occurs exactly once, the outputs 2, 1, 3, 2, 1 all lie in B={1,2,3}, and no input has two outputs. So f is a total function A→B.
S02 · equivalent
Before
f[A]=\{f(x)\mid x\in A\}After
\{2,1,3,2,1\}=\{1,2,3\}Conditions: none
Rule: image_preimage_def · Uses: S01, image_preimage_def, set_extensionality
Leaf basis: image_preimage_def + set_extensionality
The range is the set of all outputs. The five outputs are 2, 1, 3, 2, 1 in order; repeated values count once in a set, so f[A]={1,2,3}.
S03 · theorem_application
Before
f[A]=\{1,2,3\}After
f[A]\subseteq B
Conditions: none
Rule: L_range_sub · Uses: S01, S02, L_range_sub
Leaf basis: function_def + image_preimage_def + subset_def
By Lemma L_range_sub, the range of any total function is contained in its codomain; here {1,2,3}⊆{1,2,3}. So deciding surjectivity only requires the reverse inclusion B⊆f[A].
S04 · implies
Before
f^{-1}(\{b\}),\ b\in BAfter
f^{-1}(\{1\})=\{2,5\},\ f^{-1}(\{2\})=\{1,4\},\ f^{-1}(\{3\})=\{3\}Conditions: none
Rule: image_preimage_def · Uses: S01, image_preimage_def
Leaf basis: image_preimage_def + roster_membership + numeric_evaluation
List the preimages of each target in B: the inputs with output 1 are 2 and 5; with output 2, 1 and 4; with output 3, just 3. The three preimage sets are disjoint, with sizes 2+2+1=5=|A| (N1), every input lying in exactly one of them.
S05 · implies
Before
b\in B=\{1,2,3\}After
\forall b\in B\ \exists x\in A:\ f(x)=b
Conditions: none
Rule: mko_surjective_def · Uses: S04, mko_surjective_def, exists_intro, case_analysis
Leaf basis: exists_intro + case_analysis + roster_membership + forall_intro
Take any b∈B. B is given by listing, so b=1, 2 or 3. For b=1 the witness is x=2; for b=2, x=1; for b=3, x=3 (S04). The three cases cover every element of B and each has a preimage; by ∃-introduction and ∀-introduction, f is surjective.
S06 · theorem_application
Before
f[A]=\{1,2,3\}=BAfter
f\ \text{surjective}Conditions: none
Rule: L_surj_range · Uses: S02, S05, L_surj_range
Leaf basis: image_preimage_def + set_extensionality + mko_surjective_def
A second route: by Lemma L_surj_range, f is surjective exactly when f[A]=B. S02 gives f[A]={1,2,3}, which is B, so f is surjective, in agreement with the pointwise check of S05.
S07 · implies
Before
f(1)=f(4)=2,\ 1\neq 4
After
f\ \text{not injective, still surjective}Conditions: none
Rule: injective_surjective_def · Uses: S01, S04, S05, injective_surjective_def
Leaf basis: injective_surjective_def + numeric_evaluation
f(1)=f(4)=2 while 1≠4 (N5), so f is not injective; likewise f(2)=f(5)=1. Yet S05 proved f surjective. The MKO states that surjectivity does not require a unique preimage; several inputs mapping to the same target do not break surjectivity.
S08 · implies
Before
f^{-1}(\{2\})=\{1,4\}After
\text{first preimage of}\ 2=\min\{1,4\}=1Conditions: f^{-1}(\{2\})\neq\varnothing
Rule: least_element · Uses: S04, G3, least_element
Leaf basis: least_element + order_basics + numeric_evaluation
MKO paragraph two: the first preimage is the numerically least preimage in the finite integer data. The preimage set of t=2 is {1,4}, which is nonempty with least element 1 (N2), so the first preimage is 1. It comes from the complete preimage set, not from the first row met in the table.
S09 · implies
Before
f[A]=\{1,2,3\},\ B2=\{1,2,3,4\}After
f[A]\subseteq B2,\ \text{so}\ f_2:A\to B2\ \text{is a total function}Conditions: none
Rule: table_function · Uses: S02, G3, table_function, subset_def
Leaf basis: table_function + subset_def
MKO assumption a2: a replacement codomain must contain every existing output for the same table to remain a valid total function. The outputs 1, 2, 3 all lie in B2, so the same table defines a total function f₂:A→B2.
S10 · implies
Before
B2\setminus f[A]
After
\{4\}\neq\varnothing,\ f_2^{-1}(\{4\})=\varnothing,\ f_2\ \text{not surjective}Conditions: none
Rule: L_surj_range · Uses: S09, S02, L_surj_range
Leaf basis: image_preimage_def + set_operations_def + numeric_evaluation
The uncovered targets are B2∖f[A]={4}: none of the five outputs 2, 1, 3, 2, 1 equals 4 (N3), so 4 has no preimage and its first preimage is 'none'. f₂[A]={1,2,3}≠B2, so by L_surj_range f₂ is not surjective. The same output table with a different codomain changes surjectivity (MKO paragraph three).
S11 · implies
Before
f(3)=3,\ B3=\{1,2\}After
3\notin B3,\ \text{so the table is not a function}\ A\to B3Conditions: none
Rule: table_function · Uses: S01, G3, table_function
Leaf basis: table_function + roster_membership + numeric_evaluation
If the codomain is replaced by B3={1,2}: f(3)=3 while 3∉B3 (N4), violating 'outputs lie in the codomain', so the table is not a total function A→B3. One may not drop the output 3, which still occurs, just to make the range 'equal' the codomain; surjectivity onto B3 cannot even be asked.
S12 · implies
Before
\varnothing\to\varnothing
After
\text{surjective}Conditions: none
Rule: forall_intro · Uses: G3, mko_surjective_def, empty_set_def, forall_intro
Leaf basis: empty_set_def + forall_intro + mko_surjective_def
The empty function ∅→∅: the surjectivity condition is ∀b∈∅ ∃x∈∅ f(x)=b. For any b, b∈∅ is false and the implication is true; by ∀-introduction the condition holds, so ∅→∅ is surjective (MKO paragraph three).
S13 · implies
Before
\varnothing\to\{7\}After
\neg\exists x\in\varnothing:\ f(x)=7,\ \text{not surjective}Conditions: none
Rule: quantifier_negation · Uses: G3, mko_surjective_def, empty_set_def, quantifier_negation
Leaf basis: empty_set_def + quantifier_negation + mko_surjective_def
The empty function ∅→{7}: 7∈{7} would need some x∈∅ with f(x)=7, but ∅ has no elements, so ¬∃x∈∅ f(x)=7. 7 is an uncovered target, so by quantifier negation the condition ∀b∈{7} ∃x fails, and ∅→{7} is not surjective.
S14 · implies
Before
\text{S01 to S13}After
f\ \text{surjective};\ f_2\ \text{not};\ B3\ \text{illegal};\ \varnothing\to\varnothing\ \text{surjective};\ \varnothing\to\{7\}\ \text{not}Conditions: none
Rule: and_intro_elim · Uses: S05, S06, S07, S08, S10, S11, S12, S13
Leaf basis: and_intro_elim
Summary: f:A→B is surjective with f[A]=B, though not injective; the first preimage of t=2 is 1 (S05 to S08). Changing to B2 is legitimate but not surjective, with 4 uncovered (S09, S10); changing to B3 is illegitimate (S11). ∅→∅ is surjective and ∅→{7} is not (S12, S13).