<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mathematics and Computation</title>
	<atom:link href="http://math.andrej.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://math.andrej.com</link>
	<description>Mathematics for computers</description>
	<lastBuildDate>Thu, 05 Apr 2012 20:51:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta2-20500</generator>
		<item>
		<title>The topology of the set of all types</title>
		<link>http://math.andrej.com/2012/03/30/the-topology-of-the-set-of-all-types-2/</link>
		<comments>http://math.andrej.com/2012/03/30/the-topology-of-the-set-of-all-types-2/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:31:49 +0000</pubDate>
		<dc:creator>Martin Escardo</dc:creator>
				<category><![CDATA[Computation]]></category>
		<category><![CDATA[Constructive math]]></category>
		<category><![CDATA[Guest post]]></category>

		<guid isPermaLink="false">http://math.andrej.com/?p=1182</guid>
		<description><![CDATA[<p>It is well known that, both in constructive mathematics and in programming languages, types are secretly topological spaces and functions are secretly continuous. I have previously exploited this in the posts Seemingly impossible functional programs and A Haskell monad for infinite search in finite time, using the language Haskell. In languages based on Martin-Löf type theory [...]]]></description>
			<content:encoded><![CDATA[<p>It is well known that, both in constructive mathematics and in programming languages, types are secretly topological spaces and functions are secretly continuous. I have previously exploited this in the posts <a href="http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/">Seemingly impossible functional programs</a> and <a href="http://math.andrej.com/2008/11/21/a-haskell-monad-for-infinite-search-in-finite-time/">A Haskell monad for infinite search in finite time</a>, using the language Haskell. In languages based on <a href="http://en.wikipedia.org/wiki/Intuitionistic_type_theory">Martin-Löf type theory</a> such as <a href="http://wiki.portal.chalmers.se/agda/pmwiki.php">Agda</a>, there is a set of all types. This can be used to define functions $\mathbb{N} \to \mathrm{Set}$ that map numbers to types, functions $\mathrm{Set} \to \mathrm{Set}$ that map types to types, and so on. </p>
<p>
Because $\mathrm{Set}$ itself is a type, a large type of small types, it must have a secret topology. What is it? There are a number of ways of approaching <a href="http://en.wikipedia.org/wiki/Topology">topology</a>. The most popular one is via <a href="http://en.wikipedia.org/wiki/Open_set">open sets</a>. For some spaces, one can instead use <a href="http://en.wikipedia.org/wiki/Limit_of_a_sequence">convergent sequences</a>, and this approach is more convenient in our situation. It turns out that the topology of the universe $\mathrm{Set}$ is <a href="http://en.wikipedia.org/wiki/Trivial_topology">indiscrete</a>: every sequence of types converges to any type! I apply this to deduce that $\mathrm{Set}$ satisfies the conclusion of <a href="http://en.wikipedia.org/wiki/Rice%27s_theorem">Rice&#8217;s Theorem</a>: it has no non-trivial, extensional, decidable property. </p>
<p>
To see how this works, check:</p>
<ul>
<li>A <a href="http://www.cs.bham.ac.uk/~mhe/papers/universe-indiscrete-and-rice.pdf">short paper</a> with the proofs in mathematical vernacular, and further discussion of the intuitions, motivations and consequences.</li>
<li><a href="http://www.literateprogramming.com/">Literate</a> proofs in Agda of the <a href="http://www.cs.bham.ac.uk/~mhe/papers/universe/TheTopologyOfTheUniverse.html">universe indiscreteness theorem</a> and <a href="http://www.cs.bham.ac.uk/~mhe/papers/universe/RicesTheoremForTheUniverse.html">Rice&#8217;s Theorem for the universe</a>.</li>
<li>Agda proofs of <a href="http://www.cs.bham.ac.uk/~mhe/agda/index.html">related facts</a>.</li>
</ul>
<p>The Agda pages can be navigated be clicking at any (defined) symbol or word, in particular by clicking at the imported module names.</p>
]]></content:encoded>
			<wfw:commentRss>http://math.andrej.com/2012/03/30/the-topology-of-the-set-of-all-types-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eff 3.0</title>
		<link>http://math.andrej.com/2012/03/08/eff-3-0/</link>
		<comments>http://math.andrej.com/2012/03/08/eff-3-0/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 12:49:48 +0000</pubDate>
		<dc:creator>Andrej Bauer</dc:creator>
				<category><![CDATA[Eff]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://math.andrej.com/?p=1149</guid>
		<description><![CDATA[<p>Matija and I are pleased to announce a new major release of the eff programming language.</p>
<p>In the last year or so eff has matured considerably:</p>

It now looks and feels like OCaml, so you won&#8217;t have to learn yet another syntax.
It has static typing with parametric polymorphism and type inference.
Eff now clearly separates three basic concepts: effect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matija.pretnar.info/">Matija</a> and I are pleased to announce a new major release of the <a href="/eff/">eff programming language</a>.</p>
<p>In the last year or so eff has matured considerably:</p>
<ul>
<li>It now looks and feels like <a href="http://caml.inria.fr/">OCaml</a>, so you won&#8217;t have to learn yet another syntax.</li>
<li>It has static typing with parametric polymorphism and type inference.</li>
<li>Eff now clearly separates three basic concepts: effect types, effect instances, and handlers.</li>
<li>How eff works is explained in our paper on <a href="/2012/03/08/programming-with-algebraic-effects-and-handlers/">Programming with Algebraic Effects and Handlers</a>.</li>
<li>We moved the <a href="https://github.com/matijapretnar/eff">source code to GitHub</a>, so go ahead and fork it!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://math.andrej.com/2012/03/08/eff-3-0/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programming with Algebraic Effects and Handlers</title>
		<link>http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/</link>
		<comments>http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 12:38:28 +0000</pubDate>
		<dc:creator>Andrej Bauer</dc:creator>
				<category><![CDATA[Eff]]></category>
		<category><![CDATA[Publications]]></category>

		<guid isPermaLink="false">http://math.andrej.com/?p=1144</guid>
		<description><![CDATA[<p>With Matija Pretnar.</p>
<p>Abstract: Eff is a programming language based on the algebraic approach to computational effects, in which effects are viewed as algebraic operations and effect handlers as homomorphisms from free algebras. Eff supports first-class effects and handlers through which we may easily define new computational effects, seamlessly combine existing ones, and handle them in novel [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://matija.pretnar.info/">Matija Pretnar</a>.</p>
<p><strong>Abstract:</strong> Eff is a programming language based on the algebraic approach to computational effects, in which effects are viewed as algebraic operations and effect handlers as homomorphisms from free algebras. Eff supports first-class effects and handlers through which we may easily define new computational effects, seamlessly combine existing ones, and handle them in novel ways. We give a denotational semantics of eff and discuss a prototype implementation based on it. Through examples we demonstrate how the standard effects are treated in eff, and how eff supports programming techniques that use various forms of delimited continuations, such as backtracking, breadth-first search, selection functionals, cooperative multi-threading, and others.</p>
<p><strong>Download paper:</strong> <a href="/wp-content/uploads/2012/03/eff.pdf">eff.pdf</a></p>
<p><strong>ArXiv version:</strong> <a href="http://arxiv.org/abs/1203.1539v1"> arXiv:1203.1539v1</a> [cs.PL]</p>
<p>To read more about eff, visit the <a href="/eff/">eff page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>A puzzle about typing</title>
		<link>http://math.andrej.com/2012/01/20/a-puzzle-about-typing/</link>
		<comments>http://math.andrej.com/2012/01/20/a-puzzle-about-typing/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 13:42:44 +0000</pubDate>
		<dc:creator>Andrej Bauer</dc:creator>
				<category><![CDATA[Computation]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://math.andrej.com/?p=1109</guid>
		<description><![CDATA[<p>While making a comment on Stackoverflow I noticed something: suppose we have a term in the $\lambda$-calculus in which no abstracted variable is used more than once. For example, $\lambda a b c . (a b) (\lambda d. d c)$ is such a term, but $\lambda f . f (\lambda x . x x)$ is not because [...]]]></description>
			<content:encoded><![CDATA[<p>While making a comment on <a href="http://cstheory.stackexchange.com/questions/9690/functions-that-typed-lambda-calculus-cannot-compute">Stackoverflow</a> I noticed something: suppose we have a term in the $\lambda$-calculus in which no abstracted variable is used more than once. For example, $\lambda a b c . (a b) (\lambda d. d c)$ is such a term, but $\lambda f . f (\lambda x . x x)$ is not because $x$ is used twice. If I am not mistaken, all such terms can be typed. For example:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
# fun a b c -&gt; (a b) (fun d -&gt; d c) ;;
- : ('a -&gt; (('b -&gt; 'c) -&gt; 'c) -&gt; 'd) -&gt; 'a -&gt; 'b -&gt; 'd = &lt;fun&gt;

# fun a b c d e e' f g h i j k l m n o o' o'' o''' p q r r' s t u u' v w x y z -&gt;
    q u i c k b r o w n f o' x j u' m p s o'' v e r' t h e' l a z y d o''' g;;
  - : 'a -&gt; 'b -&gt; 'c -&gt; 'd -&gt; 'e -&gt; 'f -&gt; 'g -&gt; 'h -&gt; 'i -&gt; 'j -&gt;
    'k -&gt; 'l -&gt; 'm -&gt; 'n -&gt; 'o -&gt; 'p -&gt; 'q -&gt; 'r -&gt; 's -&gt; 't -&gt;
    ('u -&gt; 'j -&gt; 'c -&gt; 'l -&gt; 'b -&gt; 'v -&gt; 'p -&gt; 'w -&gt; 'o -&gt; 'g -&gt;
     'q -&gt; 'x -&gt; 'k -&gt; 'y -&gt; 'n -&gt; 't -&gt; 'z -&gt; 'r -&gt; 'a1 -&gt; 'e -&gt;
     'b1 -&gt; 'c1 -&gt; 'i -&gt; 'f -&gt; 'm -&gt; 'a -&gt; 'd1 -&gt; 'e1 -&gt; 'd -&gt; 's
     -&gt; 'h -&gt; 'f1) -&gt; 'v -&gt; 'b1 -&gt; 'z -&gt; 'c1 -&gt; 'u -&gt; 'y -&gt; 'a1
     -&gt; 'w -&gt; 'x -&gt; 'e1 -&gt; 'd1 -&gt; 'f1 = &lt;fun&gt;
</pre>
<p>What is the easiest way to see that this really is the case?</p>
<p>A related question is this (I am sure people have thought about it): how big can a type of a typeable $\lambda$-term be? For example, the Ackermann function can be typed as follows, although the type prevents it from doing the right thing in a typed setting:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
# let one = fun f x -&gt; f x ;;
val one : ('a -&gt; 'b) -&gt; 'a -&gt; 'b =
# let suc = fun n f x -&gt; n f (f x) ;;
val suc : (('a -&gt; 'b) -&gt; 'b -&gt; 'c) -&gt; ('a -&gt; 'b) -&gt; 'a -&gt; 'c =
# let ack = fun m -&gt; m (fun f n -&gt; n f (f one)) suc ;;
val ack :
  ((((('a -&gt; 'b) -&gt; 'a -&gt; 'b) -&gt; 'c) -&gt;
   (((('a -&gt; 'b) -&gt; 'a -&gt; 'b) -&gt; 'c) -&gt; 'c -&gt; 'd) -&gt; 'd) -&gt;
   ((('e -&gt; 'f) -&gt; 'f -&gt; 'g) -&gt; ('e -&gt; 'f) -&gt; 'e -&gt; 'g) -&gt; 'h) -&gt; 'h = &lt;fun&gt;
</pre>
<p>That&#8217;s one mean type there! Can it be &#8220;explained&#8221;? Hmm, why <em>does</em> <code>ack</code> compute the Ackermann function in the untyped $\lambda$-calculus?</p>
]]></content:encoded>
			<wfw:commentRss>http://math.andrej.com/2012/01/20/a-puzzle-about-typing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>On the Bourbaki-Witt Principle in Toposes</title>
		<link>http://math.andrej.com/2012/01/04/on-the-bourbaki-witt-principle-in-toposes/</link>
		<comments>http://math.andrej.com/2012/01/04/on-the-bourbaki-witt-principle-in-toposes/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 07:09:10 +0000</pubDate>
		<dc:creator>Andrej Bauer</dc:creator>
				<category><![CDATA[Constructive math]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Publications]]></category>

		<guid isPermaLink="false">http://math.andrej.com/?p=1104</guid>
		<description><![CDATA[<p>With Peter LeFanu Lumsdaine.</p>
<p>Abstract: The Bourbaki-Witt principle states that any progressive map on a chain-complete poset has a fixed point above every point. It is provable classically, but not intuitionistically. We study this and related principles in an intuitionistic setting. Among other things, we show that Bourbaki-Witt fails exactly when the trichotomous ordinals form a set, but does not [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://mathstat.dal.ca/~p.l.lumsdaine/">Peter LeFanu Lumsdaine</a>.</p>
<p><strong>Abstract: </strong>The Bourbaki-Witt principle states that any progressive map on a chain-complete poset has a fixed point above every point. It is provable classically, but not intuitionistically. We study this and related principles in an intuitionistic setting. Among other things, we show that Bourbaki-Witt fails exactly when the trichotomous ordinals form a set, but does not imply that fixed points can always be found by transfinite iteration. Meanwhile, on the side of models, we see that the principle fails in realisability toposes, and does not hold in the free topos, but does hold in all cocomplete toposes.</p>
<p><strong>Download paper:</strong> <a href="/wp-content/uploads/2012/01/bw.pdf">bw.pdf</a><br />
<strong>ArXiv version:</strong> <a href="http://arxiv.org/abs/1201.0340v1">arXiv:1201.0340v1</a> [math.CT]</p>
<p>This paper is an extension of my previous paper on <a href="/2009/01/23/on-the-failure-of-fixed-point-theorems-for-chain-complete-lattices-in-the-effective-topos/">the Bourbaki-Witt and Knaster-Tarski fixed-point theorems in the effective topos</a> (<a href="http://arxiv.org/abs/0911.0068v1">arXiv:0911.0068v1</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://math.andrej.com/2012/01/04/on-the-bourbaki-witt-principle-in-toposes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

