-
Notifications
You must be signed in to change notification settings - Fork 299
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(combinatorics/simple_graph/basic): add definition of complement of simple graph #5697
Conversation
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.
Can you add a simp lemma that shows complement (complement g) = g
?
Done! |
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.
Other than adding the additional @[simp]
attributes, 👍
Instead of |
@eric-wieser Graphs do form a The two textbooks I have in front of me use overlines for complementation, but |
I'm starting to wonder if |
@eric-wieser You can think of the current definition as being that but expanded out to not mention quotients or sets of subtypes. The following are equivalent:
It tends to be easier to deal with this last form in proofs because it's all basic logic. Feel free to experiment, though, to see if it ends up being easier overall: structure simple_graph' (V : Type u) :=
(edges : set {e : finset V // e.card = 2}) |
Right, but it also means you don't have the entire set API automatically available to apply to graphs. Your first two definitions get that for free. Of course, you can always pick one definition and then write an API to make it have the desirable properties of another definition - my claim is simply that the current choice requires more of this glue than other choices. But I don't have experience proving things about graphs so could be mistaken. |
I've found that this particular version can be really awkward to work with, especially compared to the |
I guess an equiv between graphs and |
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
…/mathlib into graph_compl adding suggestions
Should I add the equivalence and |
If they're simple and straightforward (e.g. the fields are mostly 1-line proofs after golfing), yes. Otherwise you can add them to a PR that's dependent on this one. |
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
I think I'm going to need to make it a separate PR - iirc the boolean algebra instance relies on definitions of subgraphs and such |
…/mathlib into graph_compl adding changes
Also, for some reason |
I'd say hold off implementing the boolean algebra structure until you actually need it -- I'm not really sure where the full structure would even be used. |
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 r+
I'd look at this the other way - the boolean algebra gives you definitions of (edge-)subgraphs for free. |
…of simple graph (#5697) Add definition of the complement of a simple graph. Part of branch [strongly_regular_graph](https://github.com/leanprover-community/mathlib/tree/strongly_regular_graph), with the goal of proving facts about strongly regular graphs. Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
Pull request successfully merged into master. Build succeeded: |
…of simple graph (#5697) Add definition of the complement of a simple graph. Part of branch [strongly_regular_graph](https://github.com/leanprover-community/mathlib/tree/strongly_regular_graph), with the goal of proving facts about strongly regular graphs. Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
Add definition of the complement of a simple graph. Part of branch strongly_regular_graph, with the goal of proving facts about strongly regular graphs.