'Reduce degree of ``f`` by mapping ``x_i**m`` to ``y_i``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x, y
>>> Poly(x**6*y**2 + x**3 + 1, x, y).deflate()
((3, 2), Poly(x**2*y + x + 1, x, y, domain=\'ZZ\'))'

def deflate(f):

    if hasattr(f.rep, 'deflate'):
        (J, result) = f.rep.deflate()
    else:
        raise OperationNotSupported(f, 'deflate')
    return (J, f.per(result))
