Proving symmetry arguments in E&M

Hi everyone.
I don't know whether this is an advanced or introductory topic but I I've always wondered how to prove symmetry arguments in electrostatics, magnetostatics etc mathematically.

Suppose you have an infinite line charge and you need to calculate the electric field at some distance [itex]\rho[/itex] from its axis. Assume that I have absolutely no clue about symmetry and I write the electric field E as a sum of three components along the (ρ, [itex]\phi[/itex], z) unit vectors in cylindrical coordinates. Also I start with the assumption that each component of the field depends on the three cylindrical coordinate variables. I kinda get the physical intuition but I wonder if we can be more rigorous.

How do I start ruling out and eliminating dependencies and get the answer? Do I need some knowledge of symmetry and group theory etc or could it be done by elementary methods? A few hints would be appreciated.

So if I perform the same operation for the azimuthal angle, I can rule out that dependency.

What's the fundamental difference between a) having a component along a particular unit vector (say z) b) being dependent on an independent variable (like z).

For example, the magnetic field of an infinite solenoid does not depend on the z coordinate but does have a z component which is constant. Is there a way like above to show that B does not depend on z (the coordinate)?

For the line charge problem, translational symmetry rules out the dependence of the electric field on the z coordinate but how can it explain the absence of the z component itself?

The magnetic field vector should also be independent of z and Θ and will depend only on r.

Note that the physics should remain the same, not always the quantities.
In the case of the magnetic field, it should indeed remain the same by translation and rotation around the wire.
That's because the physics is related to the force that it will effect on a current element.
Rigorously speaking, it should be the force that remains invariant, and the invariance of the magnetic field is a consequence.

In many situations, the quantities involved in a physical system do not have the symmetry of the system.
This is then because these quantities are not really physical, but are "intermediate" quantities.
This is what happen when you consider the invariance with respect to a change of inertial frame.
In this case, the magnetic field and the electric field do not show the invariance.
Rather, it is the "electromagnetic field" that combines both in a "tensor" (called Faraday tensor) that show the symmetry.