>>12512648The exact mathematical theory underlying Feynman diagrams is quantum field theory. Yang Mills theories are one class of QFTs, also known as non-abelian gauge theories.
The difficulty is that any calculation of an exact solution to an interacting QFT is impossible. Even writing down the equations you need to solve is beyond our capabilities for realistic theories (that is to say, these theories aren't mathematically well defined, unless you abandon rigour like a physicist). So instead you use perturbation theory, where you do a power series expansion in the coupling constant, g, which is a number that tells you how strong the interactions of your theory are. If the constant g is much less than 1 the terms proportional to a high power of g will contribute a lot less than those multiplying a small power of g and can hence be discarded, leaving you with a good approximation to the underlying theory.
The problem is that finding out what function should be multiplying g^n is very tricky. Feynman realised that the nth term in the expansion can be written as a sum over diagrams with n vertices. The Feynman rules tell you how to assign values to each diagram and are a consequence of the theory's Lagrangian. When you have a Feynman diagram and the theory's Feynman rules the value of said diagram is a well defined mathematical question (though often these integrals diverge and have to be cancelled by introducing infinite counterterms into the definition of the theory).
If you want a mathematically rigorous definition of perturbation theory, look up causal perturbation theory. This has been constructed for reasonable theories. If you want a rigorous definition of QFT including all of the non-perturbative effects -- processes that cannot be represented by any Feynman diagram and are hence invisible to perturbative calculations -- look up axiomatic QFT, or functorial QFT. There are no examples of axiomatic interacting theories in 4D spacetime.