proving discrete-valued functions