Let P be the complexity class of languages decidable by Turing machines running in polynomial time. Say a prefix $s$ of a string $x$ is a long prefix (or an L prefix) if $|s|\ge |x|/2$. For a language $A$, let $LP(A)$ be the language of all L prefixes of strings in $A$. Show that $P$ is not closed under $LP(\cdot )$ unless $P=NP$, where NP is the class of languages with polynomial-time verifiers.
I know that for any $A\in NP, LP(A)$ is also in NP. I also know some properties about P, such as the fact that it's closed under complement, intersection, union, and concatenation. But I can't think of a language in P that's not closed under the LP operation. Intuitively, to find such a language, I think it might be useful to construct a language for which it would be very hard to efficiently determine all L prefixes. The resulting language $A$ should most likely satisfy that $LP(A)$ is an NP-complete language. If so, then if $P$ were closed under $LP(\cdot )$, $LP(A)$, an NP-complete language would be in P. Then for any language $B$ in NP, $B\in P.$ Since $NP\subseteq P,$ the result follows.
Alternatively, it might be slightly easier to show that for each $A\in NP,$ we can find some $B\in P$ so that $A\leq_m^p LP(B)$.