Checks if a subset is a subring of a ring.