def as_reduction(AS, fct): '''Simplify rational function fct as a function in the function field of AS, so that z[i] appear in powers

= m_super: change = 1 d_rem = [a.degree(z[i])%p for i in range(n)] monomial = fct1.monomial_coefficient(a)*x^(a.degree(x))*y^(a.degree(y)%m_super)*f_super^(a.degree(y)//m_super)*prod(z[i]^(d_rem[i]) for i in range(n))*prod((z[i]+AS.rhs[i])^(d_div[i]) for i in range(n)) result += RxyzQ(monomial) if change == 0: return RxyzQ(result) else: return as_reduction(AS, RxyzQ(result))