(f, c, i, K)
Subtract ``c*x**i`` from ``f`` in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x = ring("x", ZZ)

    >>> R.dup_sub_term(2*x**4 + x**2 - 1, ZZ(2), 4)
    x**2 - 1
Subtract ``c*x**i`` from ``f`` in ``K[x]``.
Subtract c * x ** i from f in K [ x ] .
def dup_sub_term(f, c, i, K):
    """
    Subtract ``c*x**i`` from ``f`` in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x = ring("x", ZZ)

    >>> R.dup_sub_term(2*x**4 + x**2 - 1, ZZ(2), 4)
    x**2 - 1

    """
    if not c:
        return f

    n = len(f)
    m = n - i - 1

    if i == n - 1:
        return dup_strip([f[0] - c] + f[1:])
    else:
        if i >= n:
            return [-c] + [K.zero]*(i - n) + f
        else:
            return f[:m] + [f[m] - c] + f[m + 1:]
def dup_sub_term ( f , c , i , K ) : if not c : return f n = len ( f ) m = n - i - 1 if i == n - 1 : return dup_strip ( [ f [ 0 ] - c ] + f [ 1 : ] ) else : if i >= n : return [ - c ] + [ K . zero ] * ( i - n ) + f else : return f [ : m ] + [ f [ m ] - c ] + f [ m + 1 : ]