The way downmixing usually works is simple. To avoid clipping when combining channels, the volume is reduced an appropriate amount for each channel that is added - depending on the peak level of that channel (from analysis) and the mixing factor (example: add two full channels at 100%, volume needs to be reduced by factor 2, or 6 dB)
When using internal volume and volume leveling, the volume leveling is now told how far the volume was reduced by the mixer, so that it can take this into account when leveling. With enough headroom, this volume reduction is reversed entirely.
So yes, these values are mathematically derived, and if all goes well and has enough headroom, the front left/right channels should still have the same volume as before the downmix, just with all the other channels mixed on top.
In practice that means that 5.1 and 7.1 should behave differently, as they have different amounts of channels that get mixed, and as such different amounts of volume reduction (which internal volume would restore).
I would hope that with enough headroom, they would sound similar, however. But, probably not the same.
Perceived equal volume when downmixing is tricky, however. For it to be perfect, our downmixing would have to be in perfect agreement with how the R128 volume level for multi-channel is computed (which effectively does a "downmix" of the individual channels volume levels to one global level), but its probably not, so the analysed value doesn't match the downmix anymore, and volume is slightly off.