Skip to content

Commit

Permalink
add picture 54
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoss committed Jan 24, 2025
1 parent bf1df52 commit 116491a
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 67 deletions.
Binary file modified _build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified _build/.doctrees/introOneSharp/functions.doctree
Binary file not shown.
Binary file modified _build/.doctrees/introOneSharp/move_copy_write.doctree
Binary file not shown.
Binary file modified _build/.doctrees/introOneSharp/tidy.doctree
Binary file not shown.
Binary file modified _build/.doctrees/issues/problems.doctree
Binary file not shown.
49 changes: 37 additions & 12 deletions _build/html/_sources/introOneSharp/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "kagQ3xd6nzIL"
},
"source": [
"\n",
"At this point we know what programs of $\\one\\hash$ are and how they work.\n",
"At this point we know what programs of ```111``` are and how they work.\n",
"We are interested not just in the programs themselves\n",
"but in *what* they compute. \n",
"\n",
"We call the set $\\set{\\one,\\hash}$ our *alphabet*, and we use the letter $A$ for it.\n",
"We call the set $\\{```1```,```#```\\}$ our *alphabet*, and we use the letter $A$ for it.\n",
"\n",
"\n",
"We know that it is odd to call such a small set an \"alphabet\",\n",
Expand All @@ -39,19 +40,18 @@
"When used in situations like ours, the word \"alphabet\"\n",
"just means a set that you use to build words from. \n",
"\n",
"But if $\\set{\\one,\\hash}$ is our alphabet, what in\n",
"But if $\\{```1```,```#```\\}$ is our alphabet, what in\n",
"the world are our words?!\n",
"\n",
"Answer:\n",
"A *word* is just a sequence of symbols from our alphabet.\n",
"\n",
" \n",
"(In contrast to most uses in mathematics and computer science,\n",
"In contrast to most uses in mathematics and computer science,\n",
"our words will all be *non-empty*, unless we say otherwise.\n",
"\n",
"Examples of words include \n",
"$\\one\\one\\hash$, and also\n",
"$\\hash\\hash\\hash$.\n",
"```11#11####``` and also the empty word $\\varepsilon$.\n",
"\n",
" \n",
"Let us be clear about the difference between\n",
Expand Down Expand Up @@ -257,6 +257,7 @@
"\n",
"\n",
"```{prf:definition}\n",
"\\:class: tip\n",
"Every word $p$ gives us a function\n",
"called $\\phifn^n_p$ on $n$-tuples of words. \n",
"\n",
Expand Down Expand Up @@ -288,6 +289,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "pryZwxIMf1In"
Expand All @@ -298,7 +300,6 @@
"```{admonition} Examples\n",
":class: tip\n",
"\n",
"$\\phifn^0_{\\one\\hash}(\\ ) \\simeq \\one$.\n",
"\n",
"$\\semantics{\\moveprogtwoone}(\\one,\\hash\\hash\\one) \\simeq\n",
"\\one\\hash\\hash\\one$.\n",
Expand Down Expand Up @@ -375,7 +376,15 @@
"source": [
"# Functions of zero inputs\n",
"\n",
"We started by associating to each program $p$ a function $\\phifn_p$ of one argument, and then for each $n \\geq 2$ we associated a function $\\phifn_p^n$ of $n$ arguments. This general definition works in case $n = 0$ also. For the record: \n",
"We started by associating to each program $p$ a function $\\phifn_p$ of one argument, and then for each $n \\geq 2$ we associated a function $\\phifn_p^n$ of $n$ arguments. This general definition works in case $n = 0$ also. "
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"```{admonition}\n",
"\n",
"$$\n",
"\\phifn^0_p (\\ ) \\simeq y\n",
Expand All @@ -391,8 +400,19 @@
"eventually halts with $y$ in R1 and all other \n",
"registers \n",
"empty. \n",
"```\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"```{example}\n",
"$\\phifn^0_{\\one\\hash}(\\ ) \\simeq \\one$.\n",
"\n",
"For example, $\\phifn_{\\one\\hash}(\\ ) \\simeq \\one$."
"$[\\![[\\![```write```]\\!](```##1```)]\\!]( ) \\simeq ```##1```.\n",
"```"
]
},
{
Expand Down Expand Up @@ -472,13 +492,14 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "rRwFeOtziM54"
},
"source": [
"```{exercise}\n",
"Is the set of $\\one\\hash$ programs a $\\one\\hash$-computable set of words?\n",
"Is the set of ```1#``` programs a ```1#```-computable set of words?\n",
"```"
]
},
Expand Down Expand Up @@ -522,12 +543,15 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "VGDZnfsYhjQy"
},
"source": [
"# Computably enumerable sets\n",
"# Computable sets and computably enumerable sets\n",
"\n",
"We have seen above the definition of a *computable* set of words. We now have a definition which is different but related. Both concepts are important in computability theory.\n",
"\n",
"```{prf:definition}\n",
"Let $p$ be a program. We write $W_p$ for the domain of $\\phifn_p$.\n",
Expand All @@ -540,13 +564,14 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "5HP92Numh-Wz"
},
"source": [
"```{exercise}\n",
"Show that every computable set is computably enumerable. (As we shall see, the converse is false.). Show also that the family of computably enumerable sets is closed under intersection: if $A$ and $B$ are computably enumerable, so is $A\\cap B$.\n",
"Show that every computable set is computably enumerable. (As we shall see, the converse is false.) Show also that the family of computably enumerable sets is closed under intersection: if $A$ and $B$ are computably enumerable, so is $A\\cap B$.\n",
"```"
]
}
Expand Down
4 changes: 2 additions & 2 deletions _build/html/_sources/introOneSharp/move_copy_write.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In the notation from [in a previous notebook](functions), we have\n",
"In the notation from [a little later](functions), we have\n",
"\n",
"$$\n",
"[\\![[\\![ \\mbox{\\tt write}]\\!](x)]\\!](\\ ) = x\n",
"[\\![[\\![ ```write```\\!](x)]\\!](\\ ) = x\n",
"$$"
]
},
Expand Down
2 changes: 1 addition & 1 deletion _build/html/_sources/introOneSharp/tidy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"\n",
"2. $[\\![ q ]\\!](y)\\downarrow$.\n",
"\n",
"3. $[\\![ q ]\\!]\\o [\\![ p ]\\!](x)\\downarrow.\n",
"3. $[\\![ q ]\\!]\\o [\\![ p ]\\!](x)\\downarrow$.\n",
"```"
]
},
Expand Down
11 changes: 10 additions & 1 deletion _build/html/_sources/issues/problems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
"This section is going to have a general discussion of algorithmic problems with examples from ones with a finite search space (like finding paths in a graph) to ones with a potentially infinite space (tiling, PCP and related problems, matrix mortality, and satisfiability in logical systems)."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
" <img src=\"https://github.com/lmoss/onesharp/blob/main/issues/pictures/pictures-54.png?raw=1\" width=\"100%\" height=\"100%\">"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -271,7 +280,7 @@
"\n",
"Find a sequence of these (allowing repetitions) whose product is the zero matrix. \n",
"\n",
"In other words, show that the answer to the $3\\times 3$ matrix mortality problem for the set three matrices shown above is Yes.\n",
"In other words, show that the answer to the $3\\times 3$ matrix mortality problem for the set of three matrices shown above is Yes.\n",
"```\n"
]
},
Expand Down
45 changes: 15 additions & 30 deletions _build/html/introOneSharp/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h2> Contents </h2>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#functions-of-two-or-more-arguments">Functions of two or more arguments</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#functions-of-zero-inputs">Functions of zero inputs</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#characteristic-functions">Characteristic functions</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#computably-enumerable-sets">Computably enumerable sets</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#computable-sets-and-computably-enumerable-sets">Computable sets and computably enumerable sets</a></li>
</ul>

</nav>
Expand All @@ -460,24 +460,23 @@ <h2> Contents </h2>
<p><a href="https://colab.research.google.com/github/lmoss/onesharp/blob/main/introOneSharp/functions.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a></p>
<div class="tex2jax_ignore mathjax_ignore section" id="functions-defined-by-programs">
<h1>Functions defined by programs<a class="headerlink" href="#functions-defined-by-programs" title="Permalink to this heading">#</a></h1>
<p>At this point we know what programs of <span class="math notranslate nohighlight">\(\one\hash\)</span> are and how they work.
<p>At this point we know what programs of <code class="docutils literal notranslate"><span class="pre">111</span></code> are and how they work.
We are interested not just in the programs themselves
but in <em>what</em> they compute.</p>
<p>We call the set <span class="math notranslate nohighlight">\(\set{\one,\hash}\)</span> our <em>alphabet</em>, and we use the letter <span class="math notranslate nohighlight">\(A\)</span> for it.</p>
<p>We call the set <span class="math notranslate nohighlight">\(\{```1```,```#```\}\)</span> our <em>alphabet</em>, and we use the letter <span class="math notranslate nohighlight">\(A\)</span> for it.</p>
<p>We know that it is odd to call such a small set an “alphabet”,
even more so when that set doesn’t have any letters in it!
But this usage is standard, and so we’ll adopt it.
When used in situations like ours, the word “alphabet”
just means a set that you use to build words from.</p>
<p>But if <span class="math notranslate nohighlight">\(\set{\one,\hash}\)</span> is our alphabet, what in
<p>But if <span class="math notranslate nohighlight">\(\{```1```,```#```\}\)</span> is our alphabet, what in
the world are our words?!</p>
<p>Answer:
A <em>word</em> is just a sequence of symbols from our alphabet.</p>
<p>(In contrast to most uses in mathematics and computer science,
<p>In contrast to most uses in mathematics and computer science,
our words will all be <em>non-empty</em>, unless we say otherwise.</p>
<p>Examples of words include
<span class="math notranslate nohighlight">\(\one\one\hash\)</span>, and also
<span class="math notranslate nohighlight">\(\hash\hash\hash\)</span>.</p>
<code class="docutils literal notranslate"><span class="pre">11#11####</span></code> and also the empty word <span class="math notranslate nohighlight">\(\varepsilon\)</span>.</p>
<p>Let us be clear about the difference between
<em>instructions</em> and <em>programs</em>:</p>
<p><em>Instructions</em> are single steps
Expand Down Expand Up @@ -602,7 +601,8 @@ <h1>Functions of two or more arguments<a class="headerlink" href="#functions-of-
<div class="proof definition admonition" id="definition-4">
<p class="admonition-title"><span class="caption-number">Definition 3 </span></p>
<div class="definition-content section" id="proof-content">
<p>Every word <span class="math notranslate nohighlight">\(p\)</span> gives us a function
<p>:class: tip
Every word <span class="math notranslate nohighlight">\(p\)</span> gives us a function
called <span class="math notranslate nohighlight">\(\phifn^n_p\)</span> on <span class="math notranslate nohighlight">\(n\)</span>-tuples of words.</p>
<div class="math notranslate nohighlight">
\[
Expand All @@ -629,7 +629,6 @@ <h1>Functions of two or more arguments<a class="headerlink" href="#functions-of-
</div>
</div><div class="tip admonition">
<p class="admonition-title">Examples</p>
<p><span class="math notranslate nohighlight">\(\phifn^0_{\one\hash}(\ ) \simeq \one\)</span>.</p>
<p><span class="math notranslate nohighlight">\(\semantics{\moveprogtwoone}(\one,\hash\hash\one) \simeq
\one\hash\hash\one\)</span>.</p>
<p>Let <span class="math notranslate nohighlight">\(p\)</span> be the program</p>
Expand Down Expand Up @@ -679,22 +678,7 @@ <h1>Functions of two or more arguments<a class="headerlink" href="#functions-of-
</div>
<div class="tex2jax_ignore mathjax_ignore section" id="functions-of-zero-inputs">
<h1>Functions of zero inputs<a class="headerlink" href="#functions-of-zero-inputs" title="Permalink to this heading">#</a></h1>
<p>We started by associating to each program <span class="math notranslate nohighlight">\(p\)</span> a function <span class="math notranslate nohighlight">\(\phifn_p\)</span> of one argument, and then for each <span class="math notranslate nohighlight">\(n \geq 2\)</span> we associated a function <span class="math notranslate nohighlight">\(\phifn_p^n\)</span> of <span class="math notranslate nohighlight">\(n\)</span> arguments. This general definition works in case <span class="math notranslate nohighlight">\(n = 0\)</span> also. For the record:</p>
<div class="math notranslate nohighlight">
\[
\phifn^0_p (\ ) \simeq y
\]</div>
<p>means that
<span class="math notranslate nohighlight">\(p\)</span> is a program,
and
when we
run it
<span class="math notranslate nohighlight">\(p\)</span> with
all registers empty, the register machine
eventually halts with <span class="math notranslate nohighlight">\(y\)</span> in R1 and all other
registers
empty.</p>
<p>For example, <span class="math notranslate nohighlight">\(\phifn_{\one\hash}(\ ) \simeq \one\)</span>.</p>
<p>We started by associating to each program <span class="math notranslate nohighlight">\(p\)</span> a function <span class="math notranslate nohighlight">\(\phifn_p\)</span> of one argument, and then for each <span class="math notranslate nohighlight">\(n \geq 2\)</span> we associated a function <span class="math notranslate nohighlight">\(\phifn_p^n\)</span> of <span class="math notranslate nohighlight">\(n\)</span> arguments. This general definition works in case <span class="math notranslate nohighlight">\(n = 0\)</span> also.</p>
</div>
<div class="tex2jax_ignore mathjax_ignore section" id="characteristic-functions">
<h1>Characteristic functions<a class="headerlink" href="#characteristic-functions" title="Permalink to this heading">#</a></h1>
Expand Down Expand Up @@ -735,7 +719,7 @@ <h1>Characteristic functions<a class="headerlink" href="#characteristic-function

<p class="admonition-title"><span class="caption-number">Exercise 22 </span></p>
<div class="section" id="exercise-content">
<p>Is the set of <span class="math notranslate nohighlight">\(\one\hash\)</span> programs a <span class="math notranslate nohighlight">\(\one\hash\)</span>-computable set of words?</p>
<p>Is the set of <code class="docutils literal notranslate"><span class="pre">1#</span></code> programs a <code class="docutils literal notranslate"><span class="pre">1#</span></code>-computable set of words?</p>
</div>
</div>
<div class="exercise admonition" id="introOneSharp/functions-exercise-9">
Expand Down Expand Up @@ -765,8 +749,9 @@ <h1>Characteristic functions<a class="headerlink" href="#characteristic-function
</div>
</div>
</div>
<div class="tex2jax_ignore mathjax_ignore section" id="computably-enumerable-sets">
<h1>Computably enumerable sets<a class="headerlink" href="#computably-enumerable-sets" title="Permalink to this heading">#</a></h1>
<div class="tex2jax_ignore mathjax_ignore section" id="computable-sets-and-computably-enumerable-sets">
<h1>Computable sets and computably enumerable sets<a class="headerlink" href="#computable-sets-and-computably-enumerable-sets" title="Permalink to this heading">#</a></h1>
<p>We have seen above the definition of a <em>computable</em> set of words. We now have a definition which is different but related. Both concepts are important in computability theory.</p>
<div class="proof definition admonition" id="definition-11">
<p class="admonition-title"><span class="caption-number">Definition 4 </span></p>
<div class="definition-content section" id="proof-content">
Expand All @@ -779,7 +764,7 @@ <h1>Computably enumerable sets<a class="headerlink" href="#computably-enumerable

<p class="admonition-title"><span class="caption-number">Exercise 25 </span></p>
<div class="section" id="exercise-content">
<p>Show that every computable set is computably enumerable. (As we shall see, the converse is false.). Show also that the family of computably enumerable sets is closed under intersection: if <span class="math notranslate nohighlight">\(A\)</span> and <span class="math notranslate nohighlight">\(B\)</span> are computably enumerable, so is <span class="math notranslate nohighlight">\(A\cap B\)</span>.</p>
<p>Show that every computable set is computably enumerable. (As we shall see, the converse is false.) Show also that the family of computably enumerable sets is closed under intersection: if <span class="math notranslate nohighlight">\(A\)</span> and <span class="math notranslate nohighlight">\(B\)</span> are computably enumerable, so is <span class="math notranslate nohighlight">\(A\cap B\)</span>.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -852,7 +837,7 @@ <h1>Computably enumerable sets<a class="headerlink" href="#computably-enumerable
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#functions-of-two-or-more-arguments">Functions of two or more arguments</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#functions-of-zero-inputs">Functions of zero inputs</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#characteristic-functions">Characteristic functions</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#computably-enumerable-sets">Computably enumerable sets</a></li>
<li class="toc-h1 nav-item toc-entry"><a class="reference internal nav-link" href="#computable-sets-and-computably-enumerable-sets">Computable sets and computably enumerable sets</a></li>
</ul>

</nav></div>
Expand Down
4 changes: 2 additions & 2 deletions _build/html/introOneSharp/move_copy_write.html
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,10 @@ <h2>write<a class="headerlink" href="#write" title="Permalink to this heading">#
<span class="math notranslate nohighlight">\(y\)</span> with <span class="math notranslate nohighlight">\(\Rone\)</span> empty results in <span class="math notranslate nohighlight">\(x\)</span> back in <span class="math notranslate nohighlight">\(\Rone\)</span> and all
other registers empty.</p></li>
</ol>
<p>In the notation from <a class="reference internal" href="functions.html"><span class="doc std std-doc">in a previous notebook</span></a>, we have</p>
<p>In the notation from <a class="reference internal" href="functions.html"><span class="doc std std-doc">a little later</span></a>, we have</p>
<div class="math notranslate nohighlight">
\[
[\![[\![ \mbox{\tt write}]\!](x)]\!](\ ) = x
[\![[\![ ```write```\!](x)]\!](\ ) = x
\]</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
Expand Down
2 changes: 1 addition & 1 deletion _build/html/introOneSharp/tidy.html
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ <h1>Strong equivalence to tidy programs<a class="headerlink" href="#strong-equiv
<ol class="arabic simple">
<li><p><span class="math notranslate nohighlight">\([\![ p+q ]\!](x)\downarrow\)</span>.</p></li>
<li><p><span class="math notranslate nohighlight">\([\![ q ]\!](y)\downarrow\)</span>.</p></li>
<li><p>$[![ q ]!]\o <span class="xref myst">![ p ]!</span>\downarrow.</p></li>
<li><p><span class="math notranslate nohighlight">\([\![ q ]\!]\o [\![ p ]\!](x)\downarrow\)</span>.</p></li>
</ol>
</div>
</div>
Expand Down
Loading

0 comments on commit 116491a

Please sign in to comment.