from operator import le


def antichain_le(le=le):
    """
    Construct an order based on antichain containment.

    Parameters
    ----------
    le : func
        A function representing the "less than or equal" operator.
        Defaults to <=.

    Returns
    -------
    ac_le : func
        Function implementing antichain ordering with the specified `le`.
    """
    def ac_le(alpha, beta):
        """
        a <= b --> for all b in beta, there exists an a in alpha such that a <= b.
        """
        for b in beta:
            if not any(le(a, b) for a in alpha):
                return False
        return True

    return ac_le