This paper completes the theoretical development in the third paper of
this series. The task is to transform the magnetostatic equations des
cribing equilibrium among the Lorentz, pressure, and gravitational for
ces, to a statement of Ampere's law incorporating the condition of equ
ilibrium. Decomposing the electric current density into a system flowi
ng along and another across the equilibrium magnetic field, the previo
us papers of this series have treated the restricted case in which the
se two current systems are separately conserved. A general derivation
of the equilibrium Ampere's law is given to allow for the coupling bet
ween the two current systems. The pressure as a function of space is e
xpressed in terms of the gravitational potential PHI, the component B
- delPHI of the magnetic field B, and an arbitrary third variable to c
omplete a set of local curvilinear coordinates. The coupling of the tw
o current systems is shown to manifest in the need for the third varia
ble to describe the pressure structure. If that third variable is chos
en to be the proportionality alpha between the field-aligned current d
ensity and the magnetic field, the derived equations neatly generalize
the equilibrium Ampere's law obtained in the third paper of this seri
es. A discussion is given to relate the derived equations to other kno
wn forms of the magnetostatic equations.