if $dU=TdS-PdV$ then $U=U(S,V)$ - rigorous proof? It' not a physics question, just ..coincidence ;) (i'm concerned about mathematical rightness of it)
Let's consider $U,T,S,P,V\in\mathbb{R_{>0}}$ such that
$$dU=TdS-PdV$$


*

*Based on this, how we can rigorously proof that $U=U(S,V)$?



Attempt 1: (probably inconclusive, see 'Attempt 2')
Let us consider
$$A, X, Y \in \mathbb{R}\;\;\mid\;\; A=A(X,Y)\;\;\;\wedge\;\;\; dA=dU$$
Then
$$dA=\frac{\partial A}{\partial X}\bigg|_Y\,dX+\frac{\partial A}{\partial Y}\bigg|_X\,dY$$
Requirement $dA=dU$ implies
$$\frac{\partial A}{\partial X}\bigg|_Y\,dX+\frac{\partial A}{\partial Y}\bigg|_X\,dY=TdS-PdV$$
or
$$\frac{\partial A}{\partial X}\bigg|_Y\,dX+\frac{\partial A}{\partial Y}\bigg|_X\,dY-TdS+PdV=0$$
Now, since $dX, dY, dS$ and $dV$ are arbitrary, to make the sum null, what they multiply must be zero, and since $T,P$ are not null by definition, only possibilities are that 
$$X=S\;\wedge\;Y=V \qquad\text{or}\qquad Y=S\;\wedge\;X=V$$
in either case, we obtain
$$\frac{\partial A}{\partial S}\bigg|_V=T,\qquad\frac{\partial A}{\partial V}\bigg|_S=-P$$
(I've considered $A$ being just function of two variables $X,Y$, but this is not restrictive since if more than two variables were present in $A$ dependencies, the result woudn't change, as the additional partial derivatives appearing in $dA$ expansion would have been necessarily set to $0$, eliminating thus their dependency in $A$)
Also follows that 
$$A=A(S, V)$$
Then, being $dA=dU\,[..]\Rightarrow\,U=U(S,V)$
Some question about this attempt


*

*How to properly carry on last step, if all was correct so far? (simply saying that $A$ and $U$ differ by a constant as a consequence to mean value theorem? but how we can say this if still we don't know $U$ dependencies..?)

*Has sense to look for $A$ such that $dA=dU$ if $A$ initially is not function of the same variables as $U$?

*Seems that to make the above reasoning work, $X$ and $Y$ have to be independent one with respect to the other, but what if we cannot require this for $S$ and $V$?



Attempt 2: (als inconclusive see 'Attempt 3')
From $dU=TdS-PdV$, we have
$$\frac{dU}{dS}=T-P\,\frac{dV}{dS}\qquad\text{and}\qquad\frac{dU}{dV}=T\,\frac{dS}{dV}-P$$
Then
$$\frac{dU}{dS}\bigg|_{V}=\Bigg(T-P\,\frac{dV}{dS}\bigg)\Bigg|_{V}=T\qquad\text{and}\qquad\frac{dU}{dV}\bigg|_{S}=\Bigg(T\,\frac{dS}{dV}-P\bigg)\Bigg|_{S}=P$$
Eventually
$$dU=\frac{dU}{dS}\bigg|_{V}\,dS+\frac{dU}{dV}\bigg|_{S}\,dV$$
But here arises the problem, if i were sure that $U$ would just depend on $S,\,V$, we could have written (you can check wikipedia page on this)
$$dU=\frac{\partial U}{\partial S}\,dS+\frac{\partial U}{\partial V}\,dV$$
and maybe arrive to the conclusion $U=U(S,V)$ in some way, but being the reasoning 'circular' we cannot do so..
So also this way seems inconclusive.. i wrote it in the hope of maybe clicking some ideas in the answerer, thanks!

Attempt 3: posted in answer
 A: Ok, i think i finally got it
An important hypotesis not written is that $S, V$ are mutually independent
Let us consider
$$dU=T\,dS-P\,dV$$
From this 6 cases are possible:


*

*$U=U(S,V,\{X_i\})$ where $\{X_i\}=\{X_1,X_2,..,X_n\}$ is a subset of all additional independent variables different from $S,V,U$ (note: if one of this additional variables had some dependencies from $S$ and/or $V$ it should not be included among U dependencies, if instead $S$ and/or $V$ had some dependencies from one or more $X_i$, then $S$ and/or $V$ are totally determined by a particular set of $X_i$s, and then $S,V$ should be not included in $U$ dependencies, but case 2 already possibly deals with this situation)

*$U=U(\{X_i\})$ 

*$U=U(S,V)$

*$U=U(S)$

*$U=U(V)$

*$U$ has no dependencies


Case 1 - $U=U(S,V,\{X_i\})$
Let's calculate
$$\frac{\partial U}{\partial X_i}=\frac{dU}{dX_i}\Bigg|_{S,V,\{X_{j}\}-X_i}=\bigg(T\,\frac{dS}{dX_i}-P\,\frac{dV}{dX_i}\bigg)\Bigg|_{S,V,\{X_{j}\}-X_i}=0$$
Thus we conclude that if $U=U(S,V,\{X_i\})$, $U$ cannot be function of any additional variable $X_i$, then Case 1 reduces to one of the remaining cases.
Case 2 - $U=U(\{X_i\})$
Let's calculate
$$\frac{\partial U}{\partial X_i}=\frac{dU}{dX_i}\Bigg|_{\{X_{j}\}-X_i}=T\,\frac{dS}{dX_i}\Bigg|_{\{X_{j}\}-X_i}-P\,\frac{dV}{dX_i}\Bigg|_{\{X_{j}\}-X_i}$$
Now, if $S,V$ are not dependent from any $X_i$, then $dS$ and $dV$ are just arbitrary increments and then we can choose them to be null, making expression above to be zero. In this eventuality, we conclude that if $U=U(\{X_i\})$, $U$ cannot be function of any variable $X_i$, then this eventuality reduces to Case 6.
If instead $S$ is determined by a certain set $\{X_i\}'\subset\{X_i\}$, we cannot make the expression above to be zero, but certanly since
$$\frac{d U}{d S}\bigg|_{\{X_i\}-\{X_i\}'}=T\neq 0$$
and since S is totally determined by $\{X_i\}'$, we could equivalently consider Case 1, Case 3 and Case 4 instead.
The same goes for the situation in which $V$ is determined by $\{X_i\}''\subset\{X_i\}$, we could equivalently consider Case 1, Case 3 and Case 5.
In conclusion, considering what already concluded for Case 1, Case 2 reduces to one of the remaining cases.
Case 4 - $U=U(S)$
If $U$ is solely a function of $S$, then for any variable $A\neq S$ we should have $\frac{dU}{dA}\Big|_S=0$
But for $A=V$
$$\frac{dU}{dV}\Bigg|_S=-P\neq 0$$
Thus, we conclude that Case 4 is NOT possible.
Case 5 - $U=U(V)$
If $U$ is solely a function of $V$, then for any variable $A\neq S$ we should have $\frac{dU}{dA}\Big|_V=0$
But for $A=S$
$$\frac{dU}{dS}\Bigg|_V=T\neq 0$$
Thus, we conclude that Case 5 is NOT possible.
Case 6 - $U$ has no dependencies
If $U$ has no dependencies, then we might choose $dU$ arbitrarly, in particular we could choose it such that for any variable $A$ we have $\frac{dU}{dA}=0$
But for $A=V$
$$\frac{dU}{dV}=T\,\frac{dS}{dV}-P\neq 0$$
Having selected $dS=0$ since arbitrary, as not dependent on V.
Thus, we conclude that Case 6 is NOT possible.
Case 3 - $U=U(S,V)$
Only case left, we can finally conclude that $$U=U(S,V)$$
A: The OP's solution is rigorous and sound. Here I would like to point out that $U=U(S,V)$ by construction.
The most complete equation for the internal energy would read
$$dU = d(TS) - d(PV)$$
In this case, the internal energy is dependent on all four variables with $d(TS)$ being the change in heat of the system while $d(PV)$ is the change in pressure-volume work done by the system. The sign of $d(PV)$ is convention and changes between chemistry and physics uses. Now apply chain rule
$$dU = TdS + SdT - PdV - VdP$$
It just so happens, it is a heck of a lot easier to design experimental systems that are isothermal (constant temperature, $T$) as opposed to isentropic (constant entropy, $S$) and isobaric (constant pressure, $P$) systems are much safer to handle than isochoric (constant volume, $V$) systems. Hence, the most applicable equation for internal energy would be a system that is at constant temperature and pressure thereby obeying the formula
$$dU = TdS - PdV$$
You could, on the other hand, study a system that is isothermal and isobaric (like an insulated jar with the top on). That would yield a new equation
$$dU = TdS - VdP$$
In this case $U=U(S,P)$, making the variable dependencies by construction. OP's proof should work for every case chosen for $U$.
A: Thinking back, i couldn't accept that such a simple question had such a long and complicated proof, so eventually i come up with:
Assume $U=U(S,V)$, this implies
$$\frac{dU}{dA}\bigg|_{S,\,V}=0\qquad\forall\, A\;\text{not dependent on S,V,U}$$
Substituting, we have
$$\frac{dU}{dA}\bigg|_{S,\,V}=\bigg(T\;\frac{dS}{dA}-P\;\frac{dV}{dA}\bigg)\bigg|_{S,\,V}=0-0=0$$
and since this holds for any A not dependent on S,V,U, assumption is proved.
Note: it does not matter if $S$ and/or $V$ depend on A, their variation must be 0 anyways.
