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

feat: context-free languages closure reversal #7666

Closed
wants to merge 14 commits into from
Closed

feat: context-free languages closure reversal #7666

wants to merge 14 commits into from

Conversation

madvorak
Copy link
Collaborator


Open in Gitpod

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)}
Copy link
Member

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

Copy link
Member

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?

Copy link
Collaborator Author

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 }
Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator Author

@madvorak madvorak Oct 17, 2023

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>
@madvorak madvorak added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Oct 17, 2023
@madvorak madvorak removed the awaiting-author A reviewer has asked the author a question or requested changes label Oct 17, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Nov 25, 2023
@madvorak
Copy link
Collaborator Author

I'll split it into two PRs.

@madvorak
Copy link
Collaborator Author

-> #8629

@madvorak madvorak closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict The PR has a merge conflict with master, and needs manual merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants