Addition and subtraction of functions
For two functions, \((D_f, R, f)\) and \((D_g, R, g),\) or simply \(f\) and \(g,\) we can define the sum of \(f\) and \(g\) if there is a addition operation \(+_{R}\) defined on \(R\) and \(R\) is closed under this operation. That is:
- for every \(x\) and \(y\) in \(R,\) \(x +_R y\) is also in \(R.\)
The sum of \(f\) and \(g\) will be a function with Domain set \(D = D_f \cap D_g = \{x \vert x \in D_f \text{ and } x \in D_g\},\) Range set \(R\) and rule given by \((f+g)(x) = f(x) + g(x).\)
In the past, you may have worked with integer valued functions defined on the Integers, \(\mathbb{Z}.\) For instance, the functions \(f\) and \(g\) both from \(\mathbb{Z}\) to \(\mathbb{Z}\) with the rules \(f(x) = x^2\) and \(g(x) = 2.\) The integers are closed under (real) addition, meaning that the sum of two integers is again an integer. Thus, the sum of \(f\) and \(g\) can be defined. The new rule for \(f+g\) will have as the Domain set \(\mathbb{Z} \cap \mathbb{Z} = \mathbb{Z}\) and Range set \(\mathbb{Z}.\) When finding the image of an integer \(x\) under \(f+g,\) the rule assigns the element \((f+g)(x) = f(x) + g(x) = x^2 + 2.\) The graph of \((f+g)\) is the collection (set) of discrete points \(G = \{(x, x^2 + 2) \vert x \in \mathbb{Z}\}.\) Notice that \(+\) is integer addition, and both \(f(x)\) and \(g(x)\) are integers.
Consider the subset of the positive integers \(\{0, 1, 2, 3, 4, 5\}.\) Real addition (or even integer addition) does not meet the requirement. A counter-example that proves this set is not closed under additions is the pair of elements \(1\) and \(5\) in the set. Since the sum is \(1 + 5 = 6\) is not in the set, the set is not closed under real addition. However, we can use addition mod 6.
For two elements in \(\{0, 1, 2, 3, 4, 5\}\), \(x\) and \(y\), we say that \(x + y\) is the remainder in \(R\) when \(x + y\) using real addition is divided by \(6.\) In this way \(1 + 5\) is 0 since \(1 + 5 = 6\) in the set of real numbers and the remainder when 6 is divided by 6 is 0. What about \(2 + 5?\)
In the reals, \(2 + 5 = 7\) and \(7 = 1*6 + 1.\) When 7 is divided by 6 in the Reals, the integer remainder is 1. Thus the operation we are giving to the Range set \(\{0, 1, 2, 3, 4, 5\}\) defines \(2 +_R 5 = 1.\) For all \(x\) and \(y\) in the set \(\{0, 1, 2, 3, 4, 5\}\) the sum of \(x\) and \(y\) is \(r,\) written \(x +_R y = r,\) where \(0 \leq r \leq 5.\) It follows that this set is closed under addition mod 6.
Example 1
Consider the functions \(f\) and \(g\) on the set \(D = \{0, 1, 2\}\) with range set \(\{0, 1, 2\}\) where addition on \(R\) is addition mod 3.
\(f(x) = \begin{cases}
0 & x = 0 \text{ or } x = 1\\
2 & x = 2\\
\end{cases}\)
and
\(g(x) = \begin{cases}
1 & x = 0 \text{ or } x = 1\\
0 & x = 2\\
\end{cases}\)
Then \((D, R, f+g)\) is in the set \(N\) of all functions from \(\{0, 1, 2\}\) to itself and \((f + g)(x) = f(x) +_{R} g(x) = \begin{cases} 1 & x = 0 \text{ or } x = 1\\ 2 & x = 2\\ \end{cases}\)
Since addition of two functions works, is there subtraction between two functions? With certain assumptions to simplify the definition, we can define the difference of two functions \((D, R, f)\) and \((D, R, g).\) It is required that the Range set have an addition operation defined on it as well as the truth of the following two statements:
-
There is an element \(z\) that acts as the additive identity in the Range set \(R\) so that for \(x\) in \(R,\) \(x + z = x.\)
-
For every \(x\) in \(R,\) there is a negative of \(-x\) so that \(x\) plus the negative of \(x\) is the additive identity, \(x + (-x) = z.\)
Example 2 Consider the set \(A = \{c, d\}\) with addition \(+_A\) defined on it. The following is a “look-up” table describing the results of the sum between every pair of elements in the set \(A.\)
Addition on A | ||
---|---|---|
c | d | |
c | d | c |
d | c | d |
In this case, the additive identity element for \(A\) is the element \(d\) because the element satisfies statement 1. above. Statement 2. requiring the existence of negatives, is satisfied since \(c + d = c\) and \(d + d = d.\) This implies that \(-c = d\) and \(-d = d.\)
Example 3 Consider the set \(A = \{c, d\}\) with addition \(+_A\) defined by:
Addition on A | ||
---|---|---|
c | d | |
c | d | c |
d | d | c |
The set \(A\) under this new addition has no additive identity, thus no negatives. Note that this addition is also not commutative, that is \(c + d \neq d + c.\)
In terms of the set \(N = \{(D, R, f)\},\) we will use \(+_{N}\) to represent the addition between two functions in \(N.\) Given the function \((D, R, f),\) the element negative \(f,\) \(-f,\) is the function \((D, R, -f)\) where the rule \(-f\) is defined \(-f(x) = -(f(x)).\)
Example 4 Take \(R\) to be the set \(\{0, 1, 2\}\) with addition mod 3.
\[0 +_R 0 = 0\] \[0 +_R 1 = 1 = 1 +_R 0\] \[0 +_R 2 = 2 = 2 +_R 0\] \[1 +_R 1 = 2\] \[2 +_R 1 = 0 = 1 +_R 2\]So \(-0 = 0 \text{ and } -1 = 2 \text{ and } -2 = 1\)
For the constant function \(r_1\) with Domain set = Range set \((R, R, r_1)\) defined by \(r_1(x) = 1\) for all \(x,\) \(-r_1\) is also defined from \(R\) to \(R\) with \(-r_1(x) = 2\) for all \(x.\)
The difference of functions \((D, R, f)\) and \((D, R, g)\), is denoted \((D, R, f-g)\) or just \(f - g,\) with Domain set \(D\) and Range set \(R\) with rule given by \((f - g)(x) = f(x) +_{R} -g(x).\)
Example 5 What is the difference of a function and it’s negative? Let \((D, R, f)\) be a function where \((R, +_R)\) is closed set. Then \(f + -f\) is the function with Domain set \(D,\) Range set \(R\) and rule \((f + -f)\) given by \((f + -f)(x) = f(x) + -f(x).\) Since \(-f(x)\) is the negative of \(f(x)\) under \(+_R\) in \(R,\) \(f(x) + -f(x)\) is the additive identity for \(R\) that we will call \(0_R.\) The resultant function \(f + -f\) takes every element to \(0_R.\)