Relations are one of the most applicable concepts we derive from set theory. They lead directly to functions and thus are an early step on the road to understanding Calculus.

## Relations

Given two sets ${\displaystyle A}$ and ${\displaystyle B}$ we we define a Relation ${\displaystyle R}$ to be a subset of ${\displaystyle A\times B}$. The elements of ${\displaystyle R}$ are ordered pairs ${\displaystyle (x,y)}$, with ${\displaystyle x\in A}$ and ${\displaystyle y\in B}$. ${\displaystyle A}$ is the set of all available inputs and ${\displaystyle B}$ is the set of all available outputs. Not all the elements of ${\displaystyle A}$ and ${\displaystyle B}$ need to appear in the ordered pairs of ${\displaystyle R}$ though. Some possible inputs may not be allowed and some possible outputs may not occur. There is a lot more here and a lot of different ways terms for these sets can be defined. The most common approach (in Ontario) is to ignore some details and implicitly assume that the sets of possible inputs and outputs have had all unused element pruned from them already. We then call the set of inputs ${\displaystyle A}$ the Domain and the set of outputs ${\displaystyle B}$ the Range. The strength of this approach is in its simplicity and practicality. The weakness of this approach is seen readily when graphing certain functions. One can see that these functions do not have certain inputs or outputs, but these options are clearly represented on the graph. Where do these value exist? They are not in our Domain or Range? The super sets of available inputs and outputs are on clear display here. They are the pair of number lines that make the axes. We will, none the less, use the Ontario convention in all articles apart from this one.

Given an input ${\displaystyle x\in A}$ we get one or more outputs ${\displaystyle y\in B}$. This can be done arbitrarily with abstract objects and concepts, but will be most useful when done with rules and applied to numbers. To illustrate, we will consider an example of a relation which students will be familiar with, the greater than relation ${\displaystyle >}$ on the real numbers. For simplicity lets restrict ourselves to the sets ${\displaystyle A=\{1,2,3\}}$ and ${\displaystyle B=\{2,3,4\}}$. Then ${\displaystyle A\times B=\{(1,2),(1,3),(1,4),(2,2),(2,3),(2,4),(3,2),(3,3),(3,4)\}}$ and using our previous knowledge (the rules which tell us how numbers compare in size) the subset of ${\displaystyle A\times B}$ that represents the relation ${\displaystyle R}$ is ${\displaystyle \{(3,2)\}}$. This means that of all the options allowed (${\displaystyle A\times B}$), the only combination that fits the relation is ${\displaystyle (3,2)}$. Students will of course remember that there is another more well known notation for this ${\displaystyle 3>2}$. More generally, can write ${\displaystyle 3R2}$ and list our relations this way. We can also write our ordered pairs in a table or plot them on x-y coordinate axes, much like students will have seen done with linear functions in grade 9.

Students will notice that the example given had sets with rules to decide which elements were in them instead of completely arbitrary elements (They were all the natural numbers within a certain interval. No trees, colours, concepts, etc.) and that the relation itself was a simple rule too (as opposed to an arbitrary list of ordered pairs where the "relationship" is that they appear in the list). Arbitrary sets and relations are allowed, but are very seldom of much use in practical contexts.

We will not use relations much beyond the intuitive grasp students already have of inequalities and in the definition of functions which follows.

## Functions

A Function is a relation for which each input has exactly one output. An example of this is equality on the real numbers ${\displaystyle x=y}$ (ie. the rule the the input and output are the same). A more instructive example might be the function ${\displaystyle y=x+5}$ (ie. the rule that the output is five more than the input) on the sets ${\displaystyle A=\{2,3,4\}}$ and ${\displaystyle \{7,8,9\}}$. We find ${\displaystyle R=\{(2,7),(3,8),(4,9)\}}$. It is useful to note that the range is made clear implicitly by the domain and the function. Formally we must set the domain before hand, but informally we really don't need to, we just need to watch out for troublesome outputs. You will learn how to handle troublemakers (division by zero, ${\displaystyle {\sqrt {-1}}}$, and others) as you continue your studies.

This "implicit range", shows why it is important to make clear the distinction in intent when using functions and relations. Relations are best understood as showing how elements of sets compare with one another (how they relate). Functions are better understood as input output machines. Given an input a single output is produced. In the abstract sense we can say functions are a special kind of relation and this can be very useful in some contexts, but when one applies them to the real world we often treat them as very different beasts.

We denote a function of the variable ${\displaystyle x}$ by ${\displaystyle f(x)}$. ${\displaystyle f}$ is the name of the function, ${\displaystyle x}$ indicates what the variable the function takes as input. The brackets are not strictly needed, but come in handy when we allow more complicated objects to be given as inputs.

## Graphing Functions

Maybe all forms of visualization? Relations too?

## Inverse Functions

INVERSE RELATIONS????? As with many things in math, it is useful to find out if we can undo something which we have done. In the case of a function we want to know if there is another function which will map the outputs of the original function back to its corresponding inputs. If such a function exists, then it is called the Inverse Function of the first function. We denote the inverse of ${\displaystyle f}$ by ${\displaystyle f^{-1}}$ and write it in terms of its input explicitly as ${\displaystyle f^{-1}(x)}$. for instance, if we have the function ${\displaystyle f(x)=x+5}$ then its inverse function would be ${\displaystyle f^{-1}(x)=x-5}$, because if we take any number and add five then subtract five then we end up with our original number again. Not all functions have an inverse though. ${\displaystyle f(x)=x^{2}}$ on the real numbers has no inverse. The reason is that given a number and that same number with opposite sign (say ${\displaystyle 2}$ and ${\displaystyle -2}$) as input the out put is the same (say ${\displaystyle 4}$). So when we cannot have a function that undoes squaring of real numbers, because it would have to map one input (say ${\displaystyle 4}$) to two outputs (say ${\displaystyle 2}$ and ${\displaystyle -2}$). Functions are only allowed to map an input to one output, so no inverse function exists. If we restrict ourselves to the non-negative reals though an inverse does exits for squaring. It is the square root function we are all familiar with.

## Why Functions?

Functions appear all over high school math courses. There are linear functions, quadratic functions, polynomial functions, rational functions, trig functions, inverse trig function, exponential functions, logarithmic functions, implicitly defined functions, discrete functions (sequences). Many more exist outside of curriculum content too.

The popularity of functions is based in their ability to show how an input can be changed into an output. This can be used to represent phenomena through out human experience (motion, traffic, rates of reactions, stock markets, population dynamics, among many other things). We can further analyze these functions, using calculus, to tell us about the rates of change of these functions and to find critical and optimal points to maximize or minimize quantities. We can use them to find the areas and volumes of strange shapes, probabilities, and thermodynamics. Functions are incredibly useful in applications and ever have interesting properties all on their own. In pure math there is a field called Functional Analysis, in which we can describe the distance between functions and try to make hard functions out of easier ones, so that problems can be solved more easily.

For those who want a more detailed account of the input and output sets it is recommended that they research the concepts of domain, codomain, range, image, preimage, set of departure, set of destination, etc.

A quick search to learn about the reflexive property, symmetric property, transitive property, equivalence relations, congruence relations, partitions, equivalence classes, etc. could be of interest to the reader.

there are many interesting properties of generalized functions to read about too. Interested students are encouraged to read about injective functions, surjective functions and bijective functions

Relations are one of the most applicable concepts we derive from set theory. They lead directly to functions and thus are an early step on the road to understanding Calculus.

## Relations

Given two sets ${\displaystyle A}$ and ${\displaystyle B}$ we we define a Relation ${\displaystyle R}$ to be a subset of ${\displaystyle A\times B}$. The elements of ${\displaystyle R}$ are ordered pairs ${\displaystyle (x,y)}$, with ${\displaystyle x\in A}$ and ${\displaystyle y\in B}$. ${\displaystyle A}$ is the set of all available inputs and ${\displaystyle B}$ is the set of all available outputs. Not all the elements of ${\displaystyle A}$ and ${\displaystyle B}$ need to appear in the ordered pairs of ${\displaystyle R}$ though. Some possible inputs may not be allowed and some possible outputs may not occur. There is a lot more here and a lot of different ways terms for these sets can be defined. The most common approach (in Ontario) is to ignore some details and implicitly assume that the sets of possible inputs and outputs have had all unused element pruned from them already. We then call the set of inputs ${\displaystyle A}$ the Domain and the set of outputs ${\displaystyle B}$ the Range. The strength of this approach is in its simplicity and practicality. The weakness of this approach is seen readily when graphing certain functions. One can see that these functions do not have certain inputs or outputs, but these options are clearly represented on the graph. Where do these value exist? They are not in our Domain or Range? The super sets of available inputs and outputs are on clear display here. They are the pair of number lines that make the axes. We will, none the less, use the Ontario convention in all articles apart from this one.

Given an input ${\displaystyle x\in A}$ we get one or more outputs ${\displaystyle y\in B}$. This can be done arbitrarily with abstract objects and concepts, but will be most useful when done with rules and applied to numbers. To illustrate, we will consider an example of a relation which students will be familiar with, the greater than relation ${\displaystyle >}$ on the real numbers. For simplicity lets restrict ourselves to the sets ${\displaystyle A=\{1,2,3\}}$ and ${\displaystyle B=\{2,3,4\}}$. Then ${\displaystyle A\times B=\{(1,2),(1,3),(1,4),(2,2),(2,3),(2,4),(3,2),(3,3),(3,4)\}}$ and using our previous knowledge (the rules which tell us how numbers compare in size) the subset of ${\displaystyle A\times B}$ that represents the relation ${\displaystyle R}$ is ${\displaystyle \{(3,2)\}}$. This means that of all the options allowed (${\displaystyle A\times B}$), the only combination that fits the relation is ${\displaystyle (3,2)}$. Students will of course remember that there is another more well known notation for this ${\displaystyle 3>2}$. More generally, can write ${\displaystyle 3R2}$ and list our relations this way. We can also write our ordered pairs in a table or plot them on x-y coordinate axes, much like students will have seen done with linear functions in grade 9.

Students will notice that the example given had sets with rules to decide which elements were in them instead of completely arbitrary elements (They were all the natural numbers within a certain interval. No trees, colours, concepts, etc.) and that the relation itself was a simple rule too (as opposed to an arbitrary list of ordered pairs where the "relationship" is that they appear in the list). Arbitrary sets and relations are allowed, but are very seldom of much use in practical contexts.

We will not use relations much beyond the intuitive grasp students already have of inequalities and in the definition of functions which follows.

## Functions

A Function is a relation for which each input has exactly one output. An example of this is equality on the real numbers ${\displaystyle x=y}$ (ie. the rule the the input and output are the same). A more instructive example might be the function ${\displaystyle y=x+5}$ (ie. the rule that the output is five more than the input) on the sets ${\displaystyle A=\{2,3,4\}}$ and ${\displaystyle \{7,8,9\}}$. We find ${\displaystyle R=\{(2,7),(3,8),(4,9)\}}$. It is useful to note that the range is made clear implicitly by the domain and the function. Formally we must set the domain before hand, but informally we really don't need to, we just need to watch out for troublesome outputs. You will learn how to handle troublemakers (division by zero, ${\displaystyle {\sqrt {-1}}}$, and others) as you continue your studies.

This "implicit range", shows why it is important to make clear the distinction in intent when using functions and relations. Relations are best understood as showing how elements of sets compare with one another (how they relate). Functions are better understood as input output machines. Given an input a single output is produced. In the abstract sense we can say functions are a special kind of relation and this can be very useful in some contexts, but when one applies them to the real world we often treat them as very different beasts.

We denote a function of the variable ${\displaystyle x}$ by ${\displaystyle f(x)}$. ${\displaystyle f}$ is the name of the function, ${\displaystyle x}$ indicates what the variable the function takes as input. The brackets are not strictly needed, but come in handy when we allow more complicated objects to be given as inputs.

## Graphing Functions

Maybe all forms of visualization? Relations too?

## Inverse Functions

INVERSE RELATIONS????? As with many things in math, it is useful to find out if we can undo something which we have done. In the case of a function we want to know if there is another function which will map the outputs of the original function back to its corresponding inputs. If such a function exists, then it is called the Inverse Function of the first function. We denote the inverse of ${\displaystyle f}$ by ${\displaystyle f^{-1}}$ and write it in terms of its input explicitly as ${\displaystyle f^{-1}(x)}$. for instance, if we have the function ${\displaystyle f(x)=x+5}$ then its inverse function would be ${\displaystyle f^{-1}(x)=x-5}$, because if we take any number and add five then subtract five then we end up with our original number again. Not all functions have an inverse though. ${\displaystyle f(x)=x^{2}}$ on the real numbers has no inverse. The reason is that given a number and that same number with opposite sign (say ${\displaystyle 2}$ and ${\displaystyle -2}$) as input the out put is the same (say ${\displaystyle 4}$). So when we cannot have a function that undoes squaring of real numbers, because it would have to map one input (say ${\displaystyle 4}$) to two outputs (say ${\displaystyle 2}$ and ${\displaystyle -2}$). Functions are only allowed to map an input to one output, so no inverse function exists. If we restrict ourselves to the non-negative reals though an inverse does exits for squaring. It is the square root function we are all familiar with.

## Why Functions?

Functions appear all over high school math courses. There are linear functions, quadratic functions, polynomial functions, rational functions, trig functions, inverse trig function, exponential functions, logarithmic functions, implicitly defined functions, discrete functions (sequences). Many more exist outside of curriculum content too.

The popularity of functions is based in their ability to show how an input can be changed into an output. This can be used to represent phenomena through out human experience (motion, traffic, rates of reactions, stock markets, population dynamics, among many other things). We can further analyze these functions, using calculus, to tell us about the rates of change of these functions and to find critical and optimal points to maximize or minimize quantities. We can use them to find the areas and volumes of strange shapes, probabilities, and thermodynamics. Functions are incredibly useful in applications and ever have interesting properties all on their own. In pure math there is a field called Functional Analysis, in which we can describe the distance between functions and try to make hard functions out of easier ones, so that problems can be solved more easily.