In commutative algebra, the extension and contraction of ideals are operations performed on sets of ideals.
Let A and B be two commutative rings with unity, and let f : A → B be a (unital) ring homomorphism. If is an ideal in A, then need not be an ideal in B (e.g. take f to be the inclusion of the ring of integers Z into the field of rationals Q). The extension of in B is defined to be the ideal in B generated by . Explicitly,