When going through symbolic calculations involving physical measurements, it's common to check that the final result is dimensionally consistent. (If I'm calculating a frequency, I'd better get something with units 1/s in the end.) Mathematically, where does the requirement of dimensional consistency come from?
To make this more concrete, say I have some ugly PDE describing a physical problem. After we write it down, it's just a pile of symbols; there's no longer anything indicating that $x$ is a length and $t$ is a time. How can we know a priori that dimensionally inconsistent expressions will never be valid solutions? How can I prove, in general, that the correct solution has the "right mix" of dimensional quantities?
I understand the physical reasons, and I'm familiar with using dimensional analysis, but I'm looking for a more mathematical explanation.