Estimate error in a composition of functions

analysiserror-propagationreal-analysis

Suppose I have functions $f_1,f_2: X \to Y$ such that $|f_1(x) – f_2(x)| < \varepsilon_1$ for all $x \in X$. And suppose similarly that $g_1,g_2: Y \to Z$ with $|g_1(y) – g_2(y)| < \varepsilon_2$ for all $y \in Y$. If $h_1 = g_1 \circ f_1$ and $h_2 = g_2 \circ f_2$, can $\varepsilon_3$ such that $|h_1(x) – h_2(x)| < \varepsilon_3$ be deduced from $\varepsilon_1$ and $\varepsilon_2$?

Put another way, can an upper bound on the error between composite functions $h_1$ and $h_2$ be deduced from the upper bounds on error between the component functions?

Best Answer

I think you need to assume more about the functions you are dealing with. I am assuming that $g_1$ and $g_2$ take values in $\mathbb R$, but you don't say anything about $Z$, so it might be useful to clarify that.

For example, it follows from what you have given that $$ \begin{split} |h_1(x)-h_2(x)| &= |g_1(f_1(x))-g_2(f_2(x))|\\ &\leq |g_1(f_1(x))-g_2(f_1(x))| + |g_2(f_1(x))-g_2(f_2(x))|\\ &<\epsilon_2 + |g_2(f_1(x))-g_2(f_2(x))|. \end{split} $$ Now if I knew $g_2$ was Lipschitz continuous say, i.e. that $|g_2(y_1)-g_2(y_2)|\leq K|y_1-y_2|$ (which is true if, say, $Y\subseteq \mathbb R^n$ is a closed bounded subset of $\mathbb R^n$ and $g_2$ is continuously differentiable on some open subset $U$ of $\mathbb R^n$ containing $Y$) then we would obtain $$ |h_1(x)-h_2(x)|<\epsilon_2 + K|f_1(x)-f_2(x)| <\epsilon_2+K\epsilon_1. $$

Related Question