feat(Combinatorics/SimpleGraph/Coloring/EdgeColoring): create a basic edge-coloring API#33313
Conversation
PR summary b31b601893Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
This PR/issue depends on: |
151cba8 to
115da59
Compare
115da59 to
e40eb80
Compare
ooovi
left a comment
There was a problem hiding this comment.
Thanks for your PR! :)
Please put periods at the end of your docstrings.
Also consider moving the Coloring.lean file in the parent directory to the Coloring folder and renaming it to Basic.lean.
Thank you for reviewing!
I really prefer them without periods, unless there's more than one sentence.
Should I do in this PR or a separate one? Also, my plan was to have something like:
or (if that sounds weird)
wdyt? I agree that vertex coloring is the simplest one, but making it |
I'm afraid the documentation style guide indeed recommends that "If a doc string is a complete sentence, then it should end in a period.". Then again, many of yours are not complete sentences :)
It should be a separate PR just moving the file, and then another one that deprecates the module, since those are easy to approve. This PR can then depend on them.
I also feel its wrong. I even remember being disappointed to find that How about |
|
I think coloring is a major part of graph-theory so we should have a |
…oloring/VertexColoring.lean` (#37525) This is in preparation of #33313 and other material to come, here's how I imagine the folder to look like: - `Coloring/VertexColoring.lean` (currently `Coloring.lean`) - `Coloring/EdgeColoring.lean` - `Coloring/VertexListColoring.lean` - `Coloring/EdgeListColoring.lean` - `Coloring/ChromaticPolynomial.lean` - `Coloring/EdgeLabeling.lean` (currently `./EdgeLabeling.lean`) - `Coloring/ConcreteColorings.lean` (currently `./ConcreteColorings.lean`)
|
This pull request has conflicts, please merge |
| simpa using isEmpty_of_chromaticNumber_eq_zero h | ||
|
|
||
| /-- Lift an embedding of colors to an embedding of edge colorings. -/ | ||
| def EdgeColoring.ofColorEmbedding (f : α ↪ β) : G.EdgeColoring α ↪ G.EdgeColoring β := |
There was a problem hiding this comment.
| def EdgeColoring.ofColorEmbedding (f : α ↪ β) : G.EdgeColoring α ↪ G.EdgeColoring β := | |
| def EdgeColoring.ofEmbedding (f : α ↪ β) : G.EdgeColoring α ↪ G.EdgeColoring β := |
| recolorOfEmbedding _ f | ||
|
|
||
| /-- Lift an isomorphism of colors to an isomorphism of edge colorings. -/ | ||
| def EdgeColoring.ofColorIso (f : α ≃ β) : G.EdgeColoring α ≃ G.EdgeColoring β := |
There was a problem hiding this comment.
| def EdgeColoring.ofColorIso (f : α ≃ β) : G.EdgeColoring α ≃ G.EdgeColoring β := | |
| def EdgeColoring.congr (f : α ≃ β) : G.EdgeColoring α ≃ G.EdgeColoring β := |
maybe? or maybe edgeColoringEquivOfEquiv outside of the EdgeLabelling namespace? The current name is probably not suitable.
There was a problem hiding this comment.
edgeColoringEquivOfEquiv and edgeColoringEquivOfIso would then be separated by a slight technicality in naming. Are you sure?
I agree on un-namespacing this one, since it would allow for dot-notation on graphs.
|
|
||
| variable (α) in | ||
| /-- Edge-colorings of graphs with isomorphic line-graphs are equivalent. -/ | ||
| def EdgeColoring.ofLineGraphIso (f : G.lineGraph ≃g G'.lineGraph) : |
There was a problem hiding this comment.
| def EdgeColoring.ofLineGraphIso (f : G.lineGraph ≃g G'.lineGraph) : | |
| def edgeColoringEquivOfLineGraphIso (f : G.lineGraph ≃g G'.lineGraph) : |
|
|
||
| variable (α) in | ||
| /-- Edge-colorings of isomorphic graphs are equivalent. -/ | ||
| def EdgeColoring.ofIso (f : G ≃g G') : G.EdgeColoring α ≃ G'.EdgeColoring α := |
There was a problem hiding this comment.
| def EdgeColoring.ofIso (f : G ≃g G') : G.EdgeColoring α ≃ G'.EdgeColoring α := | |
| def edgeColoringEquivOfIso (f : G ≃g G') : G.EdgeColoring α ≃ G'.EdgeColoring α := |
There was a problem hiding this comment.
What's wrong with namespacing? (ditto for EdgeColoring.ofLineGraphIso)
There was a problem hiding this comment.
Actually how about Iso.edgeColoringEquiv for dot notation on Iso?
…oloring/VertexColoring.lean` (leanprover-community#37525) This is in preparation of leanprover-community#33313 and other material to come, here's how I imagine the folder to look like: - `Coloring/VertexColoring.lean` (currently `Coloring.lean`) - `Coloring/EdgeColoring.lean` - `Coloring/VertexListColoring.lean` - `Coloring/EdgeListColoring.lean` - `Coloring/ChromaticPolynomial.lean` - `Coloring/EdgeLabeling.lean` (currently `./EdgeLabeling.lean`) - `Coloring/ConcreteColorings.lean` (currently `./ConcreteColorings.lean`)
Future work (which I'm working on):
G.maxDegree ≤ G.chromaticIndex)G.chromaticIndex ≤ G.maxDegree + 1)chromaticIndex ⊤ = (if Even #V then #V - 1 else #V)[Infinite α] → chromaticIndex ⊤ = ⊤