OK, I found something based on some geometric observations.
Say you have only 4 numbers for now: a1 <= a2 and b1 <= b2 (0).
|a1-b1| + |a2-b2| <= |a1-b2| + |a2-b1| (1)
In this case, we want to check if (1) is true.
I rewrite (1) based on obvious equivalence relations:
( |a1-b1| + |a2-b2| ) ^ 2 <= ( |a1-b2| + |a2-b1| ) ^ 2 (2)
-2 * a1 * b1 -2 * a2 * b2 <= -2 * a1 * b2 -2 * a2 * b1 (3)
Should I explain how I got from (2) to (3)? I guess not.
Then we get:
a1*b1 + a2*b2 >= a1*b2 + a2*b1 (4)
a1(b1-b2) >= a2*(b1-b2) (5)
a1(b1-b2) - a2*(b1-b2) >=0 (6)
a1(b1-b2) + a2*(b2-b1) >=0 (7)
But (5) is obviously true because b1-b2 <= 0 and a1 <= a2 (see (0)).
This is a rigorous proof for N=2.
My gut tells me this should be generalized somehow
pretty easily for the case of N. Maybe we can try an
induction from here (having seen these (1),(2),(3), etc.).
Geometrically, you can imagine that Ai and Bj as points
on two parallel numeric linex (axis A, axis B). One
pairing configuration is defined by connecting the paired
points from A and B with segments. Your statement basically
says that the optimal pairing is the one in which no two
segments (Ai,Bj) cross each other (they may overlap with
each other /in the optimal solution/ but may not cross each other).
Right?
Now, if we do the same thing (which I did for N=2),
for any N, you will get this question: "Is
a1(b1-bi1) + a2(b2-bi2) + a3(b3-bi3) + ... + aN*(bN-biN) >= 0 (4')
true", where i1,i2,...,iN is any permutation of (1,2,...,N),
and given that a[i] <= a[i+1] and b[i] <= b[i+1] for each i.
Now, here we do induction on N to prove (4').
Suppose (4') is true for N and for all K such that K<N.
Add two more numbers to A and B. Say aN+1 and bN+1.
Let's say they get inserted at positions s1 (in A) and s2 (in B)
in their respective SORTED sequences (A, B). Let's say s1 <= s2
(the reverse case is analogical). So now as1 = aN+1 and bs2 = bN+1,
but s1 and s2 are their real indices in the NEW sorted sequences.
But now proving (4') for N+1 turns into a matter of
proving it for N=2 because only these terms (from (4'))
matter when we do the step from N to N+1.
as1 * (bs1 - bs2) + as2 * (bs2 - bs1) >= 0 (7')
and as we saw this is true for N=2 (see (7) above).
For the other N-1 terms (which remain from (4')), we get that the
inequality (4') is true due to the assumption from the induction (that it is
true for N-1). Thus from the truth for 2 and N-1 we got the truth for N+1.
Hope you understand how I did it. On paper it is easier
to write it, hard to write it here.
So this should be your rigorous proof for the N case.