In class notes from problem 9
proof of theorem 9