10.4: Composición de funciones
- Page ID
- 118308
\( \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}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)una función\(A \to C\) creada a partir de funciones dadas\(f: A \rightarrow B\) y\(g: B \rightarrow C\) por\(a \mapsto g(f(a))\)
la composición de las funciones\(f: A \rightarrow B\) y\(g: B \rightarrow C\text{,}\) para que\(g \circ f: A\rightarrow C\) por\((g \circ f)(a) = g(f(a))\)

Considerar las funciones
\ begin {align*} f\ colon\ mathbb {R} &\ a\ mathbb {R} _ {\ geq 0}, & g\ colon\ mathbb {R} _ {\ geq 0} &\ a\ mathbb {R} _ _ {\ geq 0},\\ x &\ mapsto x^2, & x &\ mapsto\ sqrt {x},\ end align{ *}
Entonces tenemos
\ begin {alinear*} g\ circ f\ colon\ mathbb {R} &\ a\ mathbb {R} _ {\ geq 0},\\ x &\ mapsto\ sqrt {x^2} =\ vert x\ vert. \ end {alinear*}
La notación para la composición de funciones\(f\) e\(g\) implica una inversión de orden, así que escribimos\(g \circ f\text{.}\) Esto es para que cuando usamos esta notación con notación input-output\((g \circ f)(a)\text{,}\) la notación nos recuerda que primero se\(f\) debe aplicar a la entrada\(a\text{,}\) y luego \(g\)se aplica al resultado\(f(a)\text{.}\)
En general,\(f \circ g \ne g \circ f\text{.}\) Usualmente, uno de los dos ni siquiera está definido, porque dominios y codominios de\(f\) y\(g\) no necesariamente coincidirán en ambos órdenes. Y cuando ambos están definidos, los dos órdenes diferentes de composición suelen tener diferentes dominios y codominios.
Considerar funciones
\ begin {align*} f\ colon\ mathbb {N} &\ a\ mathbb {N}, & g\ colon\ mathbb {N} &\ a\ mathbb {N},\\ n &\ mapsto n^2, & n &\ mapsto n + 1. \ end {align*}
Entonces, ambos\(f \circ g: \mathbb{N} \rightarrow \mathbb{N}\) y\(g \circ f: \mathbb{N} \rightarrow \mathbb{N}\) se definen. Pero no son iguales, como
\ begin {alinear*} (f\ circ g) (n) & = (n+1) ^2 = n^2+2n+1, & (g\ circ f) (n) & = n^2+1. \ end {alinear*}
Considerar funciones
\ begin {align*}\ text {sqrt}\ colon\ mathbb {N} &\ a\ mathbb {R}, &\ text {flr}\ colon\ mathbb {R} &\ a\ mathbb {Z},\\ n &\ mapsto\ sqrt {n}, & x &\ mapsto\ lpiso x\ rpiso. \ end {align*}
(Ver Ejemplo 10.3.4 para una descripción de la\(\text{flr}\) función.)
Entonces,\(\text{flr} \circ \text{sqrt} : \mathbb{N} \rightarrow \mathbb{Z}\) se define, con
\ begin {ecuación*} (\ text {flr}\ circ\ text {sqrt}) (n) =\ lfloor\ sqrt {n}\ rfloor\ text {.} \ end {ecuation*}
Pero no\(\text{sqrt} \circ \text{flr}\) está definido, ya que el codominio de\(\text{flr}\) no coincide con el dominio de\(\text{sqrt} \text{.}\) En particular,\(\text{flr}\) a veces devolverá una salida negativa, y no podemos usar tal salida como entrada en\(\text{sqrt} \text{.}\)
Considerar funciones\(f: A \rightarrow B\) y\(g: B \rightarrow C\text{.}\)
Si\(g \circ f\) es inyectivo, ¿alguna o ambas son\(f,g\) necesariamente inyectables?
Responda la misma pregunta que la anterior con “inyectiva” reemplazada por “suryectiva”.
Demostrar que si ambos\(f\) y\(g\) son biyectivos, entonces la composición también\(g \circ f\) es biyectiva.
Por supuesto, podemos componer cualquier número de funciones.
Reconsideremos la función definida por algoritmo en el Ejemplo 10.1.3. Como la descripción de la función implicaba un algoritmo de varios pasos, deberíamos ser capaces de romper los pasos involucrados en sus propias funciones, luego recrear las funciones originales como una composición.
En primer lugar, definir\(\text{abs} : \mathscr{P}( \mathbb{Z}) \rightarrow \mathscr{P}( \mathbb{N})\) por
\ begin {ecuación*}\ texto {abs} (X) =\ {\ vert x\ vert\;\ vert x\ in X\}\ texto {.} \ end {equation*}
A continuación, defina\(min : \mathscr{P}( \mathbb{N}) \rightarrow \mathbb{N}\) para que\(\text{min}(X)\) genere el número mínimo en conjunto de entrada\(X\text{,}\) y salidas\(0\) en caso\(X = \emptyset\text{.}\)
Por último, definir\(f: \mathbb{N} \rightarrow \mathbb{N}\) por\(f(n) = 2 n + 1\text{.}\)
Cada una de estas funciones representa un paso en el algoritmo definiendo la función en el Ejemplo 10.1.3, pero para recrear esa función necesitamos componer las funciones en el orden correcto: escribir\(\varphi = f \circ \text{min} \circ \text{abs}\text{,}\) para que
\ begin {ecuation*}\ varphi (X) = 2\ text {min} (\ text {abs} (X)) + 1\ end {equation*}
calcula el mismo resultado para un conjunto\(X\) de entrada que el algoritmo descrito en el Ejemplo 10.1.3.