def step_reduce(reducee, reducer, order):
    """
    Return the reduced polynomial of reducee by reducer.  That is, if
    one of reducee's bases is divisible by the leading base of reducer
    with respect to the order, the returned polynomial is the result
    of canceling out the term.
    """
    lb, lc = order.leading_term(reducer) # term = (base, coeff)
    for b, c in reducee.iterterms():
        if b.lcm(lb) == b:
            return reducee + reducer.term_mul((b - lb, -c / lc)), True
    return reducee, False