I am looking for a formal proof of the following, because I strongly believe there exist a theorem on it already that I want to cite, but if not the proof will suffice.
Given a list $A$ and list $B$ of $n$ positive integers. If I order $A$ in a increasing order and order $B$ in decreasing order, then if I take the dot product of $A$ and $B$ then the result is of minimum value.
This is called the Rearrangement Inequality and you can find details and a proof at the link provided above.