feat: adapt walks to new graph definition#7
Draft
BasilRohner wants to merge 2 commits into
Draft
Conversation
yzll0
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactor the walks and adapt to new graph definition.
Walks API
VertexSeq α: Non-empty sequence of vertices, inductively defined with asingletonbase case and a right-extendingcons.IsWalk : VertexSeq α → Prop: A predicate satisfied if consecutive vertices differ.Walk α: A bundle ofVertexSeqwith anIsWalkproof.VertexSeq α:append,reverse,dropHead,dropTail,takeUntil,dropUntil,loopErase.Walk.toPath,Walk.IsPath,Walk.IsCycle,Walk.rerootCycle.Design choices
IsWalkonly encodesw.tail ≠ u. Adjacency in a specific graph is deferred to downstream files so the same combinatorial API specialises later toSimpleGraph,DiGraph, multigraphs, etc.VertexSeqhas asingletonbase case rather than wrappingList, ruling out empty walks.lengththerefore counts edges with asingletonbeing of length0.cons:cons w uappendsuon the right, matching the left-to-right readingv₀, v₁, ..., vₙin literature.Walk: Data and validity travel together, so downstream lemmas don't threadIsWalkhypotheses by hand.grind-driven proofs: Most lemmas close bygrindor functional inductionfun_induction. Many definitions and constructors carry@[grind]to enable the heavy use of proof-automation in later formalization.Co-authored-by: Sorrachai Yingchareonthawornchai sorrachai.cp@gmail.com
Co-authored-by: Weixuan Yuan