answered 2 years ago
You need to define the ideal generated by gi and then use its .reduce() method on f. See the docs.
.reduce()