# Documentation

Archive.MiuLanguage.Basic

# An MIU Decision Procedure in Lean #

The MIU formal system was introduced by Douglas Hofstadter in the first chapter of his 1979 book, Gödel, Escher, Bach. The system is defined by four rules of inference, one axiom, and an alphabet of three symbols: M, I, and U.

Hofstadter's central question is: can the string "MU" be derived?

It transpires that there is a simple decision procedure for this system. A string is derivable if and only if it starts with M, contains no other Ms, and the number of Is in the string is congruent to 1 or 2 modulo 3.

The principal aim of this project is to give a Lean proof that the derivability of a string is a decidable predicate.

## The MIU System #

In Hofstadter's description, an atom is any one of M, I or U. A string is a finite sequence of zero or more symbols. To simplify notation, we write a sequence [I,U,U,M], for example, as IUUM.

The four rules of inference are:

1. xI → xIU,
2. Mx → Mxx,
3. xIIIy → xUy,
4. xUUy → xy,

where the notation α → β is to be interpreted as 'if α is derivable, then β is derivable'.

• MI is derivable.
In Lean, it is natural to treat the rules of inference and the axiom on an equal footing via an inductive data type Derivable designed so that Derivable x represents the notion that the string x can be derived from the axiom by the rules of inference. The axiom is represented as a nonrecursive constructor for Derivable. This mirrors the translation of Peano's axiom '0 is a natural number' into the nonrecursive constructor zero of the inductive type Nat.