This question is about notation when writing a function composition.
Consider a scalar field $T(x,y,z)$. It's gradient, using Cartesian coordinates and the standard basis $(\hat{i},\hat{j},\hat{k})$ is
$$\nabla T=\frac{\partial T}{\partial x}\hat{i}+\frac{\partial T}{\partial y}\hat{j}+\frac{\partial T}{\partial z}\hat{k}\tag{1}$$
We can write $\hat{i}, \hat{j}$ and $\hat{k}$ in terms of $\hat{r}, \hat{\theta}$, and $\hat{\phi}$
$$\hat{i}=\sin{\theta}\cos{\phi}\hat{r}+\cos{\theta}\cos{\phi}\hat{\theta}-\sin{\phi}\hat{\phi}\tag{2}$$
$$\hat{j}=\sin{\phi}\sin{\theta}\hat{r}+\cos{\theta}\sin{\phi}\hat{\theta}+\cos{\phi}\hat{\phi}\tag{3}$$
$$\hat{k}=\cos{\theta}\hat{r}-\sin{\theta}\hat{\theta}\tag{4}$$
Subbing (2),(3), and (4) into (1) we obtain the gradient vector in terms of $\hat{r},\hat{\theta}, \hat{\phi}$ as a function of Cartesian coordinates.
If we now want to make the expression in terms of spherical coordinates $r, \theta,\phi$, then we need to figure out what $\frac{\partial T}{\partial x}, \frac{\partial T}{\partial y}$, and $\frac{\partial T}{\partial z}$ are.
If we knew $T$ as a function of $r,\theta$, and $\phi$, and since these are each a function of $x, y$, and $z$, then the chain rule on $T(r,\theta,\phi)$ would give us
$$\frac{\partial T}{\partial x}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial x}+\frac{\partial\theta}{\partial r}\frac{\partial\theta}{\partial x}+\frac{\partial t}{\partial\phi}\frac{\partial\phi}{\partial x}$$
$$\frac{\partial T}{\partial y}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial y}+\frac{\partial\theta}{\partial r}\frac{\partial\theta}{\partial y}+\frac{\partial t}{\partial\phi}\frac{\partial\phi}{\partial y}$$
$$\frac{\partial T}{\partial x}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial z}+\frac{\partial\theta}{\partial r}\frac{\partial\theta}{\partial z}+\frac{\partial t}{\partial\phi}\frac{\partial\phi}{\partial z}$$
and we can figure out
$$\frac{\partial r}{\partial x}, \frac{\partial r}{\partial y}, \frac{\partial r}{\partial z}$$
$$\frac{\partial \theta}{\partial x}, \frac{\partial \theta}{\partial y}, \frac{\partial \theta}{\partial z}$$
$$\frac{\partial \phi}{\partial x}, \frac{\partial \phi}{\partial y}, \frac{\partial \phi}{\partial z}$$
from the equations
$$r=\sqrt{x^2+y^2+z^2}$$
$$\theta=\cos^{-1}{\frac{z}{r}}$$
$$\phi=\tan^{-1}{\frac{y}{x}}$$
My question concerns the text in bold above.
We know $T(x,y,z)$, and we know $x=x(r,\theta,\phi)$, $y=y(r,\theta,\phi)$, $z=z(r,\theta,\phi)$.
Why is it that we can say that $T$ can be written as a function of $r,\theta,\phi$?