Repository navigation
Conversation
eric-wieser
left a comment
There was a problem hiding this comment.
Can you add a simp lemma that shows complement (complement g) = g?
|
Done! |
kmill
left a comment
There was a problem hiding this comment.
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 <[email protected]>
Co-authored-by: Kyle Miller <[email protected]>
|
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 <[email protected]>
Co-authored-by: Bryan Gin-ge Chen <[email protected]>
Co-authored-by: Bryan Gin-ge Chen <[email protected]>
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 |
|
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. |
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 <[email protected]>
|
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 <[email protected]>
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.