def binarize(a, a_bin, M):
    """Generates binarization constraints for variable a.

    Parameters
    ----------
    a : str
        Variable to be binarized.
    a_bin : str
        Identifier of the binarized variable.
    M : int
        An upper bound on a.

    Returns
    -------
    List[str]
        A list holding the two binarization constraints.
    """
    
    lb = "- %s + %s <= 0" % (a, a_bin)
    ub = "- %s + %d %s >= 0" % (a, M, a_bin)

    return [lb, ub]