Skip to content
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

Closed
wants to merge 34 commits into from

Conversation

gihanmarasingha
Copy link
Collaborator

@gihanmarasingha gihanmarasingha commented Aug 11, 2020

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.


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.
@robertylewis robertylewis added the awaiting-author A reviewer has asked the author a question or requested changes label Aug 11, 2020
@bryangingechen bryangingechen changed the title feat(miu_language): a formalisation of the MIU language described by D. feat(miu_language): a formalisation of the MIU language described by D. Hofstadter in "Gödel, Escher, Bach". Aug 11, 2020
@semorrison semorrison added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Aug 12, 2020
…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`.
@semorrison
Copy link
Collaborator

Can you mark as request-review again, and mark relevant conversations as resolved, when you're ready for another round of review?

Remove three lemmas from `decision_nec` and `decision_suf`, having added them to `/src/data/list/basic.lean` in a previous commit.
@gihanmarasingha gihanmarasingha added the awaiting-review The author would like community review of the PR label Aug 17, 2020
@bryangingechen bryangingechen removed the awaiting-author A reviewer has asked the author a question or requested changes label Aug 17, 2020
Copy link
Member

@robertylewis robertylewis left a 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!

archive/miu_language/basic.lean Outdated Show resolved Hide resolved
archive/miu_language/decision_nec.lean Show resolved Hide resolved
archive/miu_language/decision_nec.lean Outdated Show resolved Hide resolved
archive/miu_language/decision_suf.lean Outdated Show resolved Hide resolved
archive/miu_language/decision_suf.lean Outdated Show resolved Hide resolved
archive/miu_language/decision_suf.lean Show resolved Hide resolved
archive/miu_language/decision_suf.lean Outdated Show resolved Hide resolved
@robertylewis robertylewis added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Aug 17, 2020
* 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`.
@gihanmarasingha gihanmarasingha added the awaiting-review The author would like community review of the PR label Aug 18, 2020
@bryangingechen bryangingechen removed the awaiting-author A reviewer has asked the author a question or requested changes label Aug 18, 2020
@robertylewis
Copy link
Member

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 :)

Copy link
Member

@jcommelin jcommelin left a 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!

docs/references.bib Outdated Show resolved Hide resolved
Co-authored-by: Johan Commelin <johan@commelin.net>
@gihanmarasingha
Copy link
Collaborator Author

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!

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.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Aug 18, 2020
bors bot pushed a commit that referenced this pull request Aug 18, 2020
…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.
@bors
Copy link

bors bot commented Aug 18, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(miu_language): a formalisation of the MIU language described by D. Hofstadter in "Gödel, Escher, Bach". [Merged by Bors] - feat(miu_language): a formalisation of the MIU language described by D. Hofstadter in "Gödel, Escher, Bach". Aug 18, 2020
@bors bors bot closed this Aug 18, 2020
@bors bors bot deleted the miu branch August 18, 2020 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants