and are context-free languages. Here's how I would prove it. First, a lemma (which is the crux). If is CF then:
Proof? For construct a non-deterministic finite-state transducer that scans a string, outputting every input symbol it sees and simultaneously searches non-deterministically for . Whenever sees the first symbol of it forks non-deterministically and ceases outputting symbols until either it finishes seeing or it sees sees a symbol that deviates from , stopping in either case. If sees in full, it accepts upon stopping, which is the only way it accepts. If it sees a deviation from , it rejects.
The lemma can be jiggered to handle cases where could overlap with itself (like -- keep looking for even while in the midst of scanning for a prior ) or appears multiple times (actually, the original non-determinisic forking already handles that).
It's fairly clear that , and since the CFLs are closed under finite-state transduction, is therefore CF.
A similar argument goes for , or it could be done with string reversals from , CFLs also being closed under reversal:
Actually, now that I see the reversal argument, it would be even easier to start with , since the transducer for that is simpler to describe and verify -- it outputs the empty string while looking for a . When it finds it forks non-deterministically, one fork continuing to look for further copies of , the other fork copying all subsequent characters verbatim from input to output, accepting all the while.
What remains is to make this work for sentential forms as well as CFLs. But that is pretty straightforward, since the language of sentential forms of a CFG is itself a CFL. You can show that by replacing every non-terminal throughout by say , declaring to be a terminal, and adding all productions to the grammar.
I'll have to think about your question on unambiguity.