A note on Cantor's theorem and Russell's paradox