User:Isheden/sandbox5

Introduction

 * informally we can think of a function as a machine that for each object that is put in spits a corresponding object out



If a function is often used, it may be given a more permanent name as, for example, the signum function of a real number x, defined as follows:
 * $$ \sgn(x) = \begin{cases}

-1 & \text{if } x < 0, \\ 0 & \text{if } x = 0, \\ 1 & \text{if } x > 0. \end{cases}$$

Functions need not act on numbers: the domain and codomain of a function may be arbitrary sets. One example of a function that acts on non-numeric inputs takes English words as inputs and returns the first letter of the input word as output.
 * a function need not be described by a formula, nor need it deal with numbers at all

The set of all permitted inputs to a given function is called the domain of the function. The set of all resulting outputs is called the image or range of the function. The image is often a subset of a set of permissable outputs, called the codomain of the function. Thus, for example, the function f(x) = x2 could take as its domain the set of all real numbers, as its image the set of all non-negative real numbers, and as its codomain the set of all real numbers. In that case, we would describe f as a real-valued function of a real variable. Sometimes, especially in computer science, the term "range" refers to the codomain rather than the image, so care needs to be taken when using the word.
 * two functions are considered equal only if all three are equal (such as $$f(x)=(x+1)(x-1)$$ and $$f(x)=x^2-1$$, both of them $$f:\mathbf{R} \to \mathbf{R}$$)
 * a formula such as $$f(x)=\sqrt{x^2-5x+6}$$ is not a properly defined function on its own, however it is standard to take as the domain the largest possible subset of R (in this case x ≤ 2 or x ≥ 3) and R as the codomain
 * not enough to say "f is a function" without specifying the domain and the codomain, unless these are known from the context
 * example: $$f(n)=n^2, n \in \mathbf{Z}$$ is a subset of $$\mathbf{Z} \times \mathbf{Z}$$ and can define $$f:\mathbf{Z} \to \mathbf{Z}$$, but can also define a different function $$f:\mathbf{Z} \to \mathbf{R}$$
 * the name of the function is f, not f(x)
 * f(x) is a specific element in the codomain

A function can also be called a map or a mapping. Some authors, however, use the terms "function" and "map" to refer to different types of functions. Other specific types of functions include functionals and operators.
 * the words transformation, operator, map, and mapping are really synonyms of function, although by convention they are only used in some specific contexts

Some calculus textbooks define a function as a "rule" that assigns to each element x in a set X a unique element y in a set Y. However, it is not quite accurate to speak of a function as being a rule, rather a function may be determined by a rule.

This definition of function equality means that we should not really speak of a function as being a rule that takes arguments from the domain and produces values in the codomain. Rather a function is determined by such a rule. It is not the rule itself that is the function, even assuming that we are careful to specify the domain and codomain (as we should). It is the argument-to-value association the rule determines that is "the function".

Although f(x) = 2x and f(x) = x + x are different rules, they define the same function. Similarly, f(x) = (x+1)(x−1) is exactly the same function as f(x) = x2−1. Furthermore, functions need not be described by any explicit expression or algorithm.
 * a more substantial objection to the use of the word "rule" is that we want different rules such as $$f(x) = x^2$$ and $$f(x) = x^2 + 3x + 3 - 3(x+1)$$ to define the same function
 * this definition, although intuitively appealing, is not logically precise
 * the difficulty in designing function in this way is that the terms "rule of correspondence" and "assign" are not defined earlier
 * a satisfactory definition can never be constructed by finding synonyms for words that are troublesome
 * function = rule of assignment leads to going in circles (circular definition)


 * Q: What does one need to know about a function to know all about it? A: For each number x one needs to know the number f(x)
 * a function is a collection of pairs of numbers with the following property: if (a, b) and (c, d) are both in the collection, then b = c
 * the collection must not contain two different pairs with the same first element
 * if x is in the domain of f, it follows that there is a unique y such that (x, y) is in f, which is denoted by f(x)

A function of two or more variables is considered in formal mathematics as having a domain consisting of ordered pairs or tuples of the argument values. For example Sum(x,y) = x+y operating on integers is the function Sum with a domain consisting of pairs of integers. Sum then has a domain consisting of elements like (3,4), a codomain of integers, and an association between the two that can be described by a set of ordered pairs like ((3,4), 7). Evaluating Sum(3,4) then gives the value 7 associated with the pair (3,4).
 * rigorous definition based on sets, thinking of functions as sets of ordered pairs (x, y), such that for each x, there is one and only one pair of the form (x, y)

Bloch, Proofs and Fundamentals: A First Course in Abstract Mathematics, pp. 129-134
 * Examples: polynomial function, exponential function, logarithm, trigonometric functions...
 * a function need not be described by a formula, nor need it deal with numbers at all
 * informally we can think of a function as a machine that for each object that is put in spits a corresponding object out
 * function = rule of assignment leads to going in circles (circular definition)
 * rigorous definition based on sets, thinking of functions as sets of ordered pairs (x, y), such that for each x, there is one and only one pair of the form (x, y)
 * we can then define f(x) = y
 * the name of the function is f, not f(x)
 * f(x) is a specific element in the codomain
 * a function consists of three things: a domain, a codomain, and a subset of the Cartesian product of the domain and the codomain
 * can be written as a triple (X, Y, F)
 * two functions are considered equal only if all three are equal (such as $$f(x)=(x+1)(x-1)$$ and $$f(x)=x^2-1$$, both of them $$f:\mathbf{R} \to \mathbf{R}$$)
 * not enough to say "f is a function" without specifying the domain and the codomain, unless these are known from the context
 * example: $$f(n)=n^2, n \in \mathbf{Z}$$ is a subset of $$\mathbf{Z} \times \mathbf{Z}$$ and can define $$f:\mathbf{Z} \to \mathbf{Z}$$, but can also define a different function $$f:\mathbf{Z} \to \mathbf{R}$$
 * ambiguity not acceptable in rigorous proofs
 * a formula such as $$f(x)=\sqrt{x^2-5x+6}$$ is not a properly defined function on its own, however it is standard to take as the domain the largest possible subset of R (in this case x ≤ 2 or x ≥ 3) and R as the codomain

Devlin, Sets, functions, and logic, p. 92

"This definition of function equality means that we should not really speak of a function as being a rule that takes arguments from the domain and produces values in the codomain. Rather a function is determined by such a rule. It is not the rule itself that is the function, even assuming that we are careful to specify the domain and codomain (as we should). It is the argument-to-value association the rule determines that is "the function". (The italics are in the original.)

Spivak, Calculus, pp. 46-47
 * a more substantial objection to the use of the word "rule" is that we want different rules such as $$f(x) = x^2$$ and $$f(x) = x^2 + 3x + 3 - 3(x+1)$$ to define the same function
 * a satisfactory definition can never be constructed by finding synonyms for words that are troublesome
 * Q: What does one need to know about a function to know all about it? A: For each number x one needs to know the number f(x)
 * a function is a collection of pairs of numbers with the following property: if (a, b) and (c, d) are both in the collection, then b = c
 * the collection must not contain two different pairs with the same first element
 * if a is in the domain of f, it follows that there is a unique b such that (a, b) is in f, which is denoted by f(a)

Joshi, Introduction to general topology, pp. 32-33
 * intuitively clear notion: single-valued correspondence from one set to another
 * intuitively, if X and Y are sets, then a function f from X to Y is a rule of correspondence which assigns to every element of X a unique element of the set Y
 * the difficulty in designing function in this way is that the terms "rule of correspondence" and "assign" are not defined earlier
 * this definition, although intuitively appealing, is not logically precise
 * a function from a set X to a set Y is a subset, say, f of $$X \times Y$$, with the property that for every $$x \in X$$, there is a unique $$y \in Y$$ such that $$(x, y) \in f$$
 * technical difficulty: the same function may have more than one codomain
 * a function is nowadays defined as an ordered triple (X, Y, f)
 * the sets X, Y, and f are called, respectively, domain, codomain, and graph
 * in practice, a function is specified by giving its value at the typical element of the domain
 * specification of a function not complete until domain and codomain are specified
 * rather than "consider the function $$f(x) = \sin(x^2)$$, it is better to say "consider the function $$f: \mathbf{R} \to \mathbf{R}$$ defined by $$f(x) = \sin(x^2)$$ for $$x \in \mathbf{R}$$
 * the words transformation, operator, map, and mapping are really synonyms of function, although by convention they are only used in some specific contexts