definition of differentiability on a regular surface all. I am studying the book "Differential Geometry of Curves and Surfaces" written by do Carmo, and there is one thing that confuses me so much:

In his book, a regular surface refers to a subset of $\mathbb{R}^3$ that satisfy certain conditions. This suggests that we may apply the definition of differentiability of functions of several variables taught in a calculus class. Something like this:

The definition above is cited from "THOMAS' CALCULUS", which is a standard calculus textbook. I don't see any relationship between these two definitions. They seem to be totally different from each other. I've read the article below:
enter link description here
The explanation sounds reasonable, but why doesn't do Carmo say it? Another example from the book by Alfred Gray:

 A: do Carmo and Gray's definitions are the same. Only the terminology was changed to protect the innocent. Both of these are defining differentiability of a function (i.e., map in $\Bbb R$) whose domain is a regular surface in $\Bbb R^2$.
On the other hand, Thomas is defining differentiability of a function whose domain is a subset of $\Bbb R^2$. By identifying $\Bbb R^2$ with the plane $\{(x,y,0) \in \Bbb R^3 \mid x, y \in \Bbb R\}$, you can consider Thomas' definition to apply to functions whose domains are certain surfaces in $\Bbb R^3$. But it certainly doesn't apply to all of them.
What Thomas calls a surface is the set $\{(x,y,f(x,y))\mid x, y \in \text{dom}(f)\}$. This is not the domain of $f$ as in the other definition, but rather, its graph. When Thomas' $f$ is differentiable, you can check that it satisfies the requirements of being a regular surface as described in the differential geometry books. Indeed, $f$ itself can be used to provide a parametrization (a.k.a., coordinate patch) of the surface. Note that not every regular surface is expressible in this form. Indeed, even the sphere is not, since for every $x, y$ not on the equator correspond to two values of $z$, and so cannot be expressed in terms of a single function $f$. This is why the differential geometry books define the more general concept of a regular surface.
Where Thomas leaves off is where do Carmo and Gray start. Now that we have the surface defined, we can talk about functions whose domain is just that surface. They do not need be defined for the points on either side of that surface. How do we define differentiability for such function?. If we try to apply the 3D version of Thomas' definition, we run into a problem, in that the definitions of $f_x, f_y, f_z$ requires $f$ must be defined as we allow small variations in $x, y, z$ around the point. But those small variations leave the surface, so the function is not defined there. In order to discuss differentiability of an $f$ defined only on the surface, we have to restrict ourselves to that surface. This is what do Carmo and Gray are doing. They establish a coordinate system on the surface around the point of interest. These coordinates do not leave the surface as they vary. Differentiation is defined with respect to those coordinates instead of the $(x,y,z)$ of the ambient space $\Bbb R^3$.
They are also setting you up for a future generalization, as there is no reason that we have to think of surfaces as being inside some larger ambient space. Our surface does not need to be subsets of $\Bbb R^3$. They could be subsets of other spaces, or just objects in and of themselves. The definitions of do Carmo and Gray are easily adaptable to this concept. But you cannot define differentiation with respect to some ambient space coordinates if you have no ambient space.
