Given two functions $f$ and $g$, prove that $f=g$ iff dom$f=$ dom $g$ and for every $x\in$ dom $f$, $f(x)=g(x)$

elementary-set-theoryfunctionsproof-writingsolution-verification

Given two functions $f$ and $g$, prove that $f=g$ iff dom$f=$ dom $g$ and for every $x\in$ dom $f$, $f(x)=g(x)$

Proof:

Assume $f=g$. Then we have

$$(a_0,b_0)\in f\Rightarrow (a_0,b_0)\in g\wedge(a_1,b_1)\in g\Rightarrow (a_1,b_1)\in f$$
so
$$a_0\in\mbox{dom }f\Rightarrow a_0\in\mbox{dom }g\wedge a_1\in\mbox{dom }g\Rightarrow a_1\in\mbox{dom }f$$
and
$$\mbox{dom }f\subseteq\mbox{dom }g\wedge\mbox{dom }g\subseteq\mbox{dom }f$$
therefore,
$$\mbox{dom }f=\mbox{dom }g$$

Now let $x\in\mbox{dom }f$. Then $\exists y=f(x)\in\mbox{rng }f$ such that $(x,y)\in f$. But if $f=g$, then $(x,y)\in g$.

$$\therefore\forall x\in\mbox{dom }g, f(x)=g(x)$$

Now to show the converse, let $\mbox{dom }f=\mbox{dom }g$ and $\forall x\in\mbox{dom }f$, $f(x)=g(x)$.

Then we have $\forall a_0\in\mbox{dom }f$, $\exists b_0\in\mbox{rng }f$ such that $(a_0,b_0)\in f$. But since $\forall x\in\mbox{dom }f$, $f(x)=g(x)$, we have

$$(a_0,b_0)\in f\Rightarrow(a_0,b_0)\in g$$

Likewise, $\forall a_1\in\mbox{dom }g$, $\exists b_1\in\mbox{rng }g$ such that $(a_1,b_1)\in g$. But again, since $\forall x\in\mbox{dom }f$, $f(x)=g(x)$, we have

$$(a_1,b_1)\in g\Rightarrow(a_1,b_1)\in f$$

Therefore, we have $f\subseteq g$ and $g\subseteq f$, and thus $f=g$.

$\blacksquare$

I'm just looking for proof validation here. Is my argument sound? Thanks in advance.

I'm using the usual set theoretic definition of a function:

Let $A$ and $B$ be sets. A function from $A$ to $B$ is a nonempty relation $f\subseteq A\times B$ that satisfies the following two conditions:

Existence – $\forall a\in A$, $\exists b\in B$ such that $(a,b)\in f$.

Uniqueness – If $(a,b)\in f$ and $(a,c)\in f$, then $b=c$.

Best Answer

Your argument is fine, but you are doing more than you need to do in the first part: you are doing the right thing in the second part showing that $f = g$ as sets of pairs if $f$ and $g$ are functions with the same domain that agree on any element of that domain. For the first part, there isn't really anything to prove: if $f = g$, then any property that holds of $f$ also holds of $g$ (because they are the same thing).

Related Question