Two total differentials with equal variable differentials. Why coefficients in front of differentials are equal? Could you prove that inference like that is valid:
$$(1)
\left\{ 
\begin{array}{c}
dU=T dS-pdV \\
dU=\frac{\partial U}{\partial S}dS+ \frac{\partial U}{\partial V} dV
\end{array}
\right. 
\implies
\left\{ 
\begin{array}{c}
T=\frac{\partial U}{\partial S} \\
-p=\frac{\partial U}{\partial V}
\end{array}
\right. 
$$
That is if you have two total differentials with equal variable differentials than coefficients in front of same differentials are equal.
In undergraduate physical chemistry textbooks this question is treated like self evident. I don't find it self evident. I spent a lot of time and effort trying to solve it. I asked this question on other sites and didn't get satisfactory answer. I got answers like "Can't you see that it is self evident". I spent a lot of time learning predicate logic by myself, I know all of the rules of inference. Could you reduce this question to a more general baby example? It would be nice to see algebraic proof of this inference.
As far I can get it is:
$(2)~~~0=(T-\frac{\partial U}{\partial S})dS+ (-p-\frac{\partial U}{\partial V}) dV$
I understand that:
$$(3)
\left\{ 
\begin{array}{c}
dV=0 \implies T=\frac{\partial U}{\partial S}\\
dS=0 \implies -p=\frac{\partial U}{\partial V}
\end{array}
\right.  
$$
UPDATE:
$$
(4)
\forall S \forall V
\left\{ 
\begin{array}{c}
dU=T (S-S_0)-p(V-V_0) \\
dU=\frac{\partial U(S_0, V_0)}{\partial S}(S-S_0)+ \frac{\partial U(S_0,V_0 )}{\partial V} (V-V_0)
\end{array}
\right. 
$$
(5) is implied by (4) using Universal Elimination we set $V$ to $V_0$
$$(5)
\left\{ 
\begin{array}{c}
dU=T (S-S_0) \\
dU=\frac{\partial U(S_0,V_0)}{\partial S}(S-S_0)
\end{array}
\right.
\implies
 T=\frac{\partial U(S_0,V_0)}{\partial S} 
$$
(6) is implied by (4) using Universal Elimination we set $S$ to $S_0$
$$
(6)
\left\{ 
\begin{array}{c}
dU=-p (V-V_0) \\
dU=\frac{\partial U(S_0,V_0)}{\partial S}(V-V_0)
\end{array}
\right.
\implies
 -p=\frac{\partial U(S_0,V_0)}{\partial S} 
$$
Than using conjunction introduction from (5) and (6) we obtain (7).
$$
(7)
\left\{ 
\begin{array}{c}
T=\frac{\partial U(S_0,V_0)}{\partial S} \\
-p=\frac{\partial U(S_0, V_0)}{\partial V}
\end{array}
\right. 
$$
Am I right?
 A: The missing conceptual step to close the reasoning after your last equations is that
$$0=\left(T-\frac{\partial U}{\partial S}\right)dS+ \left(-p-\frac{\partial U}{\partial V}\right) dV$$
must be valid for every $dS$ and for every $dV$. Therefore, if you take the special case $dS=0$, $dV \neq 0$, we must have $p=-\left.\frac{\partial U}{\partial V}\right|_S$. By taking $dS \neq 0$, $dV = 0$, we get the other condition.
A: Yes, you have done the right thing. From what I see, you have just missed one small thing. In the last statement, you have written correctly that T=dU/dS, when dV=0, but you need to incorporate this, into your differential. We write the following thing :
Notice the small 'v' and the 's' next to the differential ? That signifies V or S being constant i.e. dV or dS being 0. This equation reads that, when v is constant (dV=0), dU=del U/del S and when S is constant(dS=0), dU= del U/del V.
When you write it in this way, the two terms become absolutely different from each other. One is with respect to dS and the other with respect to dV. Think of this, in this way :
Now think about it, are x and why related in any way ? No, right ? We think of them as two different dimensions. This is why we compare the coefficients in front of dX and dY directly and separately. In your problem dV and dS act in this way. They are separate and independent. 
Now do you see, instead of having x and y as variables, you have differentials. But that doesn't matter, they are independent variables too. This is why you compare the coefficients directly and equate them.
Here is another way, you can see this.
Remember, the small v or s in the subscript signify that they are constant, and you have to write it that way.

I hope this solves it for you.
( Don't forget to add that subscripts when you write differentials, the notation can make all the difference !)
EDIT : Euclid's first axiom of Mathematics is that ' two things which are equal to a third thing, is equal to each other. So, if A=B and C=B, then A=C. Sounds simple right ? Now put dV = 0 in both of your equations. You get dU=Tds and dU = (del U/del S) dS.
dU is equal on both sides, so equate them. Tds=(del U/del S)dS.
Cancel out the dS from both ends, and there, you have it.
So, that math itself tells you they are equal.
