I'm currently learning about probability theory, and a sudden question popped into my mind: how does math work. To me it seems that math consists of a bunch of symbols, such as $x$, $y$, $\theta$, $1$, $2$ etc., and a bunch of rules for manipulating those symbols, such as the production rule and summation rule. Using those components as building blocks, people are creating more rules that can either make our life easier or reveal more insights into a problem, like the Bayes theorem for example.
But this way of thinking definitely cannot model all the components of math. For instance, how could I incorporate the definitions like variance, expectation and Gaussian distribution etc. into this framework, and how to account for the proofs which play a huge role in math.
So, my question is, is there any conceptual framework that can formally and comprehensively model how math works? Thanks!