On a unit cube, point N is an arbitrary distance n up the 1st diagonal, and M is a distance m up the second diagonal. Call the distance^2 between the points D2. We have the function D2(n,m). Find m(n) that minimizes D2 for any n. Then find the minimum of this function, D2[n,m(n)], over n.
Using coordinates (x,y,z)
N = (n/sqrt2, n/sqrt2, 0), and
M = (1, m/sqrt2, m/sqrt2)
D2(n,m) = del_x^2 + del_y^2 + del_z^2
= 1 + n^2 - m n - sqrt2 n + m^2 (eqn 1)
(d/dm) D2(n,m) = 2 m - n = 0 at the minimum
m(n) = n/2
Plugging m=n/2 into eqn 1 gives the minimum separation for any n:
D2(n) = 1 + n^2 - (n^2)/2 - sqrt2 n + (n^2)/4
D2(n) = 1 + 3/4 n^2 - sqrt2 n (eqn 2)
(d/dn) D2(n) = (3/2) n - sqrt2 = 0 at the minimum
n = (2/3) sqrt2
Plugging this into eqn 2 give the minimum distance:
D2 = (1/3), Dmin = sqrt(1/3)
And, yes, there is symmetry: one point is 1/3 the way up the diagonal, m = (1/3) sqrt2, and the other is 1/3 the way down, n = (2/3) sqrt2