# Function Equality: A Proof

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

Here the function definition is as follows:

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:

$\hspace{1cm}$1. Existence: For all $a$ in $A$, there exists a $b$ in $B$ such that $(a,b)\in f$.

$\hspace{1cm}$2. Uniqueness: If $(a,b)\in f$ and $(a,c)\in f$, then $b=c$.

• What exactly are you having trouble with? If you're using the definition of function as a set of ordered pairs, it's straightforward, just use the definitions. What text are you following? Aug 19 '13 at 16:44
• The textbook is called Analysis, and it is written by Steven R. Lay. Aug 19 '13 at 16:52
• Such exercises are sickening and are apt to deter gifted young people from studying mathematics. Mathematics is about real stuff, like: There is an infinity of primes. Aug 19 '13 at 20:05
• @ChristianBlatter I agree... I will study mathematics until I die though. Aug 21 '13 at 3:57

This is the most common definition of equality of functions. What definition are you using?

If you are using the definition of function as a special kind of relation such that every element in domain is related to a unique element in codomain, then your function $f: A \to B$ is a subset of $A \times B$ such that

$(x,y) \;and\; (x,y_{1}) \in f \Rightarrow y = y_{1}$

and $x \in A \Rightarrow \exists y \in B \text{ such that } (x,y) \in f$.

Now can you get the equivalence you need?

OK. In all details, if $f = g$ i.e. if $f \subseteq g$ and $g \subseteq f$ then,

if $a \in dom(f), \exists b \in B s.t. \; (a,b) \in f$

Thus, $(a,b) \in f$ and hence $(a,b) \in g$ and hence $a\in dom(g)$ and also $g(a) = b = f(a)$. Thus, $dom(f) \subseteq dom(g)$ and $f(a) = g(a)$ on $dom(f)$.

Similarly, you show that $dom(g) \subseteq dom(f)$ and $f(a) = g(a)$ on $dom(g)$.

The converse is proved along similar lines.

• Not sure, the text has no definition of type you're looking for. I was just thinking that I could show $f\subseteq g$ and $g\subseteq f$. Aug 19 '13 at 16:44
• @LoieBenedicte What is your definition of a function Aug 19 '13 at 16:45
• @Loie: Maverick’s definition is the same as the one that you added to your question. Aug 19 '13 at 16:57