[Math] The language that contains no proper prefixes of all words of a regular language is regular

automataformal-languagesregular-language

Let $L$ be a regular language. I need to prove that the language
$$M_L = \{w \in L \; | \forall x \in L \; \forall y \in \Sigma^+ : w \neq xy \}$$
that contains all words of L that do not have a related proper prefix in L is regular.

As an example I thought about the language $L_1 = \{12,34,56,3456\}$ where $M_{L_1} = \{12,34,56\}$. I played around with complement of the automaton of the language L and the intersection of this automaton with the one of the language L (no complement) and some modifications, but am stuck right now.

Could you please help me to go on?

Thanks in advance!

Best Answer

The condition that no proper prefix is in $L$ means that the input should be rejected if you encounter an accepting state before the word is completely read. So you could use a FSM for $L$ with the modification that from an accepting state all transitions are redirected to a non-accepting error state.

Edit: Of course, one has to assume w.l.o.g. that the FSM that recognizes $L$ is deterministic and has no $\lambda$-transitions.