Bear with me, I don't have any formal training in mathematics. I wonder if there is something that accounts for the syntax of mathematical equations, some deeper logic or reasons why I know that "1+1=2" is a valid expression (regardless of its truth value) and the expression "+1+" is nonsensical, or has invalid syntax.
I learned a while ago there are ways to prove that 1+1=2, which I would otherwise have suspected would have been a fundamental basis, or starting point for mathematics. If you had asked me if there were a way to prove it, I would have said no, it's natural and obvious, and it's the starting point from which all else follows. However mathematicians have delved into it and devised ways of proving it from yet more fundamental logic.
Likewise it seems natural and obvious that "1+1=2" is sensical while certain other expressions are not, such as "=1+" or "++2" -- i.e., that there is a syntax to mathematics. If someone were to ask me where this syntax arises from, I would say that it is fundamental and the natural starting point, like I would have about supposed proof that 1+1=2, before I heard of Peano's axioms.
Is there something, perhaps in logic, that accounts for the syntax of mathematics? I've looked at ring theory, and what little I understand doesn't seem to account for the order of symbols in mathematical expressions.