Let X be a point in the interior of triangle PQR. Let a line through X intersect rays QP and QR in points A and B respectively. Let Y be the point on line segment AB such that |BY| = |AX|.

Prove that |AB| is a minimum if and only if AB is perpendicular to QY.