# Joachim Breitner's Homepage

## The Incredible Proof Machine

In a few weeks, I will have the opportunity to offer a weekend workshop to selected and motivated high school students^{1} to a topic of my choice. My idea is to tell them something about logic, proofs, and the joy of searching and finding proofs, and the gratification of irrevocable truths.

While proving things on paper is already quite nice, it is much more fun to use an interactive theorem prover, such as Isabelle, Coq or Agda: You get immediate feedback, you can experiment and play around if you are stuck, and you get lots of small successes. Someone^{2} once called interactive theorem proving “the worlds most geekiest videogame”.

Unfortunately, I don’t think one can get high school students without any prior knowledge in logic, or programming, or fancy mathematical symbols, to do something meaningful with a system like Isabelle, so I need something that is (much) easier to use. I always had this idea in the back of my head that proving is not so much about writing text (as in “normally written” proofs) or programs (as in Agda) or labeled statements (as in Hilbert-style proofs), but rather something involving facts that I have proven so far floating around freely, and way to combine these facts to new facts, without the need to name them, or put them in a particular order or sequence. In a way, I’m looking for labVIEW wrestled through the Curry-Horward-isomorphism. Something like this:

So I set out, rounded up a few contributors (Thanks!), implemented this, and now I proudly present: **The Incredible Proof Machine**^{3}

This interactive theorem prover allows you to do perform proofs purely by dragging blocks (representing proof steps) onto the paper and connecting them properly. There is no need to learn syntax, and hence no frustration about getting that wrong. Furthermore, it comes with a number of example tasks to experiment with, so you can simply see it as a challenging computer came and work through them one by one, learning something about the logical connectives and how they work as you go.

For the actual workshop, my plan is to let the students *first* try to solve the tasks of one session on their own, let them draw their own conclusions and come up with an idea of what they just did, and *then* deliver an explanation of the logical meaning of what they did.

The implementation is heavily influenced by Isabelle: The software does not know anything about, say, conjunction (∧) and implication (→). To the core, everything is but an untyped lambda expression, and when two blocks are connected, it does unification^{4} of the proposition present on either side. This general framework is then instantiated by specifying the basic rules (or axioms) in a descriptive manner. It is quite feasible to implement other logics or formal systems on top of this as well.

Another influence of Isabelle is the non-linear editing: You neither have to create the proof in a particular order nor have to manually manage a “proof focus”. Instead, you can edit any bit of the proof at any time, and the system checks all of it continuously.

As always, I am keen on feedback. Also, if you want to use this for your own teaching or experimenting needs, let me know. We have a mailing list for the project, the code is on GitHub, where you can also file bug reports and feature requests. Contributions are welcome! All aspects of the logic are implemented in Haskell and compiled to JavaScript using GHCJS, the UI is plain hand-written and messy JavaScript code, using JointJS to handle the graph interaction.

Obviously, there is still plenty that can be done to improve the machine. In particular, the ability to create your own proof blocks, such as proof by contradiction, prove them to be valid and then use them in further proofs, is currently being worked on. And while the page will store your current progress, including all proofs you create, in your browser, it needs better ways to save, load and share tasks, blocks and proofs. Also, we’d like to add some gamification, i.e. achievements (“First proof by contradiction”, “50 theorems proven”), statistics, maybe a “share theorem on twitter” button. As the UI becomes more complicated, I’d like to investigating moving more of it into Haskell world and use Functional Reactive Programming, i.e. Ryan Trickle’s reflex, to stay sane.

Customers who liked **The Incredible Proof Machine** might also like these artifacts, that I found while looking whether something like this exists:

- Easyprove, an interactive tool to create textual proofs by clicking on rules.
- Domino On Acid represents natural deduction rules in propositional logic with → and ⊥ as a game of dominoes.
- Proofscape visualizes the dependencies between proofs as graphs, i.e. it operates on a higher level than
**The Incredible Proof Machine**. - Proofmood is a nice interactive interface to conduct proofs in Fitch-style.
- Polymorphic Blocks represents proofs trees in a sequent calculus with boxes with different shapes that have to match.
- JAPE is an editor for proofs in a number of traditional proof styles. (Thanks to Alfio Martini for the pointer.)
- Logitext, written by Edward Z. Yang, is an online tool to create proof trees in sequent style, with a slick interface, and is even backed by Coq! (Thanks to Lev Lamberov for the pointer.)
- Carnap is similar in implementation to
**The Incredible Proof Machine**(logical core in Haskell, generic unification-based solver). It currently lets you edit proof trees, but there are plans to create something more visual. - Clickable Proofs is a (non-free) iOS app that incorporates quite a few of the ideas that are behind
**The Incredible Proof Machine**. It came out of a Bachelor’s thesis of Tim Selier and covers propositional logic. - Euclid the game by Kasper Peulen is a nice game to play with geometric constructions.
- Globular, a web-base proof assistent for “finitely-presented semistrict globular higher categories”.
- Viskell is not about proofs, but rather about functional programs, but according to Horward-Curry, that’s the same thing, and their graphs look quite similar.

Students with migration background supported by the START scholarship↩︎

Does anyone know the reference?↩︎

We almost named it “Proofcraft”, which would be a name our current Minecraft-wild youth would appreciate, but it is alreay taken by Gerwin Kleins blog. Also, the irony of a theorem prover being in-credible is worth something.↩︎

Luckily, two decades ago, Tobias Nipkow published a nice implementation of higher order pattern unification as ML code, which I transliterated to Haskell for this project.↩︎

## Comments

Glad you like it! The ∃ is a pun on the existential quantifier.

This is really nice.

I’m jealous of my son who gets to grow up with things like Dragon Box, Scratch, and The Incredible Proof Machine.

This is really cool, I enjoyed the first few “levels” immediately! It reminds me a lot of Euclid the game, by Kasper Peulen: http://euclidthegame.com/

Have something to say? You can post a comment by sending an e-Mail to me at <mail@joachim-breitner.de>, and I will include it here.

This is beyond awesome! The Incredible Proof Machine could become the Scratch of proofs. I’m sharing this with my friends.

BTW, why is the the E in “Machine” mirrored?