Saltar al contenido principal
LibreTexts Español

0.4: Funciones

  • Page ID
    115834
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Template:MathJaxLevin

    Una función es una regla que asigna a cada entrada exactamente una salida. Llamamos a la salida la imagen de la entrada. El conjunto de todas las entradas para una función se llama el dominio. El conjunto de todas las salidas permitidas se llama codominio. Escribiríamos\(f:X \to Y\) para describir una función con nombre\(f\text{,}\) dominio\(X\) y codominio\(Y\text{.}\) Esto no nos dice qué función\(f\) es aunque. Para definir la función, debemos describir la regla. Esto a menudo se hace dando una fórmula para calcular la salida para cualquier entrada (aunque ciertamente esta no es la única forma de describir la regla).

    Por ejemplo, considere la función\(f:\N \to \N\) definida por\(f(x) = x^2 + 3\text{.}\) Aquí el dominio y el codominio son el mismo conjunto (los números naturales). La regla es: toma tu insumo, multiplícalo por sí mismo y suma 3. Esto funciona porque podemos aplicar esta regla a cada número natural (cada elemento del dominio) y el resultado es siempre un número natural (un elemento del codominio). Sin embargo, observe que no todos los números naturales en realidad son una salida (no hay forma de obtener 0, 1, 2, 5, etc.). El conjunto de números naturales que en realidad son salidas se llama el rango de la función (en este caso, el rango son\(\{3, 4, 7, 12, 19, 28, \ldots\}\text{,}\) todos los números naturales que son 3 más que un cuadrado perfecto).

    Lo clave que hace que una regla sea realmente una función es que hay exactamente una salida por cada entrada. Es decir, es importante que la regla sea una buena regla. ¿Qué salida asignamos a la entrada 7? Sólo puede haber una respuesta para cualquier función en particular.

    La descripción de la regla puede variar mucho. Podríamos simplemente dar una lista de las imágenes de cada entrada. También podrías describir la función con una tabla o una gráfica o en palabras.

    Ejemplo\(\PageIndex{1}\)

    Los siguientes son todos ejemplos de funciones:

    1. \(f:\Z \to \Z\)definido por\(f(n) = 3n\text{.}\) El dominio y el codominio son ambos el conjunto de enteros. Sin embargo, el rango es solo el conjunto de múltiplos enteros de 3.
    2. \(g: \{1,2,3\} \to \{a,b,c\}\)definido por\(g(1) = c\text{,}\)\(g(2) = a\) y\(g(3) = a\text{.}\) El dominio es el conjunto\(\{1,2,3\}\text{,}\) el codominio es el conjunto\(\{a,b,c\}\) y el rango es el conjunto\(\{a,c\}\text{.}\) Tenga en cuenta que\(g(2)\) y\(g(3)\) son el mismo elemento del codominio. Esto está bien ya que cada elemento en el dominio todavía tiene una sola salida.
    3. \(h:\{1,2,3\} \to \{1,2,3\}\)definido de la siguiente manera:

      arrow-function-example.svg

      Esto significa que la función\(f\) envía 1 a 2, 2 a 1 y 3 a 3: solo sigue las flechas.

    El diagrama de flechas utilizado para definir la función anterior puede ser muy útil para visualizar funciones. A menudo estaremos trabajando con funciones con dominios finitos, por lo que este tipo de imagen suele ser más útil que una gráfica tradicional de una función. Un gráfico de la función en el ejemplo 3 anterior se vería así:

    discrete-function-graph.svg

    Sería absolutamente INCORRECTO conectar los puntos o tratar de ajustarlos a alguna curva. Sólo hay tres elementos en el dominio. Una curva sugiere que el dominio contiene un intervalo completo de números reales. Recuerda, ¡ya no estamos en cálculo!

    Como muy a menudo usaremos funciones con dominios y codominios pequeños, adoptemos alguna notación que sea un poco más fácil de trabajar que la de los ejemplos 2 y 3 anteriores. Todo lo que necesitamos es alguna manera clara de denotar la imagen de cada elemento en el dominio. De hecho, escribir una tabla de valores funcionaría perfectamente:

    \(x\) 0 1 2 3 4
    \(f(x)\) 3 3 2 4 1

    Simplificamos esto aún más escribiendo esto como una matriz con cada entrada directamente sobre su salida:

    \ begin {ecuación*} f =\ begin {pmatrix} 0 & 1 & 2& 3 & 4\\ 3 & 2 & 4 & 1\ end {pmatrix}\ end {ecuación*}

    Tenga en cuenta que esto es solo notación y no el mismo tipo de matriz que encontraría en una clase de álgebra lineal (no tiene sentido hacer operaciones con estas matrices, o reducirlas por fila, por ejemplo).

    Es importante saber determinar si una regla es o no una función. Dibujar los diagramas de flecha puede ayudar.

    Ejemplo\(\PageIndex{2}\)

    ¿Cuál de los siguientes diagramas representa una función? Dejar\(X = \{1,2,3,4\}\) y\(Y = \{a,b,c,d\}\).

    h-arrows.svgf-arrows.svgg-arrows.svg

    Solución

    \(f\) is a function. So is \(g\text{.}\) There is no problem with an element of the codomain not being the image of any input, and there is no problem with \(a\) from the codomain being the image of both 2 and 3 from the domain. We could use our two-line notation to write these as

    \ begin {ecuación*} f=\ begin {pmatrix} 1 & 2 & 3 & 4\\ d & a & c & b\ end {pmatrix}\ qquad g =\ begin {pmatrix} 1 & 2 & 3 & 4\\ d & a & a & b\ end {pmatrix}. \ end {ecuación*}

    Sin embargo,\(h\) is NOT a function. In fact, it fails for two reasons. First, the element 1 from the domain has not been mapped to any element from the codomain. Second, the element 2 from the domain has been mapped to more than one element from the codomain (\(a\) and \(c\)). Note that either one of these problems is enough to make a rule not a function. In general, neither of the following mappings are functions:

    not-function-a.svgnot-function-b.svg

    También podría ser útil pensar en cómo escribiría la notación de dos líneas para\(h\text{.}\) We would have something like:

    \begin{equation*} h=\begin{pmatrix} 1 & 2 & 3 & 4 \\ & a,c? & d & b\end{pmatrix}. \end{equation*}

    There is nothing under 1 (bad) and we needed to put more than one thing under 2 (very bad). With a rule that is actually a function, the two-line notation will always “work”.

    Surjections, Injections, and Bijections

    We now turn to investigating special properties functions might or might not possess.

    In the examples above, you may have noticed that sometimes there are elements of the codomain which are not in the range. When this sort of the thing does not happen, (that is, when everything in the codomain is in the range) we say the function is onto or that the function maps the domain onto the codomain. This terminology should make sense: the function puts the domain (entirely) on top of the codomain. The fancy math term for an onto function is a surjection, and we say that an onto function is a surjective function.

    In pictures:

    non-surjective-ex.svg surjective-ex.svg

    Example \(\PageIndex{3}\): Surjective Functions

    Which functions are surjective (i.e., onto)?

    1. \(f:\Z \to \Z\) defined by \(f(n) = 3n\text{.}\)
    2. \(g: \{1,2,3\} \to \{a,b,c\}\) defined by \(g = \begin{pmatrix}1 & 2 & 3 \\ c & a & a \end{pmatrix}\text{.}\)
    3. \(h:\{1,2,3\} \to \{1,2,3\}\) defined as follows:

    ex-surj-q.svg

    Solution
    1. \(f\) is not surjective. There are elements in the codomain which are not in the range. For example, no \(n \in \Z\) gets mapped to the number 1 (the rule would say that \(\frac{1}{3}\) would be sent to 1, but \(\frac{1}{3}\) is not in the domain). In fact, the range of the function is \(3\Z\) (the integer multiples of 3), which is not equal to \(\Z\text{.}\)
    2. \(g\) is not surjective. There is no \(x \in \{1,2,3\}\) (the domain) for which \(g(x) = b\text{,}\) so \(b\text{,}\) which is in the codomain, is not in the range. Notice that there is an element from the codomain “missing” from the bottom row of the matrix.
    3. \(h\) is surjective. Every element of the codomain is also in the range. Nothing in the codomain is missed.

    To be a function, a rule cannot assign a single element of the domain to two or more different elements of the codomain. However, we have seen that the reverse is permissible: a function might assign the same element of the codomain to two or more different elements of the domain. When this does not occur (that is, when each element of the codomain is the image of at most one element of the domain) then we say the function is one-to-one. Again, this terminology makes sense: we are sending at most one element from the domain to one element from the codomain. One input to one output. The fancy math term for a one-to-one function is an injection. We call one-to-one functions injective functions.

    In pictures:

    injective-ex.svg non-injective-ex.svg

    Example \(\PageIndex{4}\)

    Which functions are injective (i.e., one-to-one)?

    1. \(f:\Z \to \Z\) defined by \(f(n) = 3n\text{.}\)
    2. \(g: \{1,2,3\} \to \{a,b,c\}\) defined by \(g = \begin{pmatrix}1 & 2 & 3 \\ c & a & a \end{pmatrix}\text{.}\)
    3. \(h:\{1,2,3\} \to \{1,2,3\}\) defined as follows:

      ex-inj-q.svg

    Solution
    1. \(f\) is injective. Each element in the codomain is assigned to at most one element from the domain. If \(x\) is a multiple of three, then only \(x/3\) is mapped to \(x\text{.}\) If \(x\) is not a multiple of 3, then there is no input corresponding to the output \(x\text{.}\)
    2. \(g\) is not injective. Both inputs \(2\) and \(3\) are assigned the output \(a\text{.}\) Notice that there is an element from the codomain that appears more than once on the bottom row of the matrix.
    3. \(h\) is injective. Each output is only an output once.

    From the examples above, it should be clear that there are functions which are surjective, injective, both, or neither. In the case when a function is both one-to-one and onto (an injection and surjection), we say the function is a bijection, or that the function is a bijective function.

    Inverse Image

    When discussing functions, we have notation for talking about an element of the domain (say \(x\)) and its corresponding element in the codomain (we write \(f(x)\text{,}\) which is the image of \(x\)). It would also be nice to start with some element of the codomain (say \(y\)) and talk about which element or elements (if any) from the domain it is the image of. We could write “those \(x\) in the domain such that \(f(x) = y\text{,}\)” but this is a lot of writing. Here is some notation to make our lives easier.

    Suppose \(f:X \to Y\) is a function. For \(y \in Y\) (an element of the codomain), we write \(f\inv(y)\) to represent the set of all elements in the domain \(X\) which get sent to \(y\text{.}\) That is, \(f\inv(y) = \{x \in X \st f(x) = y\}\text{.}\) We say that \(f\inv(y)\) is the complete inverse image of \(y\) under \(f\text{.}\)

    WARNING: \(f\inv(y)\) is not an inverse function! Inverse functions only exist for bijections, but \(f\inv(y)\) is defined for any function \(f\text{.}\) The point: \(f\inv(y)\) is a set, not an element of the domain.

    Example \(\PageIndex{5}\)

    Consider the function \(f:\{1,2,3,4,5,6\} \to \{a,b,c,d\}\) given by

    \begin{equation*} f = \begin{pmatrix}1 & 2 & 3 & 4 & 5 & 6 \\ a & a & b & c & c & c\end{pmatrix}. \end{equation*}

    Find the complete inverse image of each element in the codomain.

    Solution

    Remember, we are looking for sets.

    \begin{equation*} f\inv(a) = \{1,2\} \end{equation*} \begin{equation*} f\inv(b) = \{3\} \end{equation*} \begin{equation*} f\inv(c) = \{4,5,6\} \end{equation*} \begin{equation*} f\inv(d) = \emptyset. \end{equation*}

    Example \(\PageIndex{6}\)

    Consider the function \(g:\Z \to \Z\) defined by \(g(n) = n^2 + 1\text{.}\) Find \(g\inv(1)\text{,}\) \(g\inv(2)\text{,}\) \(g\inv(3)\) and \(g\inv(10)\text{.}\)

    Solution

    To find \(g\inv(1)\text{,}\) we need to find all integers \(n\) such that \(n^2 + 1 = 1\text{.}\) Clearly only 0 works, so \(g\inv(1) = \{0\}\) (note that even though there is only one element, we still write it as a set with one element in it).

    To find \(g\inv(2)\text{,}\) we need to find all \(n\) such that \(n^2 + 1 = 2\text{.}\) We see \(g\inv(2) = \{-1,1\}\text{.}\)

    If \(n^2 + 1 = 3\text{,}\) then we are looking for an \(n\) such that \(n^2 = 2\text{.}\) There are no such integers so \(g\inv(3) = \emptyset\text{.}\)

    Finally, \(g\inv(10) = \{-3, 3\}\) because \(g(-3) = 10\) and \(g(3) = 10\text{.}\)

    Since \(f\inv(y)\) is a set, it makes sense to ask for \(\card{f\inv(y)}\text{,}\) the number of elements in the domain which map to \(y\text{.}\)

    Example \(\PageIndex{7}\)

    Find a function \(f:\{1,2,3,4,5\} \to \N\) such that \(\card{f\inv(7)} = 5\text{.}\)

    Solution

    There is only one such function. We need five elements of the domain to map to the number \(7 \in \N\text{.}\) Since there are only five elements in the domain, all of them must map to 7. So

    \begin{equation*} f = \begin{pmatrix}1 & 2 & 3 & 4 & 5 \\ 7 & 7 & 7 & 7 & 7\end{pmatrix}. \end{equation*}

    Function Definitions

    • A function is a rule that assigns each element of a set, called the domain, to exactly one element of a second set, called the codomain.
    • Notation: \(f:X \to Y\) is our way of saying that the function is called \(f\text{,}\) the domain is the set \(X\text{,}\) and the codomain is the set \(Y\text{.}\)
    • To specify the rule for a function with small domain, use two-line notation by writing a matrix with each output directly below its corresponding input, as in:

      \begin{equation*} f = \begin{pmatrix}1 & 2 & 3 & 4 \\ 2 & 1 & 3 & 1 \end{pmatrix}. \end{equation*}

    • \(f(x) = y\) means the element \(x\) of the domain (input) is assigned to the element \(y\) of the codomain. We say \(y\) is an output. Alternatively, we call \(y\) the image of \(x\) under \(f\).
    • The range is a subset of the codomain. It is the set of all elements which are assigned to at least one element of the domain by the function. That is, the range is the set of all outputs.
    • A function is injective (an injection or one-to-one) if every element of the codomain is the output for at most one element from the domain.
    • A function is surjective (a surjection or onto) if every element of the codomain is the output of at least one element of the domain.
    • A bijection is a function which is both an injection and surjection. In other words, if every element of the codomain is the output of exactly one element of the domain.
    • The image of an element \(x\) in the domain is the element \(y\) in the codomain that \(x\) is mapped to. That is, the image of \(x\) under \(f\) is \(f(x)\text{.}\)
    • The complete inverse image of an element \(y\) in the codomain, written \(f\inv(y)\text{,}\) is the set of all elements in the domain which are assigned to \(y\) by the function.

    This page titled 0.4: Funciones is shared under a CC BY-SA license and was authored, remixed, and/or curated by Oscar Levin.