Jekyll2018-09-10T07:01:32+00:00http://park-sewon.github.io/Sewon’s BlogHello world! Do you know Jo Hyun-woo?Questions in Multivaluedness2018-08-05T06:10:00+00:002018-08-05T06:10:00+00:00http://park-sewon.github.io/multivalue/2018/08/05/multivaluedness<p>Working on Real Computation, it is unavoidable to face multivaluedness.
Considering the fact that real numbers have undecidable equality,
(speaking in terms of Bishop’s, it’s LPO),
the following simple algorithm is not computable:</p>
<pre><code class="language-C++">if(x > 0) ... else ...
</code></pre>
<p>if the variable x represents a real number.
Instead, with some tolerance factor <script type="math/tex">e</script>,<br />
<a href="http://irram.uni-trier.de/">iRRAM</a> supports such syntax:</p>
<pre><code class="language-C++">if(choose(x > - e, e > x) == 1) ... else ...
</code></pre>
<p>The iRRAM <strong>choose</strong> function returns the index whose corresponding expression gets evaluated to be <em>True</em>;
it can be implemented via parallel evaluation of the both expressions,
returning the index of whose expression happens to hold first.
Hence, even if one expression leads to Bottom,
e.g., when x = - e , the <strong>choose</strong> function works!
But, what does happen if both expressions happen to be truth?</p>
<p>Obviously, the one which holds first would be returned.
If both are evaluated to be true at the same time,
we can make some protocol which to return.
This is the matter of the fact of implementation of the language;
we can design the language to evaluate the second expression two steps whereas
the first expression one step.
Therefore, an abstract semantic of the <strong>choose</strong> function should be a set function whose output is a set of all indexes
whose corresponding expressions hold;
in abstract semantics, we do not want to talk about how the choose function and
real number representations are implemented.</p>
<p>One common mistake in first understanding this multivaluedness is that the
nondeterminism is an illusion which is only the matter of implementation;
some think that when we fix a real number <script type="math/tex">x</script>,
the nondeterminism does not occur.
However, this is not the case!
Let us fix <script type="math/tex">x=0</script> and let <script type="math/tex">e=0.1</script>. Let us consider two representations of the <script type="math/tex">x</script>:</p>
<ol>
<li>
<script type="math/tex; mode=display">x = [0,1] :: [0,0.5] :: [0,0.25] :: \cdots</script>
</li>
<li>
<script type="math/tex; mode=display">x = [-1,0] :: [-0.5,0] :: [-0.25,0] :: \cdots</script>
</li>
</ol>
<p>The two sequences of closed intervals are valid names for <script type="math/tex">0</script> as they both converges to <script type="math/tex">0</script>.
However, we can see that
<strong><em>choose(x > - e, e > x) == 1</em></strong> is <em>True</em> for the case 1 and <em>False</em> for the case 2.
Even if we fix a real number <script type="math/tex">x</script> and the way of implementing the <strong>choose</strong> function, multivaluedness happens.</p>
<p>Now, let us take this into the view of representation.
With <script type="math/tex">N</script> denoting a set of natural numbers, <script type="math/tex">B := N^N</script> is a Baire space.
Let <script type="math/tex">n_A : B \rightharpoonup A</script> be a surjective partial function.
If <script type="math/tex">n_A(x) = a</script> we say <script type="math/tex">x</script> realizes <script type="math/tex">a</script> and put <script type="math/tex">x \Vdash_A a</script>.
Similarly, for a function <script type="math/tex">f : A \to C</script>, if <script type="math/tex">\tau : B \to B</script> exists such that
<script type="math/tex">\forall a b. b \Vdash_A a \to \tau(b) \Vdash_B f(a)</script>
we call that <script type="math/tex">\tau</script> tracks the function <script type="math/tex">f</script>.</p>
<p>Now, let us think in the opposite direction. Consider we have a
function <script type="math/tex">\tau : B \to B</script>. What does the function <script type="math/tex">\tau</script> mean?
We can notice that this is just a boring function that receives an infinite
sequence of natural numbers and just keep printing endless sequence of natural numbers.
In order to give a meaning of the boring function, we can try to give meanings to its domain and codomain.
Suppose we let <script type="math/tex">n_A</script> and <script type="math/tex">n_C</script> be the representations of its domain and codomain.</p>
<p>Since <script type="math/tex">n_A</script> does not need to be injective, for an element <script type="math/tex">x \in A</script>,
there can be several different names <script type="math/tex">n^{-1}_A(\{x\})</script>; see that a real number is such a case. If <script type="math/tex">n_C(\tau(n^{-1}_A(\{x\})))</script> is a singleton for all <script type="math/tex">x</script>, then we can define the meaning of <script type="math/tex">\tau</script>;
let <script type="math/tex">\chi : P(A) \rightharpoonup A</script> be a trivial choice function from singleton subsets of <script type="math/tex">A</script>. Then, <script type="math/tex">Meaning(\tau, n_A, n_C) := x \mapsto \chi(n_C(\tau(n^{-1}_A(\{x\}))))</script>.</p>
<p>If the set <script type="math/tex">n_C(\tau(n^{-1}_A(\{x\})))</script> is not a singleton, which is the case of the displayed simple iRRAM program, then, its meaning becomes the multivalued map which can be understood as a set valued function:
<script type="math/tex">Meaning(\tau, n_A, n_C) : A \to P(C) := x \mapsto n_C(\tau(n^{-1}_A(\{x\}))).</script>
It is a little unsatisfactory for me that its meaning is a function to <script type="math/tex">P(B)</script>… What we compute with the <script type="math/tex">\tau, n_A, n_C</script> given <script type="math/tex">x \Vdash_A n_A(x)</script> is an element of <script type="math/tex">\tau(x) \Vdash_C n_C(\tau(x))</script> not a set of elements.</p>
<p>See more:</p>
<p>[1] <strong>iRRAM</strong> is a C++ library which enables the computation of real numbers. See the link for the further information, <a href="http://irram.uni-trier.de/">Click</a></p>
<p>[2] For the further information and studying materials for real computation via computable analysis, see <strong>Weihrauch, Klaus. Computable analysis: an introduction. Springer Science & Business Media, 2012.</strong></p>
<p>[3] The notions of realizability/functions in baire space tracking, can be studied in
<strong>Bauer, Andrej. “Realizability as the connection between computable and constructive mathematics.” Proceedings of CCA. 2005.</strong></p>Working on Real Computation, it is unavoidable to face multivaluedness. Considering the fact that real numbers have undecidable equality, (speaking in terms of Bishop’s, it’s LPO), the following simple algorithm is not computable: if(x > 0) ... else ... if the variable x represents a real number. Instead, with some tolerance factor , iRRAM supports such syntax: if(choose(x > - e, e > x) == 1) ... else ... The iRRAM choose function returns the index whose corresponding expression gets evaluated to be True; it can be implemented via parallel evaluation of the both expressions, returning the index of whose expression happens to hold first. Hence, even if one expression leads to Bottom, e.g., when x = - e , the choose function works! But, what does happen if both expressions happen to be truth?Proof as Object 02018-07-11T06:10:00+00:002018-07-11T06:10:00+00:00http://park-sewon.github.io/type/theory/2018/07/11/proof-1<p>Studying something related to Logic, I got wondered what a proof is.
Learning Set Theory as the only foundation of Mathematics in high school or in college,
I think it is a little natural to get confused.
in Set theory, mathematical objects and logic are separated;
we first define mathematical objects using some set of axioms then
define a deductive system on top of them.</p>
<p>However, it seems unnatural to have the two separate layers;
we can find ourselves often deal a proof of a certain lemma
as some kind of object.
Especially when we design an algorithm out of a proof,
we certainly do deal the proof as an object that yields a function.</p>
<p>Program extraction is another field of study that requires much attention.
However, in some sense, we all do program extraction; I think many of us
have an experience of writing a program out of a mathematical proof.
Let us consider a statement <script type="math/tex">L</script> and two proofs <script type="math/tex">a, b</script> of <script type="math/tex">L</script>.
The point is, seeing <script type="math/tex">a</script> and <script type="math/tex">b</script> as objects, whether we can say the proofs are different. Suppose a program designed from <script type="math/tex">a</script> takes <script type="math/tex">n^3</script> and a program designed from <script type="math/tex">b</script> takes <script type="math/tex">exp(n)</script> (whatever the <script type="math/tex">n</script> is). Then, why can’t we say the two proofs are different? If a proof is not an object, how can we say that two proofs are different?</p>
<p>Type theory can be thought as an alternative foundation of mathematics that merges the separation: objects and proofs. Although there are different aspects of seeing Type Theory; e.g., a foundation of constructive mathematics.
I think the aspect of ‘proof as object’ is the most ‘touching’ one.</p>
<p>There are many things to talk about in Type Theory.
However, to be focused on the spirit of ‘proof as object’, let us see a
simple example.
Suppose we have two objects <script type="math/tex">a</script> and <script type="math/tex">b</script>.
We want to argue whether the two objects are the same.
In Set Theory, <script type="math/tex">a</script> and <script type="math/tex">b</script> are some objects that may live in some set <script type="math/tex">S</script>.
The proof of the statement <script type="math/tex">a = b</script> will be constructed following some rules in a deductive system which live outside of the object construction.</p>
<p>In Type Theory, given two elements <script type="math/tex">a, b : T</script> (it says <script type="math/tex">a</script> and <script type="math/tex">b</script> of type <script type="math/tex">T</script>), the statement
<script type="math/tex">a = b</script> is also a type.
We call it an equality (or identity) type of <script type="math/tex">T</script> and <script type="math/tex">a, b</script>.
A proof of <script type="math/tex">a = b</script> is an element of the equality type. Hence,
the proof <script type="math/tex">p : a = b</script>
itself is a mathematical object just like <script type="math/tex">a</script> and <script type="math/tex">b</script> are.
Hence, the statement reads, ‘given two elements <script type="math/tex">a, b</script> of type <script type="math/tex">T</script>, can you find an element of type <script type="math/tex">a = b</script>?’</p>
<p>Seeing a proof <script type="math/tex">p : a = b</script> as an object, we can imagine the following:
given <script type="math/tex">p, q : a = b</script>, arguing <script type="math/tex">p = q</script> is again a type. Yes, we can have <script type="math/tex">r, s : p = q</script> and again argue whether <script type="math/tex">r = s</script> and so on…
This observation leads the attention to Homotopy Type Theory, which is not the topic here; however, is surely interesting.</p>
<p>The equality type is a fundamental type former in Type Theory; given a type and two elements of it, it returns a type. Similarly, there are other type formers which enable us to have counterparts of product, co-product, existential and universal quantifiers. Maybe introducing <script type="math/tex">\Sigma</script> and <script type="math/tex">\Pi</script> dependent types in Martin-Löf dependent type theory would be an interesting topic for the next posting?</p>Studying something related to Logic, I got wondered what a proof is. Learning Set Theory as the only foundation of Mathematics in high school or in college, I think it is a little natural to get confused. in Set theory, mathematical objects and logic are separated; we first define mathematical objects using some set of axioms then define a deductive system on top of them.Welcome to my blog2018-05-30T08:10:00+00:002018-05-30T08:10:00+00:00http://park-sewon.github.io/random/things/2018/05/30/welcome-to-my-blog<p>Dear visitors,
I am very pleased to meet you.
Though I have no idea what to post here,
I hope to have productive and fun conversation in this blog with you!</p>Dear visitors, I am very pleased to meet you. Though I have no idea what to post here, I hope to have productive and fun conversation in this blog with you!