How do symmetries “define” physical laws? First of all, I do not have any problems concerning what symmetries are or how to describe them.  However, I do not have any knowledge concerning how the reasoning for quantum field theory and thus the standard model works.  I hope it is still appropriate to ask such a question this early.

What concerns me is a statement I now have heard numerous times and which goes along these lines:

Electromagnetism is built upon a $U(1)$ Symmetry.  If we consider other symmetries, we end up with other forces, for instance, if we consider $SU(2)\times U(1)$, we get the electroweak interaction.

Assuming this statement were true, I imagine something like the following to be done:


*

*Consider some mathematical framework along the lines of “Configuration space + Function of the latter + Axioms”

*Postulate that said function has a $U(1)$ symmetry

*End up with Maxwell's equations (or the corresponding Lagrangian or something equivalent to that)


I cannot imagine any process along these lines though.  How can one postulate a symmetry and find physical laws? Hasn't it always been the other way around? That seems like complete magic to me!
 A: A theory is typically described by a Lagrangian, and varying this gives us the equations of motion of the system. The symmetries you describe are symmetries of the Lagrangian i.e. they are transformations that leave the Lagrangian unchanged.
It would be nice to think that the Lagrangians that describe our leading theories of physics were derived in some logical and systematic fashion, but the truth is they are largely guesswork (though to fair it's typically inspired guesswork!). We guess a Lagrangian, churn through lots of maths and see if the resulting theory matches experiment.
In principle there are an infinite number of Lagrangians we could choose as a guess. In practice common sense narrows the range of choices but obviously any way of narrowing this further is a great help, and that's what a gauge symmetry does. For example by requiring that our guesses for the quantum electrodynamics Lagrangian have a $U(1)$ symmetry we are led to a theory that has to have both electrons and photons - without both the symmetry would be violated. It also tells us that the photons have to be massless, which is just as well really. In fact simply by requiring the $U(1)$ symmetry the correct Lagrangian for quantum electrodynamics pretty much falls into our hands.
The other gauge symmetries work in a similar way. For QCD we guess that the gauge symmetry is $SU(3)$, and requiring that the QCD Lagrangian respect this symmetry points very strongly to the correct choice of Lagrangian for the theory. As with QED we find we have to have both quarks and gluons and it even tells us how many gluons there must be, and tells us that the gluons have to be massless, as we observe.
