-
Notifications
You must be signed in to change notification settings - Fork 259
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
feat: context-free languages closure reversal #7666
Conversation
madvorak
commented
Oct 13, 2023
cases g with | ||
| mk => simp [reverseGrammar, dual_reverseRule, List.map_map, List.map_id] | ||
|
||
private lemma derives_reverse {g : ContextFreeGrammar T} {s : List (Symbol T g.NT)} |
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.
I'm not sure all of these things should be private, making things private generally just makes it harder for other people to prove things about them
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.
I guess the question is if there are any possible other results whose proof would make use of reverseGrammar
?
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.
I don't think so.
∃ g : ContextFreeGrammar.{uT} T, g.language = L | ||
|
||
/-- `L.reverse` is a language that contains exactly all words from `L` backwards. -/ | ||
def Language.reverse (L : Language T) : Language T := { w : List T | w.reverse ∈ L } |
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.
should go in Mathlib.Computability.Language
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.
and we should add the basic lemmas for it, i.e. the reverse of the zero and 1 language, reverse of union of two languages, concatenation etc
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.
Done. Please check the names of Language.reverse_something
lemmas.
Co-authored-by: Alex J Best <alex.j.best@gmail.com>
Co-authored-by: Alex J Best <alex.j.best@gmail.com>
I'll split it into two PRs. |
-> #8629 |