Imagine two charges (aligned vertically) with a separation $r$ in a spaceship moving with a velocity $v$ with respect to earth.
In the spaceship frame, the charges are stationary with a force $$F′=\left(\frac{1}{4πϵ_0}\right)×\frac{q_1q_2}{r^2} $$
If the force between the charges in earth frame is denoted as F, then $$F=\frac{F'}{\gamma}$$
The force is less as seen from the earth frame such that it accounts for time dilation. Many sources say that this reduction is due to the magnetic force which opposes the electrostatic force.
But if we subtract the magnetic force from the electrostatic force, the force as seen from the earth is $$F=\left(\frac{1}{4πϵ_0}\right)×\frac{q_1q_2}{r^2}-\frac{\mu_0}{4\pi}×\frac{q_1q_2v^2}{r^2}$$
simplifying this, we get $$F=\frac{F'}{\gamma^2}$$
But shouldn't it be $F=\frac{F'}{\gamma}$?
Where have I gone wrong? Or is the idea that magnetic force is the relativistic correction for electric force incorrect?