Today I did a test in my class, the trace was:
Prove that the language $L =\{\langle M\rangle\mid \forall w \in \{0,1\}^\ast: M \text{ accepts }w\implies M \text { accepts }ww \}$, is undecidable with a reduction from $A_{\mathrm{TM}}$.
Hint: You can suppose that $w\in \{0,1\}^*$
I answered:
Suppose that $L$ is decidable. Therefore, there is a TM $R$ such that $L(R)= L$, so we can construct a new TM $S$ that decides $A_{\mathrm{TM}}$.
First, construct $N$ as follows:
$\\$
"On input $x$:
- if $x$ is of the form $ww$, accept
- otherwise, run $M$ on $w$ and do what $M$ does.
Now we can construct $S$ as follows:
- Construct $N$ as above.
- Run $R$ on $N$; if $R$ accepts, accept; otherwise, reject.
Now I know this isn't correct, but I don't why. More generally, how to recognize a language of a reduction? For example, in my reduction, $S\text{ accepts } w \iff \text{the language of } N\text{ is ?} \iff \langle M,w\rangle \in A_{\mathrm{TM}} $
I think I'm missing something about reductions but I don't know what.