[Math] Valid argument form for knaves problem (spoilers)

logicproof-verification

I would like to know if my argument is valid for the following problem.

Another two natives C and D approach you but only C
speaks.
C says: Both of us are knaves.
What are C and D?

My solution is as follows:

assume C is telling the truth (C means truth ~C means lie)
$$C$$
$$C \implies \neg C \wedge \neg D$$
$$\neg C \wedge \neg D$$
$$\therefore \neg C$$

Now I must assume $\neg C$ is true by elimination of cases for C.

$$\neg C \implies C \vee D$$
Which means C is lying, and so one of them is a knight.
$$\neg C$$
$$\therefore D$$

Therefore D is a knight and C is a knave.

The first part still looks strange to me, should it be written in this way? Would this argument hold up in a real mathematical proof? Is there something I should do better or not do at all?

Best Answer

Let $C$ represent the statement “native $C$ is a knight”, and similarly $D$. The conditions of the problem are (as usual) that knights always tell the truth, that knaves always lie, that everyone is either a knight or a knave. We can render the utterance “we are both knaves” in this context as “$\lnot C \land \lnot D$”.

Since the problem tells us that $C$ actually said that, we know that $$C\iff \lnot C \land \lnot D.$$

From this we can derive the material that you used:

$$\begin{align}C&\implies \lnot C\land \lnot D\\ \lnot C& \implies C\lor D\end{align}$$

I have no fault with your reasoning, which is mathematically valid. We know that either $C$ or $\lnot C$ is true, and since both assumptions lead to the same conclusion $\lnot C$, that proves $\lnot C$. This technique (of showing that both $X$ and $\lnot X$ imply the same conclusion) is frequently used in mathematics.