def minimals(A, le=lambda x, y: x <= y):
    """ Find the minimal element(s) of a sequence of partially ordered elements"""
    r = []
    for x in A:
        for a in A:
            if le(a, x) and not le(x, a):
                break
        else:
            for a in r:
                if le(a, x):
                    break
            else:
                r.append(x)
    return r
