Teorema de Cantor, Dedekind e Bernstein