Context-Free Grammars & Languages

Answer & solution
Answer: D (no official key was published)
All four languages are context free, D. L₂ has grammar S→0S1|ε. L₃ has S→00S1|0. For L₁, split into i>j and i<j: matched pairs 0j1j can have a nonempty zero prefix or nonempty one suffix, respectively, and CFLs are closed under concatenation with regular languages and finite union. For L₄, let E={02j1j}, generated by S→00S1|ε. The part i>2j is 0⁺E. For i<2j, even i gives E1⁺, while odd i gives 0E1⁺. These are all CFLs by the same closure properties, proving the claim without incorrectly invoking closure of CFLs under complement.
For the strict-inequality cases, the closure argument is constructive. L₁=0⁺{0j1j} ∪ {0i1i}1⁺. For L₄, write E={02j1j}; the cases i>2j, i<2j with i even, and i<2j with i odd are respectively 0⁺E, E1⁺ and 0E1⁺. This separates the arithmetic conditions without relying on the generally false statement that context-free languages are closed under complement.