We're proving that electricity and magnetism are essentially two manifestations of the same underlying phenomenon by using the toy example of a positive charge moving parallel to an infinitely long current carrying wire.
I'm having trouble understanding why the line density of the positive ions and electrons in the wire changes between the laboratory frames and the rest frame of the test charge to yield a net electric field in the rest frame.
In the laboratory frame (O), the positive ions have line density $\lambda_0 $ and velocity $\mathbf{v} = 0$ and the electrons have a line density $-\lambda_0 $ and velocity $\mathbf{v} = -v_o$, so the net current is $I = \lambda_0v_0$, and the net charge on the wire is $Q = 0$. I think the simplest case would be if the test charge has velocity $\mathbf{v} = -v_o$. So it is clear that the test charge experiences a force due to the magnetic field produced by the current in the Lab frame.
My problem comes about when we move to the test charge's rest frame. The lecture notes say that length contraction increases the line density of the positive ions to $\lambda_+ = \gamma \lambda_0 $ and decreases the line density of the electrons to $\lambda_- = \frac{\lambda_0}{\gamma} $ to yield a net positive charge and an electric field around the wire. But I can't see how this comes about - I thought charge was a relativistic invariant? How did we 'create' charge by moving from one reference frame to another? I can't see why length contraction affects the line density of the charge carriers and why the positive ions' line density increase and the electrons' decrease.