TITLE: Understanding implicit differentiation with concepts like "function" and "lambda abstraction."
QUESTION [9 upvotes]: In high school, we learned to reason like so:
$$(*) \qquad \frac{d}{dx}(x^2+x) = \frac{d}{dx}(x^2)+\frac{d}{dx}(x) = 2x+1$$
Now that I know more, I can "reanalyze" this chain of reasoning using ideas that I have more faith in, like "function" and "lambda abstraction." We begin by defining $\nabla (f)$ as the derivative of $f$. Then the above chain of reasoning becomes:
$$\nabla\mathop{\lambda}_{x:\mathbb{R}}(x^2+x) = \nabla\mathop{\lambda}_{x:\mathbb{R}}(x^2)+\nabla\mathop{\lambda}_{x:\mathbb{R}}(x) = \left(\mathop{\lambda}_{x:\mathbb{R}}2x\right) +\left(\mathop{\lambda}_{x:\mathbb{R}}1\right) = \mathop{\lambda}_{x:\mathbb{R}}(2x+1)$$
So I can confidently say that I understand $(*)$, because I can reanalyze it in terms of ideas that I have a lot of faith in, like "function" and "lambda abstraction."
Onwards.
In high school, we also learned a pattern of reasoning that was referred to as "implicit differentiation." It looks a bit like so:

Suppose $y^2+x = x^2+y.$
Then: $$\frac{d}{dx}(y^2+x) = \frac{d}{dx}(x^2+y).$$
$$\therefore 2y \frac{dy}{dx}+1 = 2x+ \frac{dy}{dx}$$
$$\therefore (2y-1)\frac{dy}{dx} = 2x-1$$
$$\therefore \left(\frac{dy}{dx} = \frac{2x-1}{2y-1}\right) \vee (y = 1/2)$$

Unfortunately, I still have absolute no idea what any of this means.

Question. How can we reanalyze implicit differentiation using respectable concepts like "function" and "lambda abstraction" and "limit", and without using concepts such as as "dependent variable" and "independent variable" and "differential."

Edit. It seems to be unclear what I'm looking for. I'm not looking for handwaiving and intuition. I want something as formal as possible, with the minimum of handwaiving. For example, if you're going to "switch" semantics so that $y^2+x=x+y^2$ is no longer a condition on pairs of points $(x,y) \in \mathbb{R}^2$ but instead becomes a condition on smooth functions $(a,b) \rightarrow \mathbb{R}^2,$ you should make that completely clear, introduce notation for the set of paths, etc., and the rest of your answer should be phrased in terms of this notation. Write definitions. State theorems if relevant. Tell me the domains and codomains of all your functions. I want the absolute technical logical and/or set-theoretic nitty-gritty here.

REPLY [3 votes]: Multi-variable differentiation
Let $f:\mathbb R^n\rightarrow \mathbb R$. Then we can define $\nabla_i$ to be "differentiation with respect to the $i$th argument". Formally:
$$\nabla_i f = \mathop{\lambda}_{(x_1,\dots,x_n):\mathbb R^n}\lim_{h\rightarrow 0}\frac{f(x_1,\dots,x_i+h,\dots,x_n)-f(x_1,\dots,x_i,\dots,x_n)}{h}$$
defined only where this limit exists.
If $U\subseteq \mathbb R^n$ is open and $f: U \rightarrow \mathbb R$ then $\nabla_i$ can still be defined with the same defintion.
$$\nabla_i f = \mathop{\lambda}_{(x_1,\dots,x_n):\mathbb U}\lim_{h\rightarrow 0}\frac{f(x_1,\dots,x_i+h,\dots,x_n)-f(x_1,\dots,x_i,\dots,x_n)}{h}$$
Say $f$ is continuously differentiable at $u\in U$ if for all $i$ we have that $\nabla_i f$ is defined and continuous for some neighbouhood of $u$.
Differentiation on a set with coordinates
Let $X$ be a set and let $c_1,\dots,c_n$ be functions $X\rightarrow \mathbb R$. We think of these as coordinates on $X$. Putting them together we get a map $c:X\rightarrow\mathbb R^n$, i.e. $c(x)=(c_1(x),\dots,c_n(x))$. Now if $c$ happens to be an injection with its image being an open set $U$, and we have a function $f:X\rightarrow \mathbb R$, then we may define "differentiation with respect to the coordinate $c_i$ holding the other $c_j$ constant" to be given by
$$\nabla^c_{c_i} f=\nabla_i (f\circ c^{-1})$$
One can of course verify that these $\nabla^c_{c_i}$ operators obey the rules you would expect of $\frac{\partial}{\partial c_i}|_{c_j}$. In particular since the $c_i$ are themselves functions $X\rightarrow \mathbb R$ we have defined $\nabla^c_{c_i} c_j$ and can check that it is equal to $\delta_{ij}$.
The implicit function theorem
This theorem tells us one particular set of circumstances where the above definitions apply.
Suppose we have a function $F:\mathbb R^{n+m}\rightarrow \mathbb R^m$, and we let $S\subseteq\mathbb R^{n+m}$ be the subset on which $F$ is zero. Note that the natural coordinates on $R^{n+m}$ give are $n+m$ functions $x_1,\dots,x_{n+m}:\mathbb R^{n+m}\rightarrow \mathbb R$. For $i=1,\dots,n$ let $c_i=x_i|_S$ and define $c:S\rightarrow \mathbb R^n$. Also, note that we may view $F$ as $m$ separate functions $F_1,\dots, F_m:\mathbb R^{n+m}\rightarrow \mathbb R$.
Now let $s\in S$ and suppose each $F_i$ is continuously differentiable at $s$. Then the IFT says that if the matrix with entries $\nabla_{n+i}F_j(s)$ for $i,j\leq m$ is invertible then there is an open neighborhood, $X$, of $s$ in the subspace topology on $S$ such that the map $c|_X:X\rightarrow \mathbb R^n$ is injective with image some open set $U$.
Let $\tilde S$ be the subset of $S$ where this condition holds. Then at any $s\in\tilde S$ and any function $f:S\rightarrow \mathbb R$ we may define $\nabla^c_{c_i} f=\nabla^{c|_X}_{c_i|_X} f|_X$.
The IFT also says that if $f$ is the restriction to $S$ of some continuously differentiable function on $\mathbb R^{n+m}$ then $f$ is continuously differentiable as a function on $\tilde S$.
Example
You give the example of implicitly differentiating $x^2+y=y^2+x$ with respect to $x$. Here $n=m=1$, $F=F_1=\mathop{\lambda}_{x,y:\mathbb R}x^2+y-y^2-x$, and our variables are $x_1=x$ and $x_2=y$. So
$$\nabla_{x_{1+1}}F_1=\mathop{\lambda}_{x,y:\mathbb R}1-2y$$
which is an invertible "matrix" whenever $y\neq 1/2$. So $\tilde S=S\setminus \{(x,1/2)|x\in\mathbb R\}$. Since $x^2+y$, $y^2+x$, $x$ and $y$ are all continuously differentiable $\mathbb R^2\rightarrow \mathbb R$ we therefore have that they are continuously differentiable on $\tilde S$ and so
$$\begin{align*}
x^2+y&=y^2+x \Rightarrow\\
\nabla^c_c(x^2+y)&=\nabla^c_c(y^2+x) \Rightarrow\\
2x+\nabla^c_cy&=2y\nabla^c_cy+1 \Rightarrow\\
\nabla^c_cy&=\frac{2x-1}{2y-1}\text{ or }y=1/2\\
\end{align*}$$
Where $c$ is the restriction to $S$ of $x$.