def extract_minimum(list):
    """
    Extract the minimum from the given list of integers and return it
    and the rest of the list as a pair.  If the list is empty, the
    minimum is None.  If the minimum is not unique, extract its first
    occurrence.

    For example:

        extract_minimum([]) -> (None, [])
        extract_minimum([3, 4, 6, 5, 4]) -> (4, [3, 6, 5, 4])
    """
    def helper(list, index, minimum, index_min):
        if list == ():
            return (minimum, index_min, ())
        else:
            head, tail = list
            if minimum is None or head < minimum:
                min, idx, new_tail = helper(tail, index + 1, head, index)
            else:
                min, idx, new_tail = helper(tail, index + 1, minimum, index_min)
            if index == idx:
                return (min, idx, new_tail)
            else:
                return (min, idx, (head, new_tail))
    min, idx, tail = helper(list, 0, None, 0)
    return (min, tail)