feat(Combinatorics/SimpleGraph/Acyclic): a graph is a tree iff it's acyclic and has exactly n - 1 edges#34910
Conversation
…cyclic and has exactly `n - 1` edges
PR summary 8379122c70Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
…/simple-graph/tree-iff-acyclic-and-n-minus-one
|
This pull request has conflicts, please merge |
…/simple-graph/tree-iff-acyclic-and-n-minus-one
…/simple-graph/tree-iff-acyclic-and-n-minus-one
|
This pull request has conflicts, please merge |
…rel-ndrec-and-equiv-quot
…/simple-graph/tree-iff-acyclic-and-n-minus-one
|
This PR/issue depends on: |
amellendijk
left a comment
There was a problem hiding this comment.
Thanks!
Just some minor comments, but this all seems reasonable.
| obtain ⟨F, hF⟩ := G.exists_isAcyclic_reachable_eq_le_of_le_of_isAcyclic bot_le isAcyclic_bot | ||
| grind [IsTree, Connected, preconnected_iff_reachable_eq_top] | ||
|
|
||
| theorem connected_iff_card_connectedComponent_eq_one : |
There was a problem hiding this comment.
Is it possible to move this to Connectivity/Connected.lean?
There was a problem hiding this comment.
Not without import changes as it doesn't import Nat.card. It is imported in Connectivity/Subgraph.lean and Connectivity/EdgeConnectivity.lean, but they also seem weird.
#40624 will fix the import issues, but no one commented on it yet.
| exact Finset.card_lt_card <| by simpa [deleteEdges, edgeFinset] | ||
|
|
||
| /-- An acyclic graph on `n` vertices with `c` connected components has exactly `n - c` edges -/ | ||
| theorem IsAcyclic.ncard_edgeSet_add_card_connectedComponent [Finite V] (h : G.IsAcyclic) : |
There was a problem hiding this comment.
I think the naming is fine, but sometimes while naming we are using the plural connectedComponents such as colorable_iff_forall_connectedComponents, and sometimes not, what do you think is best?
There was a problem hiding this comment.
The only uses of the plural seem to be what you mentioned and homOfConnectedComponents. I think colorable_iff_forall_connectedComponents is a typo, and homOfConnectedComponents is probably fine since it's a def.
docstring periods Co-authored-by: Rida Hamadani <mridahamadani@gmail.com>
This was my white whale for quite some time. Hooray!
fromRelequivalence withSigmaover aQuotient#34909