feat(Combinatorics/SimpleGraph/Hasse): Define the Eulerian path of a path graph#34171
Conversation
PR summary 5908048297Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| theorem length_ofPathGraph : (ofPathGraph n).length = n := by | ||
| grind [support_ofPathGraph, length_support] | ||
|
|
||
| theorem IsPath.ofPathGraph : ofPathGraph n |>.IsPath := |
There was a problem hiding this comment.
I don't think this belongs in the IsPath namespace.
| theorem IsPath.ofPathGraph : ofPathGraph n |>.IsPath := | |
| theorem isPath_ofPathGraph : ofPathGraph n |>.IsPath := |
There was a problem hiding this comment.
I disagree, path graphs are very related to IsPath and this allows for dot notation when the expected type is IsPath
There was a problem hiding this comment.
I'm not sure I follow, how can dot notation be used here when IsPath is the conclusion rather than a hypothesis?
There was a problem hiding this comment.
Here's a straightforward example:
def myPath : (pathGraph 3).Path 0 2 := ⟨.ofPathGraph _, .ofPathGraph _⟩and here's a slightly less trivial example that might occur "in the wild":
namespace SimpleGraph
theorem IsAcyclic.pathGraph (n : ℕ) : (pathGraph n).IsAcyclic := sorry
theorem foo : s(0, 1) ∈ (Walk.ofPathGraph 1).edges := by
have := IsAcyclic.path_concat
(.pathGraph 2)
(.takeUntil (.ofPathGraph 1) (u := 0) (by simp))
(.ofPathGraph 1)
(by grind [pathGraph_adj, CovBy])
(by simp)
rw [this]
simp
end SimpleGraphThere was a problem hiding this comment.
This still feels backwards to me, where I would flip the names, e.g. ofPathGraph.isPath instead and maybe make n implicit, but yeah I'm happy to let the reviewers judge--I don't feel like I have a good enough feel for API design.
There was a problem hiding this comment.
I've seen this pattern before, I have no qualms with it.
Such statements are left for a future PR, since they add imports so we probably want to split them into a separate file:
(the last statement also requires #33121, this PR gives the right-to-left implication and that PR gives the left-to-right)