-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat(miu_language): a formalisation of the MIU language described by D. Hofstadter in "Gödel, Escher, Bach". #3739
Conversation
Hofstadter in "Gödel, Escher, Bach". We show that a string `en` in the language is derivable if and only if it satisfies `decstr en`, where `decstr` is a simple predicate that 'should' be decidable. However, we do not _prove_ decidability.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
This reverts commit cc3fcb2.
The new definition dispenses with `∃` and thereby facilitates automatic derivation of `decidable_pred decstr`.
…emises `l ≠ nil` Three results. The first states: if `count a = length l`, then `repeat a (count a l) = l`. The second states: if `l ≠ nil`, then `tail (l ++ [a]) = tail l ++ [a]`, if `l ≠ nil`. The last states: if `l ≠ nil`, then `∃ b L, l = b :: L`.
Can you mark as |
Remove three lemmas from `decision_nec` and `decision_suf`, having added them to `/src/data/list/basic.lean` in a previous commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking nice!
* Use `derive` rather than explicit derivation of typeclass in `basic.lean` * Ensure all remaining goals are presented in indented blocks. * Eliminate nonterminal use of `simp`, replace with `simp only`.
I think this is looking great. Since it's a big PR, I won't merge immediately to see if there are more comments. But I'm satisfied :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes there are multiple empty lines following each other... I would just use 1 empty line in those cases. @robertylewis what do you think?
@gihanmarasingha Thank you so much for writing this! It looks great!
Co-authored-by: Johan Commelin <johan@commelin.net>
Thanks all so much for the invaluable review suggestions. The code is so much better and I've become more proficient in Lean (and Git) through the process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
…D. Hofstadter in "Gödel, Escher, Bach". (#3739) We define an inductive type `derivable` so that `derivable x` represents the notion that the MIU string `x` is derivable in the MIU language. We show `derivable x` is equivalent to `decstr x`, viz. the condition that `x` begins with an `M`, has no `M` in its tail, and for which `count I` is congruent to 1 or 2 modulo 3. By showing `decidable_pred decstr`, we deduce that `derivable` is decidable.
Pull request successfully merged into master. Build succeeded: |
We define an inductive type
derivable
so thatderivable x
represents the notion that the MIU stringx
is derivable in the MIU language. We showderivable x
is equivalent todecstr x
, viz. the condition thatx
begins with anM
, has noM
in its tail, and for whichcount I
is congruent to 1 or 2 modulo 3.By showing
decidable_pred decstr
, we deduce thatderivable
is decidable.