I synced with this Hendrik Jan's answer that to prove undecidability of regularity for CFL is usually obtained from two properties of the context-free languages: (1) they are closed under union, and (2) universality is undecidable.
And for DCFL (1) are not closed under union, (2) have decidable universality.
My question is that how can we say CFL regularity is undecidable if it closed under union and $\Sigma^*$ is undecidable. And my second question is that how DCFL is decidable if it are not closed under union, and have decidable universality. I don't want any concrete proof, I just need to understand the intuition which is brief.
Here are two statements that are true about context-free grammars:
The clever part of the proof is showing that the following is also true:
If $G$ is any context-free grammar, you can make two new languages $G_1$ and $G_2$ based on $G$ with the following properties:
3a. $G_1$ and $G_2$ are context-free.
3b. If $G$ accepts all strings, then $G_1\cup G_2$ is regular. Otherwise, $G_1\cup G_2$ is non-regular.
I won't explain the definition of $G_1$ and $G_2$ in detail; just ask you to accept their properties for now.
Taking these statements as given, the proof is intuitively like this:
Please note
Please note that the properties (1) and (2) don't directly imply that the problem is undecidable. Instead, we had a clever construction (3) that used those properties to help show a contradiction. If we had invented a different construction than the one in (3), we might have used different properties than (1) or (2).