Logical errors on proving theorem