Binary relations: computing the domain, images and the converse step by step

On this page
  1. Goal and scope
  2. Givens and symbols
  3. Rules and sources
  4. Main derivation
  5. Substeps and lemmas
  6. Reverse audits
  7. Error controls and negative controls
  8. Result and limitations
  9. Verification and source binding

← Guide index · Original MKO

derivation-mko-relation-01 · production-20261019-adopted-96

Goal and scope

Let A={1,2,3,4}, B={2,3,4,5,6}, R={(1,2),(1,3),(3,3),(4,6)} and C={1,3}. Check R⊆A×B; compute Dom(R), R[C], R[∅], R⁻¹ and Dom(R⁻¹); decide whether R is a function A→B and whether R⁻¹ is a function B→A.

Works inside the MKO's scope: explicit finite integer sets and ordered-pair data. Computes the domain, images and the converse step by step from the MKO's definitions, and proves three small general lemmas (membership in the converse, Dom(R⁻¹)=R[A], (R⁻¹)⁻¹=R). The function condition is checked only as an extra restriction; composition, equivalence relations and order relations are not treated; the canonical MKO and its English edition are not changed.

Givens and symbols

  • cartesian_product_def
  • subset_def
  • set_builder
  • set_extensionality
  • exists_intro
  • roster_membership
  • G1 — Source A={1,2,3,4} and target B={2,3,4,5,6}, both given explicitly by listing.
  • G2 — R={(1,2),(1,3),(3,3),(4,6)}, given completely by listing and declared as a relation from A to B; ordered pairs keep their direction (MKO assumption a2).
  • G3 — C={1,3}⊆A (MKO assumption a1).
  • A,\ B — source {1,2,3,4} and target {2,3,4,5,6}
  • R — the relation from A to B, a subset of A×B
  • \mathrm{Dom}(R) — domain of the relation: first coordinates that actually occur
  • R[C] — the image of C under R
  • R^{-1} — the converse {(y,x) ∣ (x,y)∈R}⊆B×A

Rules and sources

  • cartesian_product_def · prerequisite — Cartesian product: A×B is the set of ordered pairs (a,b) with a∈A and b∈B; (a,b)=(c,d) ⇔ a=c and b=d.
  • subset_def · prerequisite — Subset: A⊆B means every element of A is an element of B, i.e. ∀x (x∈A⇒x∈B).
  • set_builder · prerequisite — Set-builder notation: x∈{y∈A ∣ P(y)} if and only if x∈A and P(x).
  • set_extensionality · prerequisite — Set equality: A=B if and only if A⊆B and B⊆A, i.e. they have the same elements.
  • exists_intro · prerequisite — ∃-introduction: if some a∈D satisfies P(a), then ∃x∈D, P(x).
  • forall_intro · prerequisite — ∀-introduction (generalization): if a statement is proved for an arbitrary element x, with no extra assumption on x, it holds for every x in the domain.
  • case_analysis · prerequisite — Proof by cases: if P∨Q holds and both P⇒R and Q⇒R are proved, then R holds. The cases must cover every possibility.
  • quantifier_negation · prerequisite — Negating quantifiers: ¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and ¬(∃x, P(x)) is equivalent to ∀x, ¬P(x).
  • numeric_evaluation · prerequisite — Exact evaluation of an explicit integer or rational expression; independently recomputable.
  • eq_replace · prerequisite — Replacement of equals: an expression inside a statement may be replaced by an equal expression without changing whether the statement is true.
  • logic_chain · prerequisite — Chaining: from P⇒Q and Q⇒R infer P⇒R; likewise for ⇔.
  • and_intro_elim · prerequisite — Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q.
  • mko_relation_def · cited — For sets A and B, a binary relation R from A to B is a subset of A×B; xRy means (x,y)∈R. Its domain is Dom(R)={x∈A:there exists y∈B with (x,y)∈R}; its image of C is R[C]={y∈B:there exists x∈C with (x,y)∈R}; its converse is R⁻¹={(y,x):(x,y)∈R}⊆B×A. · mko-relation
  • roster_membership · prerequisite — Membership in a listed set: for a finite set given by listing, S={s_i ∣ 1≤i≤n}, z∈S holds exactly when z=s_i for some i with 1≤i≤n.
  • empty_set_def · prerequisite — Empty set: for every x, x∉∅.
  • function_graph · prerequisite — A relation F⊆X×Y is (the graph of) a total function X→Y exactly when each x∈X has exactly one y∈Y with (x,y)∈F: at least one (total) and at most one (single-valued).
  • L_converse_member · lemma — For any relation S⊆X×Y and any x, y: (y,x)∈S⁻¹ ⇔ (x,y)∈S.
  • L_dom_converse · lemma — For any relation R⊆A×B: Dom(R⁻¹)=R[A], where Dom(R⁻¹)={y∈B ∣ there exists x∈A with (y,x)∈R⁻¹}.
  • L_converse_twice · lemma — For any relation R⊆A×B: (R⁻¹)⁻¹=R.

Main derivation

S01 · implies

Before

R=\{(1,2),(1,3),(3,3),(4,6)\}

After

R\subseteq A\times B

Conditions: none

Rule: subset_def · Uses: G1, G2, subset_def, cartesian_product_def, roster_membership

Leaf basis: subset_def + cartesian_product_def + roster_membership

By the definition of subset, every element of R must lie in A×B. R is given by listing four ordered pairs; for each pair the first coordinate must be in A and the second in B: (1,2): 1∈A, 2∈B; (1,3): 1∈A, 3∈B; (3,3): 3∈A, 3∈B; (4,6): 4∈A, 6∈B. All four qualify, so R⊆A×B and R really is a binary relation from A to B.

S02 · equivalent

Before

x\in\mathrm{Dom}(R)

After

x\in A\ \land\ \exists y\in B:\ (x,y)\in R

Conditions: none

Rule: mko_relation_def · Uses: mko_relation_def, S01

Leaf basis: mko_relation_def + set_builder

By the MKO, Dom(R)={x∈A ∣ there exists y∈B with (x,y)∈R}. By set-builder notation, x∈Dom(R) exactly when x∈A and some y∈B has (x,y)∈R. Dom(R) is determined by the data of R; it is not another name for the declared source A.

S03 · implies

Before

(1,2)\in R,\ (3,3)\in R,\ (4,6)\in R

After

1,3,4\in\mathrm{Dom}(R)

Conditions: none

Rule: exists_intro · Uses: S02, G2, exists_intro

Leaf basis: exists_intro + set_builder

Find witnesses: (1,2)∈R gives the witness y=2 for x=1; (3,3)∈R gives y=3 for x=3; (4,6)∈R gives y=6 for x=4. The witnesses are in B and 1, 3, 4 are in A, so by ∃-introduction and S02, 1, 3, 4∈Dom(R). 1 has a second witness y=3, but one is enough.

S04 · implies

Before

y\in B,\quad (2,y)\in R\ ?

After

\forall y\in B:\ (2,y)\notin R

Conditions: none

Rule: cartesian_product_def · Uses: G2, roster_membership, cartesian_product_def, forall_intro

Leaf basis: roster_membership + cartesian_product_def + forall_intro + case_analysis

Take any y∈B. By the listing, (2,y)∈R exactly when (2,y) equals one of (1,2), (1,3), (3,3), (4,6). Equal ordered pairs need equal first coordinates, i.e. 2=1, 2=1, 2=3 or 2=4, all false (N2 checks this with the product (2−1)(2−1)(2−3)(2−4)≠0). So (2,y)∉R; since y is arbitrary, ∀-introduction gives the conclusion.

S05 · implies

Before

\forall y\in B:\ (2,y)\notin R

After

2\notin\mathrm{Dom}(R)

Conditions: none

Rule: quantifier_negation · Uses: S02, S04, quantifier_negation

Leaf basis: quantifier_negation + set_builder

By quantifier negation, ∀y∈B (2,y)∉R is equivalent to ¬∃y∈B (2,y)∈R. By S02, 2∈Dom(R) would need such a y, so 2∉Dom(R). 2 belongs to the declared source A but has no outgoing pair at all.

S06 · implies

Before

1,3,4\in\mathrm{Dom}(R),\ 2\notin\mathrm{Dom}(R),\ \mathrm{Dom}(R)\subseteq A

After

\mathrm{Dom}(R)=\{1,3,4\}\neq A

Conditions: none

Rule: set_extensionality · Uses: S03, S05, G1, set_extensionality

Leaf basis: set_extensionality + subset_def + roster_membership

⊇: S03. ⊆: Dom(R)⊆A={1,2,3,4}, and 2 is excluded by S05, so the elements of Dom(R) can only be 1, 3, 4. By set equality, Dom(R)={1,3,4}. Since 2∈A∖Dom(R), Dom(R)≠A.

S07 · implies

Before

2\notin\mathrm{Dom}(R),\ (1,2)\in R,\ (1,3)\in R

After

R\ \text{is not a function}\ A\to B

Conditions: none

Rule: function_graph · Uses: S05, G2, function_graph

Leaf basis: function_graph + numeric_evaluation

A function A→B requires exactly one y for each x∈A. R fails in two places: 2 has no y at all (S05, not total), and 1 has two values, 2 and 3, with 2≠3 (not single-valued). Either failure alone is enough. MKO paragraph one notes that a relation need not be a total function.

S08 · implies

Before

y\in R[C],\quad C=\{1,3\}

After

2\in R[C],\ 3\in R[C]

Conditions: none

Rule: mko_relation_def · Uses: mko_relation_def, G2, G3, exists_intro

Leaf basis: mko_relation_def + exists_intro + set_builder

By the MKO, y∈R[C] exactly when y∈B and some x∈C has (x,y)∈R. The pairs with first coordinate in C={1,3} are (1,2), (1,3), (3,3), giving the outputs 2, 3, 3. By ∃-introduction, 2∈R[C] (witness x=1) and 3∈R[C] (witness x=1 or x=3).

S09 · implies

Before

2,3\in R[C]

After

R[C]=\{2,3\}

Conditions: none

Rule: set_extensionality · Uses: S08, G2, G3, set_extensionality

Leaf basis: set_extensionality + roster_membership + cartesian_product_def

⊆: the other elements of B are 4, 5, 6. No pair of R has second coordinate 4 or 5; the only pair with second coordinate 6 is (4,6), whose first coordinate 4∉C (N4: (4−1)(4−3)≠0). So 4, 5, 6∉R[C]. With S08, R[C]={2,3}. The output 3 occurs twice (from (1,3) and (3,3)) but is listed once in the set.

S10 · implies

Before

R[\varnothing]

After

R[\varnothing]=\varnothing

Conditions: none

Rule: mko_relation_def · Uses: mko_relation_def, empty_set_def

Leaf basis: mko_relation_def + empty_set_def + quantifier_negation + set_extensionality

y∈R[∅] would need some x∈∅ with (x,y)∈R; ∅ has no elements, so this fails for every y, and R[∅]=∅. This is what MKO paragraph two says: the image of the empty input set is empty.

S11 · implies

Before

R=\{(1,2),(1,3),(3,3),(4,6)\}

After

R^{-1}=\{(2,1),(3,1),(3,3),(6,4)\}\subseteq B\times A

Conditions: none

Rule: mko_relation_def · Uses: mko_relation_def, G2, L_converse_member

Leaf basis: mko_relation_def + cartesian_product_def + set_extensionality

By the MKO, R⁻¹={(y,x) ∣ (x,y)∈R}: reverse each pair. (1,2)→(2,1), (1,3)→(3,1), (3,3)→(3,3), (4,6)→(6,4). The first coordinates 2, 3, 3, 6 are in B and the second coordinates 1, 1, 3, 4 are in A, so R⁻¹⊆B×A: source and target are swapped as well. By L_converse_member, R⁻¹ consists of exactly these four pairs.

S12 · implies

Before

(1,2)\in R,\ (2,1)\in R^{-1}

After

(2,1)\notin R,\ \text{so}\ R^{-1}\neq R

Conditions: none

Rule: set_extensionality · Uses: S01, S11, set_extensionality

Leaf basis: set_extensionality + cartesian_product_def + subset_def

Ordered pairs keep their direction: (2,1)∈R⁻¹ but (2,1)∉R, because R⊆A×B (S01) while the second coordinate 1∉B. By set equality, R⁻¹≠R. Although A and B share the labels 2, 3, 4, (1,2) and (2,1) are still different ordered pairs.

S13 · theorem_application

Before

\mathrm{Dom}(R^{-1})

After

\mathrm{Dom}(R^{-1})=R[A]=\{2,3,6\}

Conditions: none

Rule: L_dom_converse · Uses: S11, L_dom_converse

Leaf basis: mko_relation_def + set_extensionality + exists_intro

By Lemma L_dom_converse, Dom(R⁻¹)=R[A]. Compute R[A]: all four pairs of R have first coordinate in A, so all count, with outputs 2, 3, 3, 6, giving the set {2,3,6}. Direct check: the first coordinates of the pairs of R⁻¹ are 2, 3, 3, 6, in agreement. The elements 4 and 5 of B are not among them.

S14 · implies

Before

R^{-1}=\{(2,1),(3,1),(3,3),(6,4)\}

After

R^{-1}\ \text{is not a function}\ B\to A

Conditions: none

Rule: function_graph · Uses: S11, S13, function_graph

Leaf basis: function_graph + roster_membership

A function B→A requires exactly one x for each y∈B. 4∈B is not in Dom(R⁻¹)={2,3,6} (N5) and has no x at all; 3 has two values of x, namely 1 and 3. So R⁻¹ is not a function. The converse relation always exists, but it is not automatically an inverse function and gives no proof of injectivity, surjectivity or invertibility (MKO paragraph three).

S15 · theorem_application

Before

(R^{-1})^{-1}

After

(R^{-1})^{-1}=R

Conditions: none

Rule: L_converse_twice · Uses: S11, L_converse_twice

Leaf basis: mko_relation_def + set_extensionality

By Lemma L_converse_twice, swapping again returns R: (2,1)→(1,2), (3,1)→(1,3), (3,3)→(3,3), (6,4)→(4,6), exactly the four pairs of R. Taking the converse can be undone at the level of relations, regardless of whether R⁻¹ is a function.

S16 · implies

Before

\text{S01, S06, S07, S09, S10, S11, S13, S14}

After

\mathrm{Dom}(R)=\{1,3,4\},\ R[C]=\{2,3\},\ R[\varnothing]=\varnothing,\ \mathrm{Dom}(R^{-1})=\{2,3,6\}

Conditions: none

Rule: and_intro_elim · Uses: S01, S06, S07, S09, S10, S11, S13, S14

Leaf basis: and_intro_elim

Summary: R⊆A×B (S01); Dom(R)={1,3,4}≠A (S06); R is not a function A→B (S07); R[C]={2,3} (S09); R[∅]=∅ (S10); R⁻¹={(2,1),(3,1),(3,3),(6,4)}⊆B×A (S11); Dom(R⁻¹)=R[A]={2,3,6} (S13); R⁻¹ is not a function B→A (S14).

Substeps and lemmas

S11.1 · equivalent

Before

(y,x)\in S^{-1}

After

(x,y)\in S

Conditions: S\subseteq X\times Y

Rule: cartesian_product_def · Uses: mko_relation_def, cartesian_product_def

Leaf basis: mko_relation_def + cartesian_product_def + eq_replace

Let S⊆X×Y be any relation. ⇐: if (x,y)∈S, then (y,x)∈S⁻¹ by definition. ⇒: if (y,x)∈S⁻¹, then (y,x)=(y′,x′) for some (x′,y′)∈S; equality of ordered pairs gives y=y′ and x=x′, so (x,y)=(x′,y′)∈S. This proves Lemma L_converse_member.

S13.1 · equivalent

Before

y\in\mathrm{Dom}(R^{-1})

After

y\in R[A]

Conditions: none

Rule: L_converse_member · Uses: mko_relation_def, L_converse_member, set_extensionality

Leaf basis: mko_relation_def + set_builder + set_extensionality + logic_chain

Apply the MKO's definition of domain to R⁻¹⊆B×A: y∈Dom(R⁻¹) ⇔ y∈B and ∃x∈A (y,x)∈R⁻¹. By L_converse_member, (y,x)∈R⁻¹ ⇔ (x,y)∈R, so this is ⇔ y∈B and ∃x∈A (x,y)∈R ⇔ y∈R[A] (with C=A). By set equality, Dom(R⁻¹)=R[A]. This proves Lemma L_dom_converse.

S15.1 · equivalent

Before

(x,y)\in(R^{-1})^{-1}

After

(x,y)\in R

Conditions: none

Rule: L_converse_member · Uses: L_converse_member, set_extensionality

Leaf basis: set_extensionality + logic_chain + cartesian_product_def

Apply L_converse_member to the relation R⁻¹: (x,y)∈(R⁻¹)⁻¹ ⇔ (y,x)∈R⁻¹; apply it once more to R: (y,x)∈R⁻¹ ⇔ (x,y)∈R. The two sets have the same elements, so (R⁻¹)⁻¹=R by set equality. This proves Lemma L_converse_twice.

Reverse audits

  • S16 · sufficient_goal_reduction · S01, S06, S07, S09, S10, S11, S13, S14, and_intro_elim — Goal G: the computations and decisions the task asks for. Sufficient condition H: the conclusions of the listed steps; H⇒G is just conjunction. Each part of H is proved forwards from G1 to G3, and G is never used as a premise.
  • S15.1 · inverse_equivalence · L_converse_member, logic_chain — Chaining two equivalences gives an equivalence.
  • S15 · premise_audit · L_converse_twice — This is a fact about relations; it does not claim that R or R⁻¹ has an inverse function.
  • S14 · premise_audit · S13, function_graph — One failure suffices; it is not claimed that the converse of a relation is never a function.
  • S13.1 · inverse_equivalence · mko_relation_def, L_converse_member, logic_chain — Every link of the chain is an equivalence, so the whole chain holds both ways.
  • S13 · premise_audit · L_dom_converse, S11 — The lemma is proved in S13.1; R[A] is computed by the same method as in S08 and S09.
  • S12 · premise_audit · S01, S11, set_extensionality, cartesian_product_def — One element lying in one set but not the other suffices to show the sets differ.
  • S11.1 · inverse_equivalence · mko_relation_def, cartesian_product_def, eq_replace — The two directions come from the definition of the converse and from the equality condition for ordered pairs.
  • S11 · premise_audit · mko_relation_def, L_converse_member, cartesian_product_def — It needs the listing of R to be complete; (3,3) is unchanged by the swap but is still an element of R⁻¹.
  • S10 · premise_audit · mko_relation_def, empty_set_def, quantifier_negation — This holds for any relation and does not depend on the data of R.
  • S09 · premise_audit · S08, set_extensionality, roster_membership — The ⊆ direction must exclude every remaining element of B; only both directions together give set equality.
  • S08 · premise_audit · mko_relation_def, exists_intro — Each output needs a witness in C; this step proves only the ⊇ direction.
  • S07 · premise_audit · S05, function_graph — One failure suffices (N6 checks 2≠3); it is not claimed that R becomes a function after any repair.
  • S06 · premise_audit · S03, S05, set_extensionality — Both inclusions are needed; all four elements of A are accounted for (N3: 3+1=4).
  • S05 · premise_audit · S02, S04, quantifier_negation — S04 must hold for every y in B; checking a few values of y would not be enough.
  • S04 · premise_audit · roster_membership, cartesian_product_def, forall_intro — It needs the listing of R to be complete (G2); if R had unlisted pairs, this step would fail.
  • S03 · premise_audit · S02, exists_intro — Each x needs one witness in B; uniqueness of the witness is not claimed.
  • S02 · inverse_equivalence · mko_relation_def, set_builder — Unfolding the definition and set-builder notation are both two-way.
  • S01 · premise_audit · subset_def, cartesian_product_def, roster_membership — Each pair must be checked, and the order of coordinates may not be swapped: in (4,6), 4 must be in A and 6 in B; (6,4) would not be in A×B, because 6∉A. It is not claimed that R equals A×B (which has 20 elements, N1).

Error controls and negative controls

The declared source is not the domain

One misconception named by the MKO is taking the declared source set as the actual domain. R is declared from A={1,2,3,4}, but 2 has no pair (S04, S05), so Dom(R)={1,3,4}. Calling A the domain would miss exactly the difference at 2.

The converse is not an inverse function

The other misconception named by the MKO is treating the converse as an inverse function that already exists. R⁻¹ exists for every relation, but here 4∈B has no output and 3 has two (S14), so R⁻¹ is not a function B→A, let alone an inverse of R; R itself is not a function either (S07).

Pairs keep direction; images list each value once

(1,2)∈R does not give (2,1)∈R: R⊆A×B while 1∉B (S12). Shared labels in A and B do not make the order irrelevant. In computing R[C], the output 3 comes from two pairs but is listed once in the set, so R[C] has 2 elements, not 3 (S09).

  • R is declared as a relation from A to B, so Dom(R)=A → reject — 2∈A has no (2,y)∈R; Dom(R)={1,3,4}.
  • R⁻¹ is the inverse function of R → reject — R⁻¹ is not a function B→A: 4 has no output and 3 has the two outputs 1 and 3; R itself is not a function either.
  • R[C]={2,3,3}, which has three elements → reject — Repeated values count once in a set; R[C]={2,3} has two elements.
  • (1,2)∈R, so (2,1)∈R → reject — R⊆A×B while 1∉B, so (2,1)∉R; ordered pairs keep their direction.

Result and limitations

Since R⊆A×B, R is a relation from A to B. Dom(R)={1,3,4}, which differs from the declared source A (2 has no outgoing pair); R[C]={2,3} and R[∅]=∅; R⁻¹={(2,1),(3,1),(3,3),(6,4)}⊆B×A, Dom(R⁻¹)=R[A]={2,3,6}, and (R⁻¹)⁻¹=R. R is not a function A→B (2 has no output, 1 has two), and R⁻¹ is not a function B→A (4 has no output, 3 has two), so the converse relation does not give an inverse function.

  • N2, N4 and N5 encode 'a number equals none of the listed values' as a nonzero product of differences (zero-product property); they only recompute these particular numbers, and the argument itself is given item by item in the corresponding steps.
  • This guide does not treat composition of relations, equivalence relations, order relations or infinite relations.

Verification and source binding

6 declared checks for this guide; only the listed expressions are covered.

  • source commit: b28a5edbd46279b1db2a3f3f48bb3f447e18899f
  • adopted source SHA-256: 43c26b506fc0b915b03ad39f9c5dcf722f8dfaf1e7be2295ec1d0d519436062d
  • original source SHA-256: 43c26b506fc0b915b03ad39f9c5dcf722f8dfaf1e7be2295ec1d0d519436062d
  • Lean: NOT_RUN · independent AI: NOT_MEASURED

Same-source full JSON (formulas, ASTs, controls and revision log)