Context-Free Grammars & Languages

Answer & solution
Official answer: D
L1=0*1*0* is regular. L2, whose outer zero-block counts differ, is context-free: split into more leading zeros or more trailing zeros and use a pushdown comparison. Since L2⊆L1, their intersection is L2 and context-free. L2 is decidable by finite examination of the block counts (including the possible zero middle block), so its complement is recursive. The complement of regular L1 is regular and consequently context-free. Thus option D, which says this last complement is context-free but not regular, has a false not-regular clause. It is regular and therefore context-free; D is the requested false statement.
For the decisive option D, L1 is represented directly by 0*1*0*, hence is regular. Complement a complete DFA by swapping accepting and nonaccepting states; this proves its complement is regular as well. Being regular implies context-free, but it contradicts the extra words “not regular.” For L2, a pushdown machine can compare the first and final zero blocks when a nonempty middle 1block separates them; the all-zero case can be treated separately. A finite input can also be tested by enumerating its finitely many possible block splits, giving decidability without needing a closed form.