I'm somewhat unsure about how we go about counting degrees of freedom in classical field theory (CFT), and in QFT.
Often people talk about field theories as having 'infinite degrees of freedom'. My understanding of this is that we start with classical mechanics, which has one degree of freedom per spatial dimension - ie. one function of time per spatial dimension. Then we move to CFT, with the approach where we imagine that we discretise space into little boxes, and have a field value at each point. Then if we have $N$ lattice points this is a like $N$ versions of classical mechanics - ie. $N$ functions of time - and hence $N$ degrees of freedom. We formulate a limit where the size of each box goes to zero in a well-defined way, and this gives us an inifite number of degrees of freedom. Is this correct?
Now let's move to the photon. We often say that the photon has two degrees of freedom, one for each polarisation mode. My understanding of this is that we take a vector field on spacetime - which has four independent components and hence four degrees of freedom - and we loose two degrees of freedom, one from the gauge symmetry of the photon, and one from the equation of motion for the field. My first question is how this relates to the 'infinite degrees of freedom in field theory' statement. Presumably this is just that it's not useful to say that we have infinite degrees of freedom, and so we've now come up with a new way to define degrees of freedom in terms of internal field space
My next question is why the field equation reduces our number of degrees of freedom by one. The field equation for the photon is a vector equation (ie. specifies four functions), so why does this not reduce the number of degrees of freedom by four? And then in QFT we know that the photon can be off-shell. Presumably it still makes sense to say that the photon has two degrees of freedom in QFT because all in-coming and out-going states in the LSZ formula must be on-shell, and hence all amplitudes that we calculate must for particles with two degrees of freedom?
Then let's consider a real scalar field. If we lose one degree of freedom for the equations of motion for our photon, the same calculation tells me that a classical real scalar field has one degree of freedom which is then taken away by the equation of motion for the field, and hence has no degrees of freedom. This sounds strange to me, my understading is that something with no degrees of freedom isn't dynamical. Can someone explain this to me?
And then I'd like to think about SU(3) Yang-Mills theory. Now our gauge field becomes a matrix. My understanding is that the gauge field is in the fundamental representation, so that gives us $3 \times 3 \times 4 = 36$ degrees of freedom. We can decompose our (traceless Hermitian) gauge field in terms of the eight group generators for $SU(3)$, and this decomposition lets us think in terms of eight gluons. Gluons are massless spin-one particles like the photon, and hence have two degrees of freedom each - a total of 16. So this leads me to think that we must have 20 conditions which reduce the number of degrees of freedom of the $SU(3)$ gauge field from 36 to 16. I think we have eight conditions from the Yang-Mills field equations (one for each group generator index, is this correct?), and so that tells me that the gauge freedom must correspond to twelve conditions which reduce the number of gluon degrees of freedom? Can anyone explain either where this twelve comes from, or why it's not correct?
My final question is to do with how we deal with these extra degrees of freedom. In QED, we just avoid integrating over the extra degree of freedom in the functional integral, which is acceptable because $U(1)$ is Abelian. In $SU(3)$ Yang Mills, we can't do this because $SU(3)$ is non-Abelian, and so we introduce ghost fields. Firstly, do we have the same number of ghost fields as extra gluon degrees of freedom? (Which would be twelve, if what I said above is correct). This also looks to me that we have dealt with the extra gauge degrees of freedom by introducing equations of motion for the ghost fields. The total number of degrees of freedom is then reduced by the Yang-Mills field equations, and by the field equations for the ghost fields. Is this correct?