How to disprove that the union of all non-context-free languages over $a$ is also non-context-free language?












1












$begingroup$


This is the proof I came across:



$L={a^{x^j}|jge 0, 2le xin mathbb N}$ is a non-context-free language. Suppose otherwise, then let $n$ be the constant promised in the pumping lemma. Let's choose $z=a^{x^n}, 1<x, zin L$ therefore exists a decomposition of $z$ into the following form: $z=uvwxy, u=a^{k_1},v=a^{k_2},w=a^{k_3},x=a^{k_4},y=a^{x^n-k_1-k_2-k_3-k_4}$



For $i=2: a^{x^n+k_2+k_4}quad$ *



$$
x^n< x^n+k_2+k_4le x^n+n<x^n+x^nle x^{n+1}quad **
$$

which means that the language is not context-free.



$L$ is contained in the union of all non-context-free languages and the union can be represented by the regular expression $a^+$ therefore the union is a context-free language (because it can be represented by reg. expression).





1) First I don't understand why we needed to bother with proving that $L$ is not context-free. Why couldn't we say from the very beginning that the union of all non-context-free languages is $a^+$ and therefore it's context-free?



2) Why for $i=2: a^{x^n+k_2+k_4}$? Is it because the length of $a^{x^n}$ without $k_2, k_4$ is $a^{x^n-k_2-k_4}$ and because $i=2$ then $a^{x^n-k_2-k_4+(2k_2+2k_4)}=a^{x^n+k_2+k_4}$?



3) In point ** we found an accurate upper bound for $x^n$ which is $x^{n+1}$. But it doesn't necessarily mean than the power of $x$ will be $n+1$ it's just an upper bound. Why is it enough for the proof?










share|cite|improve this question











$endgroup$

















    1












    $begingroup$


    This is the proof I came across:



    $L={a^{x^j}|jge 0, 2le xin mathbb N}$ is a non-context-free language. Suppose otherwise, then let $n$ be the constant promised in the pumping lemma. Let's choose $z=a^{x^n}, 1<x, zin L$ therefore exists a decomposition of $z$ into the following form: $z=uvwxy, u=a^{k_1},v=a^{k_2},w=a^{k_3},x=a^{k_4},y=a^{x^n-k_1-k_2-k_3-k_4}$



    For $i=2: a^{x^n+k_2+k_4}quad$ *



    $$
    x^n< x^n+k_2+k_4le x^n+n<x^n+x^nle x^{n+1}quad **
    $$

    which means that the language is not context-free.



    $L$ is contained in the union of all non-context-free languages and the union can be represented by the regular expression $a^+$ therefore the union is a context-free language (because it can be represented by reg. expression).





    1) First I don't understand why we needed to bother with proving that $L$ is not context-free. Why couldn't we say from the very beginning that the union of all non-context-free languages is $a^+$ and therefore it's context-free?



    2) Why for $i=2: a^{x^n+k_2+k_4}$? Is it because the length of $a^{x^n}$ without $k_2, k_4$ is $a^{x^n-k_2-k_4}$ and because $i=2$ then $a^{x^n-k_2-k_4+(2k_2+2k_4)}=a^{x^n+k_2+k_4}$?



    3) In point ** we found an accurate upper bound for $x^n$ which is $x^{n+1}$. But it doesn't necessarily mean than the power of $x$ will be $n+1$ it's just an upper bound. Why is it enough for the proof?










    share|cite|improve this question











    $endgroup$















      1












      1








      1





      $begingroup$


      This is the proof I came across:



      $L={a^{x^j}|jge 0, 2le xin mathbb N}$ is a non-context-free language. Suppose otherwise, then let $n$ be the constant promised in the pumping lemma. Let's choose $z=a^{x^n}, 1<x, zin L$ therefore exists a decomposition of $z$ into the following form: $z=uvwxy, u=a^{k_1},v=a^{k_2},w=a^{k_3},x=a^{k_4},y=a^{x^n-k_1-k_2-k_3-k_4}$



      For $i=2: a^{x^n+k_2+k_4}quad$ *



      $$
      x^n< x^n+k_2+k_4le x^n+n<x^n+x^nle x^{n+1}quad **
      $$

      which means that the language is not context-free.



      $L$ is contained in the union of all non-context-free languages and the union can be represented by the regular expression $a^+$ therefore the union is a context-free language (because it can be represented by reg. expression).





      1) First I don't understand why we needed to bother with proving that $L$ is not context-free. Why couldn't we say from the very beginning that the union of all non-context-free languages is $a^+$ and therefore it's context-free?



      2) Why for $i=2: a^{x^n+k_2+k_4}$? Is it because the length of $a^{x^n}$ without $k_2, k_4$ is $a^{x^n-k_2-k_4}$ and because $i=2$ then $a^{x^n-k_2-k_4+(2k_2+2k_4)}=a^{x^n+k_2+k_4}$?



      3) In point ** we found an accurate upper bound for $x^n$ which is $x^{n+1}$. But it doesn't necessarily mean than the power of $x$ will be $n+1$ it's just an upper bound. Why is it enough for the proof?










      share|cite|improve this question











      $endgroup$




      This is the proof I came across:



      $L={a^{x^j}|jge 0, 2le xin mathbb N}$ is a non-context-free language. Suppose otherwise, then let $n$ be the constant promised in the pumping lemma. Let's choose $z=a^{x^n}, 1<x, zin L$ therefore exists a decomposition of $z$ into the following form: $z=uvwxy, u=a^{k_1},v=a^{k_2},w=a^{k_3},x=a^{k_4},y=a^{x^n-k_1-k_2-k_3-k_4}$



      For $i=2: a^{x^n+k_2+k_4}quad$ *



      $$
      x^n< x^n+k_2+k_4le x^n+n<x^n+x^nle x^{n+1}quad **
      $$

      which means that the language is not context-free.



      $L$ is contained in the union of all non-context-free languages and the union can be represented by the regular expression $a^+$ therefore the union is a context-free language (because it can be represented by reg. expression).





      1) First I don't understand why we needed to bother with proving that $L$ is not context-free. Why couldn't we say from the very beginning that the union of all non-context-free languages is $a^+$ and therefore it's context-free?



      2) Why for $i=2: a^{x^n+k_2+k_4}$? Is it because the length of $a^{x^n}$ without $k_2, k_4$ is $a^{x^n-k_2-k_4}$ and because $i=2$ then $a^{x^n-k_2-k_4+(2k_2+2k_4)}=a^{x^n+k_2+k_4}$?



      3) In point ** we found an accurate upper bound for $x^n$ which is $x^{n+1}$. But it doesn't necessarily mean than the power of $x$ will be $n+1$ it's just an upper bound. Why is it enough for the proof?







      proof-explanation formal-languages context-free-grammar






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Jan 28 at 16:22







      Yos

















      asked Jan 24 at 16:48









      YosYos

      1,1631823




      1,1631823






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          I think you made a mistake in the definition of L.



          The x should be fixed once and for all. Otherwise $L=a*$ and all your question just don't make sens.



          Thus I assumed that you wanted to show that $L_x={ a^{x^j}|jgeq 0} $ is non-context-free for $xinmathbb{N}$.



          1) How do you know that " the union of all non-context-free languages is $a^+$"? I didn't know before knowing that the languages $L_x$ are non-context-free ...



          2) yes



          3) I think your confusion comes the confusion on the language definition. With the definition $L_x$ it should be clearer. If it is not please tell me.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
            $endgroup$
            – Yos
            Jan 28 at 16:19










          • $begingroup$
            I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
            $endgroup$
            – Yos
            Jan 28 at 16:26










          • $begingroup$
            if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
            $endgroup$
            – Yos
            Jan 28 at 16:27











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3086108%2fhow-to-disprove-that-the-union-of-all-non-context-free-languages-over-a-is-als%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1












          $begingroup$

          I think you made a mistake in the definition of L.



          The x should be fixed once and for all. Otherwise $L=a*$ and all your question just don't make sens.



          Thus I assumed that you wanted to show that $L_x={ a^{x^j}|jgeq 0} $ is non-context-free for $xinmathbb{N}$.



          1) How do you know that " the union of all non-context-free languages is $a^+$"? I didn't know before knowing that the languages $L_x$ are non-context-free ...



          2) yes



          3) I think your confusion comes the confusion on the language definition. With the definition $L_x$ it should be clearer. If it is not please tell me.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
            $endgroup$
            – Yos
            Jan 28 at 16:19










          • $begingroup$
            I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
            $endgroup$
            – Yos
            Jan 28 at 16:26










          • $begingroup$
            if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
            $endgroup$
            – Yos
            Jan 28 at 16:27
















          1












          $begingroup$

          I think you made a mistake in the definition of L.



          The x should be fixed once and for all. Otherwise $L=a*$ and all your question just don't make sens.



          Thus I assumed that you wanted to show that $L_x={ a^{x^j}|jgeq 0} $ is non-context-free for $xinmathbb{N}$.



          1) How do you know that " the union of all non-context-free languages is $a^+$"? I didn't know before knowing that the languages $L_x$ are non-context-free ...



          2) yes



          3) I think your confusion comes the confusion on the language definition. With the definition $L_x$ it should be clearer. If it is not please tell me.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
            $endgroup$
            – Yos
            Jan 28 at 16:19










          • $begingroup$
            I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
            $endgroup$
            – Yos
            Jan 28 at 16:26










          • $begingroup$
            if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
            $endgroup$
            – Yos
            Jan 28 at 16:27














          1












          1








          1





          $begingroup$

          I think you made a mistake in the definition of L.



          The x should be fixed once and for all. Otherwise $L=a*$ and all your question just don't make sens.



          Thus I assumed that you wanted to show that $L_x={ a^{x^j}|jgeq 0} $ is non-context-free for $xinmathbb{N}$.



          1) How do you know that " the union of all non-context-free languages is $a^+$"? I didn't know before knowing that the languages $L_x$ are non-context-free ...



          2) yes



          3) I think your confusion comes the confusion on the language definition. With the definition $L_x$ it should be clearer. If it is not please tell me.






          share|cite|improve this answer









          $endgroup$



          I think you made a mistake in the definition of L.



          The x should be fixed once and for all. Otherwise $L=a*$ and all your question just don't make sens.



          Thus I assumed that you wanted to show that $L_x={ a^{x^j}|jgeq 0} $ is non-context-free for $xinmathbb{N}$.



          1) How do you know that " the union of all non-context-free languages is $a^+$"? I didn't know before knowing that the languages $L_x$ are non-context-free ...



          2) yes



          3) I think your confusion comes the confusion on the language definition. With the definition $L_x$ it should be clearer. If it is not please tell me.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 28 at 15:49









          wecewece

          2,3721923




          2,3721923












          • $begingroup$
            Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
            $endgroup$
            – Yos
            Jan 28 at 16:19










          • $begingroup$
            I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
            $endgroup$
            – Yos
            Jan 28 at 16:26










          • $begingroup$
            if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
            $endgroup$
            – Yos
            Jan 28 at 16:27


















          • $begingroup$
            Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
            $endgroup$
            – Yos
            Jan 28 at 16:19










          • $begingroup$
            I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
            $endgroup$
            – Yos
            Jan 28 at 16:26










          • $begingroup$
            if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
            $endgroup$
            – Yos
            Jan 28 at 16:27
















          $begingroup$
          Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
          $endgroup$
          – Yos
          Jan 28 at 16:19




          $begingroup$
          Yes $x$ should be fixed but it can be any natural number. In my first subquestion I meant why $a^{x^j}$ accurately describes the language but $a^+$ does not.
          $endgroup$
          – Yos
          Jan 28 at 16:19












          $begingroup$
          I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
          $endgroup$
          – Yos
          Jan 28 at 16:26




          $begingroup$
          I did understand the 3) point though now. Reading the inequality from right to left suddenly made more sense.
          $endgroup$
          – Yos
          Jan 28 at 16:26












          $begingroup$
          if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
          $endgroup$
          – Yos
          Jan 28 at 16:27




          $begingroup$
          if you're interested I have an interesting question here: cs.stackexchange.com/questions/103502/…
          $endgroup$
          – Yos
          Jan 28 at 16:27


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3086108%2fhow-to-disprove-that-the-union-of-all-non-context-free-languages-over-a-is-als%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith