## § The implicit and inverse function theorem

I keep forgetting the precise conditions of these two theorems. So here I'm writing it down as a reference for myself.

#### § Implicit function: Relation to function

• Example 1: $x^2 + y^2 = 1$ to $y = \sqrt{1 - x^2}$.
If we have a function $y = g(p, q)$, we can write this as $y - g(p, q) = 0$. This can be taken as an implicit function $h(y; p, q) = y - g(p, q)$. We then want to recover the explicit version of $y = g'(p, q)$ such that $h(g'(p, q); p, q) = 0$. That is, we recover the original explicit formulation of $y = g'(p, q)$ in a way that satisfies $h$.

#### § The 1D linear equation case

In the simplest possible case, assume the relationship between $y$ and $p$ is a linear one, given implicitly. So we have $h(y; p) = \alpha y + \beta p + \gamma = 0$. Solving for $h(y,p) = 0$, one arrives at: $y = -1/\alpha (\beta p + \gamma)$.
• Note that the solution exists iff $\alpha \neq 0$.
• Also note that the the existence of the solution is equivalent to asking that $\partial h / \partial y = \alpha \neq 0$.

#### § The circle case

In the circle case, we have $h(y; p) = p^2 + y^2 - 1$. We can write $y = \pm \sqrt{p^2 - 1}$. These are two solutions, not one, and hence a relation, not a function.
• We can however build two functions by taking two parts. $y+ = +\sqrt{p^2 - 1}$; $y- = -\sqrt{p^2 - 1}$.
• In this case, we have $\partial h / \partial y = 2y$, which changes sign for the two solutions. If $y^\star > 0$, then $(\partial h / \partial y)(y^\star = 0)$. Similarly for the negative case.

#### § Assuming that a solution for $h(y, p)$ exists

Let us say we wish to solve $h(y; p) = y^3 + p^2 - 3 yp - 7 = 0$. Let's assume that we have a solution $y = sol(p)$ around the point $(y=3, p=4)$. Then we must have: $sol(p)^3 + p^2 - 3 sol(p) p - 7 = 0$. Differentiating by $p$, we get: $3 sol(p)^2 sol'(p) + 2p - 3 sol'(p) p - 3 sol(p) = 0$. This gives us the condition on the derivative:
\begin{aligned} &3 sol(p)^2 sol'(p) + 2p - 3 sol'(p) p - 3 sol(p) = 0 \\ &sol'(p)\left[ 3 sol(p)^2 - 3p \right] = 3 sol(p) - 2p \\ &sol'(p) = [3 sol(p) - 2p] / \left[ 3(sol(p)^2 - 3p) \right] \\ \end{aligned}
The above solution exists if $3(sol(p)^2 - 3p \neq 0)$. This quantity is again $\partial h / \partial y$.

#### § Application to economics

• We have two inputs which are purchaed as $x_1$ units of input 1, $x_2$ units of input $2$.
• The price of the first input is $w_1 BTC/unit$. That of the second input is $w_2 BTC/unit$.
• We produce an output which is sold at price $w BTC/unit$.
• For a given $(x_1, x_2)$ units of input, we can produce $x_1^a x_2^b$ units of output where $a + b < 1$.
• The profit is going to be $profit(x_1 x_2, w_1, w_2, w) = w(x_1^a x_2^b) - w_1 x_1 - w_2 x_2$.
• We want to select $x_1, x_2$ to maximize profits.
• Assume we are at break-even: $profit(x_1, x_2, w_1, w_2, w) = 0$.
• The implicit function theorem allows us to understand how any variable changes with respect to any other variable. It tells us that locally, for example, that the number of units of the first input we buy ( $x_1$) is a function of the price $w_1$. Moreover, we can show that it's a decreasing function of the price.

#### § Inverse function: Function to Bijection

• Given a differentiable function $f$, at a point $p$, we will have a continuous inverse $f^{-1}(p)$ if the derivative $f'(p)$ is locally invertible.
• The intuition is that we can approximate the original function with a linear function. $y = f(p + \delta) = f(p) + f'(p) \delta$. Now since $f'(p)$ is locally invertible, we can solve for $\delta$. $y = f(p) + f'(p) \delta$implies that $\delta = 1/f'(p) [y - f(p + \delta) ]$. This gives us the pre-image $(p + delta) \mapsto y$.
• The fact that $1/f'(p)$ is non-zero is the key property. This generalizes in multiple dimensions to saying that $f'(p)$ is invertible.
One perspective we can adopt is that of Newton's method. Recall that Newton's method allows us to find $x^*$ for a fixed $y^*$ such that $y^* = f(x^*)$. It follows the exact same process!
• We start with some $x[1]$.
• We then find the tangent $f'(x[1])$.
• We draw the tangent at the point $x[1]$ as $(y[2] - y[1]) = f'(x[1])(x[2] - x[1])$.
• To find the $y^*$ we set $y[2] = y^*$.
• This gives us $x[2] = x[1] - (y^* - y[1])/f'(x[1])$.
• Immediately generalizing, we get $x[n+1] = x[n] - (y^* - y[n]) / f'(x[n])$.

#### § Idea of proof of implicit function theorem (from first principles)

• Let $F(x, y) \neq 0$, point $p$ be the point where we wish to implicitize.
• To apply implicit fn theorem, take $\partial_y|_pF(x, y) \neq 0$. Say WLOG that $\partial_y|_p F(x, y) > 0$, since $F$ is assumed to be continuously differentiable.
• Since $\partial_y F$ is continuous and positive at $p$, it's positive in a nbhd of $p$ by continuity.
• Consider $F(p_x, y)$ as a single variable function of $y$. Its derivative with respect to $y$ is positive; it's an increasing function in terms of $y$.
• Since $F(x_0, y_0)$ and is an increasing function of $y_0$, we must have two $y$ values $y_-, y_+$ such that $F(p_x, y_+)$ is positive, and $F(p_x, y_-)$is negative.
• Since $F$ is zero and continuous, we have that for all $x$ near $x_0$, that $F(x_0, y_+) > 0 \implies F(x, y_+) > 0$ and $F(x_0, y_-) < 0 \implies F(x, y_-) < 0$. We have released $x_0$ into a wild $x$ in the neighbourhood!
• Now pick some $x_*$ near $x$. Since we have that $F(x_*, y_+) > 0$ and $F(x_*, y_-) < 0$, there exists a unique $y_*$ (by MEAN VALUE THEOREM) that $F(x_*, y_*) = 0$
• Since the $y_*$ is unique, we found a function: $x_* \xmapsto{f} y_*$.
• We are not done. We need to prove the formula for $f'(x)$ where $f$ is the implicit mapping.
• $F(x, f(x)) = 0$ by defn of $f(x)$. Apply chain rule!
\begin{aligned} &F(x, f(x)) = 0 \\ &dF = 0 \\ &\frac{\partial F}{\partial x} \cdot \frac{\partial x}{\partial x} + \frac{\partial F}{\partial y} \frac{df}{dx} = 0 \\ &\frac{\partial F}{\partial x} \cdot 1 + \frac{\partial F}{\partial y} \frac{df}{dx} = 0 \\ &\frac{df}{dx} = \frac{- \frac{\partial F}{\partial y}}{\frac{\partial F}{\partial x} \cdot 1} \\ \end{aligned}

#### § Idea of proof of inverse function theorem (from implicit function theorem)

• Given the implicit function, say we want to locally invert $f(x)$.
• Pick the implicit function $F(x, y) = f(y) - x$. If we consider the level set $F(x, y) = 0$, the implicit function theorem grants us a $g(x)$ such that $F(x, y=g(x)) = 0$. That is, we get $f(g(x)) - x = 0$, or $f(g(x)) = x$.
• To show that it's also a right inverse, consider $F(f(k), k) = f(k) - f(k) = 0$. Since $y = g(x)$, we have that $k = g(f(k))$.
• Hence, $g$ and $f$ are both left and right inverses, and hence bijections.

#### § Idea of proof of implicit function theorem (from inverse function theorem)

• We are given a function $F(x, y)$. We wish to find a formula $y = g(x)$ such that $F(x, g(x)) = 0$.
• The idea is to consider a function $f(x, y) = (x, F(x, y))$.
• Since this is invertible, we get a local inverse function $g$ such that $g(f(x, y)) = (x, y)$. That is, $g(x, F(x,y)) = (x, y)$.
• Now, for a given $x$, set $y := snd(g(x, 0))$. This gives us a $(x, y)$ such that $g(x, F(x,y)=0) = (x, y)$. That is, we get a $y$ such that $F(x, y) = 0$ and this a bijection from $x$ to $y$ since $g$ is a bijection.

#### § Idea of proof of inverse function theorem (from newton iterates)

We know that $F(x + \delta x) = F(x) + J \delta x + \eta$ where $J$ is the jacobian, $\eta$ is error term. Upto first order, this works. We take iterates of this process to get the full inverse.