<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def single(a, b, distance_function):
 """ Given two collections ``a`` and ``b``, this will return the distance of the points which are closest together. ``distance_function`` is used to determine the distance between two elements. Example:: 1 # (distance between 2 and 3) """

    left_a, right_a = min(a), max(a)
    left_b, right_b = min(b), max(b)
    result = min(distance_function(left_a, right_b),
                 distance_function(left_b, right_a))
    return result