A pull-up plus controlled pull-down turns a HIGH input into a LOW output and a LOW input into a HIGH output. Exact arithmetic here means exact results for the stated model inputs; measured inputs still carry uncertainty and significant-figure limits.
highlighted = computed this step
LOW input leaves the pull-down open
With input 0 volts, the switch is open and the output is 5 volts.
LOW in⇒Vout=5V
HIGH input closes the pull-down
With input 5 volts, the pull-down path closes and the output becomes 0 volts.