Formalpedia

June 15, 2009 by slawekk

Formalpedia is an “editable online repository of code and formal math”. It is on its way to became the first formalized mathematics wiki that goes online. Read the rest of this entry »

Markov chains

June 5, 2009 by slawekk

The approach taken in the Haskell’s probability library makes it especially convenient for modeling Markov chains.
Suppose  \{X_n\}_{n \in \mathbb{N}} is a Markov chain on a state space S. Distribution of the process \{X_n\}_{n \in \mathbb{N}} is determined by the distribution of X_0 and the numbers Pr(X_{n+1}=y | X_n = x), x,y \in S, n \in \mathbb{N}, called transition probabilities. For simplicity let’s consider only time-homogeneous Markov chains where these numbers don’t depend on n and let’s assume that the initial distribution is a point mass, i.e. X_0 = x_0 for some x_0\in S. Then we can define a function f: S \rightarrow Dist(S), where for each x \in S the value f(x) is a distribution on S defined by (f(x))(y) = Pr(X_{n+1}=y | X_n = x), x,y \in S, n \in \mathbb{N}. Here Dist(S) denotes the set of finitely supported nonnegative functions on S that sum up to 1. Conceptually, f(x) is the the distribution of the next value of the chain given the current value is x. This is exactly the kind of distribution-valued function that is the right hand side operand of the \leadsto operation from the previous post, which corresponds to the Haskell’s >>= operation in the probability monad. Read the rest of this entry »

Probability monad

May 31, 2009 by slawekk

My favourite programming language Haskell has a nice library for doing calculations with probablility distributions, called probability.
The library was originally written by Martin Ewig and Steve Kollmansberger and then extended and packaged for convenient installation by Henning Thieleman. Its main idea for the implementation is to use the fact that “probability distributions form a monad” (from a paper by the authors of the library ). This post aims at translating this claim into standard probability notation and showing how it is used in the library. Read the rest of this entry »

IsarMathLib version 1.6.8 released

April 26, 2009 by slawekk

This release is  the first version of the IsarMathLib library for the new Isabelle2009. There is a little bit of new formalized mathematics as well. Read the rest of this entry »

Isabelle 2009 released

April 22, 2009 by slawekk

The Isabelle team has released version 2009. Updating IsarMathLib to Isabelle 2009 was very easy. I only had to make a couple of corrections to proofs that used assumptions implicitly. The only more complicated change was related to renaming variables in the locale syntax. Read the rest of this entry »

MathWiki project is hiring

March 10, 2009 by slawekk

Apparently the formalized mathematics project at Radboud University Nijmegen (NL) that I wrote about previously did get some funding after all and they are hiring two people to work on it. The PhD position is for 4 years and the postdoc position is 3 years. I hope that a usable formalized mathematics wiki will be available earlier.

The postdoc position pays a “maximum salary”  of 3755 Euro per month. Such wording immediately makes me curious what is the minimum … .

Interval arithmetic in groups – pass 2

March 1, 2009 by slawekk

This is a continuation of the Interval arithmetics in groups: Pass 1 post.

Let f: \mathcal{V}\times\mathcal{V} \rightarrow \mathcal{V} be a binary operation on a set \mathcal{V}. We will write this operation additively as f\langle x,y \rangle = x + y. Such operation defines another binary operation f^\mathcal{P} on on the powerset \mathcal{P}(\mathcal{V}) (set of subsets) of \mathcal{V} in a natural way: f^\mathcal{P} \langle X, Y \rangle = \{ x + y | x\in X, y\in Y\} for X,Y \subseteq \mathcal{V}.  The nice thing about f^\mathcal{P} is that it inherits interesting properties of f: if f is commutative, then so is f^\mathcal{P}, if ( \mathcal{V},f) is a semigroup, then (\mathcal{P}( \mathcal{V}), f^\mathcal{P}) is also a semigroup, if ( \mathcal{V},f) is a monoid, then (\mathcal{P}( \mathcal{V}), f^\mathcal{P}) is also a monoid, if ( \mathcal{V},f) is a group. then … well, never mind, we don’t need that anyway.

This means that all theorems about adding finite (indexed) collections of semigroup elements (and there are quite a couple in the Semigroup_ZF theory) can be reused for the operation on subsets of \mathcal{V} at little additional cost.

The setup for adding group subsets in the Gyula Lakos’s paper is different in that it assumes the existence of neutral element and defines how to add an infinite number of subsets of \mathcal{V}.

b.) More generally, suppose \{ A_\lambda \}_{\lambda \in \Lambda} is a countable indexed family of subsets of \mathcal{V}. Assume that 0 \in A_\lambda for all \lambda \in  \Lambda except for finitely many. Only in that case we define the algebraic sum \sum_{\lambda \in \Lambda } A_\lambda as \{ \sum_{\lambda \in \Lambda } a_\lambda : a_\lambda \in A_\lambda , a_\lambda = 0 \text{ for all } \lambda  \in \Lambda except for finitely many \}.

We can do something in that spirit for f^\mathcal{P} as well. Namely suppose that
(\mathcal{V}, f) is a monoid and A: \Lambda \rightarrow  \mathcal{P}(\mathcal{V}) is a an indexed collection of subsets of \mathcal{V} such that all but finitely many contain the neutral element (denoted 0). We can split the index set  \Lambda into two subsets, one called \Lambda_0 consisting of those \lambda\in \Lambda for which A_\lambda contains the neutral element, and the rest. Then we can define the sum of the family \lambda \mapsto A_\lambda of subsets of \mathcal (V) as follows:

\sum_{\lambda \in \Lambda} A_\lambda := \left(\sum_{\lambda \in \Lambda \setminus \Lambda_0} A_\lambda\right) + \left(\bigcup_{F \in Fin\mathcal{P}(\Lambda_0)} \sum_{\lambda \in F} A_\lambda\right),

where  Fin\mathcal{P}(\Lambda_0) is the set of finite nonempty subsets of \Lambda_0 and +, \sum are interpreted as the additive notation for f^\mathcal{P}. So what we do is we add all sets that do not contain 0, but for sets that do contain 0 we sum every finite subcollection and take the union of all sums obtained this way.

This nicely generalizes the concept of adding finite collections of sets of semigroups (where the \Lambda_0 is empty and there is only the first component of the sum above) and (in contrast to the Lakos’ approach) does not require selecting monoid elements from infinite collections of subsets of \mathcal{V}, i.e. does not require the axiom of choice.

IsarMathLib version 1.6.7 released

February 18, 2009 by slawekk

This release includes the new HTML rendering tool that replaces tiddlyisar (which still compiles and works ). I updated all IsarMathLib theories that were not fully updated for Isabelle 2008 removing legacy keywords like constdefs and prems and added missing comments. As a result all IsarMathLib theories except those translated from Metamath are now presented at the FormalMath.org site.

There is no new formalized mathematics in this release.

Goodbye ProofGeneral

January 15, 2009 by slawekk

Some recent messages on the Isabelle mailing list bring the information that the Isabelle team is working on a new interface for Isabelle and possibly other provers that will replace Emacs based ProofGeneral. The new interface will be written in Scala. Scala is an multiparadigm language (OO and functional) that runs on JVM. This is an interesting choice of technology that suggests something about the design goals (I am speculating again). Applications writen in Scala can run on any platform that has JVM. In particular, one can write applets in Scala that can be run in a browser. Scala is a general purpose language, but seems to be particularly good for web programming. There are a couple of web programming frameworks written in Scala, Lift being the most popular, competing with Rails. So the new interface will be multiplatform and easy to integrate with web applications (wiki?). Hopefully this will make Isabelle proving environment closer to being network transparent – a user interface, possibly running in a browser and sending formalized text for verification to an Isabelle server located (possibly) on a different host with dependencies scattered all over the internet.

Read the rest of this entry »

Formalmath.org

January 7, 2009 by slawekk

The new HTML rendering of IsarMathLib is ready.

Creating it was easier than I had expected. The most tricky part of the Isar to HTML translator is the Isar parser, but that was done when creating the TiddlyWiki rendering, and didn’t require any changes. Producing HTML from internal representation was just a simple rewrite of the existing TiddlyWiki markup generator. I had to learn some JavaScript and haXe to implement expanding proofs and reference hints, but not much and it was an interesting experience.The CSS layout was created with an online frameset generator with some minor tweaks.

There is one remaining serious issue that I don’t know how to resolve. Some proofs don’t expand on click. One can see an example of this problem in the proof of lemma func1_1_L12 in the func1 theory. The only subproof there does not change cursor and background color on mouse hover (implemented with CSS) and does not expand on click (haXe and JavaScript). Curiously, TiddlyWiki presentation has a very similar problem, see the proof of prod_list_of_lists in the Semigroup_ZF tiddler. This happens in Firefox 3.0.5 on Ubuntu and IE7 and Firefox on Windows XP. If you have an idea what might be causing this, please let me know.

P.S. This turned out to be a jsMath issue.