Skip to content

refactor(Combinatorics): move Walk from SimpleGraph to HasAdj (and refactor)#35777

Closed
IvanRenison wants to merge 12 commits intoleanprover-community:masterfrom
IvanRenison:HasAdj.Walk
Closed

refactor(Combinatorics): move Walk from SimpleGraph to HasAdj (and refactor)#35777
IvanRenison wants to merge 12 commits intoleanprover-community:masterfrom
IvanRenison:HasAdj.Walk

Conversation

@IvanRenison
Copy link
Collaborator

@IvanRenison IvanRenison commented Feb 25, 2026

@IvanRenison IvanRenison added the WIP Work in progress label Feb 25, 2026
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

PR summary 9b809f3970

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
60 files Mathlib.Combinatorics.Additive.Corner.Roth Mathlib.Combinatorics.Extremal.RuzsaSzemeredi Mathlib.Combinatorics.SimpleGraph.Acyclic Mathlib.Combinatorics.SimpleGraph.AdjMatrix Mathlib.Combinatorics.SimpleGraph.Bipartite Mathlib.Combinatorics.SimpleGraph.Circulant Mathlib.Combinatorics.SimpleGraph.Clique Mathlib.Combinatorics.SimpleGraph.Coloring Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite Mathlib.Combinatorics.SimpleGraph.ConcreteColorings Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected Mathlib.Combinatorics.SimpleGraph.Connectivity.EdgeConnectivity Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkCounting Mathlib.Combinatorics.SimpleGraph.Connectivity.WalkDecomp Mathlib.Combinatorics.SimpleGraph.Copy Mathlib.Combinatorics.SimpleGraph.Dart Mathlib.Combinatorics.SimpleGraph.DegreeSum Mathlib.Combinatorics.SimpleGraph.DeleteEdges Mathlib.Combinatorics.SimpleGraph.Diam Mathlib.Combinatorics.SimpleGraph.EdgeLabeling Mathlib.Combinatorics.SimpleGraph.Ends.Defs Mathlib.Combinatorics.SimpleGraph.Ends.Properties Mathlib.Combinatorics.SimpleGraph.Extremal.Basic Mathlib.Combinatorics.SimpleGraph.Extremal.TuranDensity Mathlib.Combinatorics.SimpleGraph.Extremal.Turan Mathlib.Combinatorics.SimpleGraph.Finite Mathlib.Combinatorics.SimpleGraph.Finsubgraph Mathlib.Combinatorics.SimpleGraph.FiveWheelLike Mathlib.Combinatorics.SimpleGraph.Girth Mathlib.Combinatorics.SimpleGraph.Hall Mathlib.Combinatorics.SimpleGraph.Hamiltonian Mathlib.Combinatorics.SimpleGraph.Hasse Mathlib.Combinatorics.SimpleGraph.IncMatrix Mathlib.Combinatorics.SimpleGraph.LapMatrix Mathlib.Combinatorics.SimpleGraph.Maps Mathlib.Combinatorics.SimpleGraph.Matching Mathlib.Combinatorics.SimpleGraph.Metric Mathlib.Combinatorics.SimpleGraph.Operations Mathlib.Combinatorics.SimpleGraph.Partition Mathlib.Combinatorics.SimpleGraph.Paths Mathlib.Combinatorics.SimpleGraph.Prod Mathlib.Combinatorics.SimpleGraph.StronglyRegular Mathlib.Combinatorics.SimpleGraph.Subgraph Mathlib.Combinatorics.SimpleGraph.Sum Mathlib.Combinatorics.SimpleGraph.Trails Mathlib.Combinatorics.SimpleGraph.Triangle.Basic Mathlib.Combinatorics.SimpleGraph.Triangle.Counting Mathlib.Combinatorics.SimpleGraph.Triangle.Removal Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite Mathlib.Combinatorics.SimpleGraph.Tutte Mathlib.Combinatorics.SimpleGraph.UnitDistance.Basic Mathlib.Combinatorics.SimpleGraph.UniversalVerts Mathlib.Combinatorics.SimpleGraph.VertexCover Mathlib.Combinatorics.SimpleGraph.Walks.Basic Mathlib.Combinatorics.SimpleGraph.Walks.Maps Mathlib.Combinatorics.SimpleGraph.Walks.Operations Mathlib.Combinatorics.SimpleGraph.Walks.Subwalks Mathlib.Combinatorics.SimpleGraph.Walks.Traversal
3
Mathlib.Combinatorics.HasAdj.Basic (new file) 214
Mathlib.Combinatorics.HasAdj.Walk (new file) 344
Mathlib.Combinatorics.HasAdj.Dart (new file) 491
Mathlib.Combinatorics.Digraph.HasAdj (new file) 502
Mathlib.Combinatorics.SimpleGraph.HasAdj (new file) 524

Declarations diff

+ Adj.left_mem_verts
+ Adj.right_mem_verts
+ HasAdj
+ IsNil
+ IsNil.exist_nil
+ IsNil.head_eq_last
+ IsNil.mem_support_iff_eq_head
+ IsNil.mem_support_iff_eq_last
+ IsNil.support_eq_head
+ IsNil.support_eq_last
+ Walk
+ _root_.HasAdj.Adj.adj_toWalk_head_last
+ _root_.HasAdj.Adj.head_toWalk
+ _root_.HasAdj.Adj.last_toWalk
+ _root_.HasAdj.Adj.length_toWalk
+ _root_.HasAdj.Adj.support_toWalk
+ _root_.HasAdj.Adj.toWalk
+ _root_.HasAdj.Dart.edge_fiber
+ adj_head_last_of_length_eq_one
+ cons
+ exists_eq_cons_of_not_nil
+ ext_iff
+ head
+ head_cons
+ head_eq_last_of_length_eq_zero
+ head_mem_support
+ head_mem_verts
+ head_nil
+ ind
+ instance : HasAdj α (Digraph α)
+ instance : HasAdj α (SimpleGraph α)
+ instance [DecidableEq α] (G : Gr) : DecidableEq (Dart G)
+ isChain_adj_cons_support
+ isNil_nil
+ last
+ last_cons
+ last_mem_support
+ last_mem_verts
+ last_nil
+ length
+ length_cons
+ length_eq_one_iff_support_eq_head_last
+ length_eq_two'
+ length_eq_zero_iff_isNil
+ length_eq_zero_iff_support_eq_singleton
+ length_nil
+ length_pos_ifff_not_nil
+ length_support_pos
+ mem_support_nil_iff
+ nil
+ support_cons
+ support_nil
+ support_nonempty
+ support_subset_support_cons
- Dart.edge_fiber
- Dart.fst_ne_snd
- Dart.snd_ne_fst

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for scripts/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib-dependent-issues mathlib-dependent-issues bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Feb 25, 2026
Copy link
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Walk should be changed away from the current inductive definition.

@IvanRenison
Copy link
Collaborator Author

Simply using the recursive version in #35831

@IvanRenison IvanRenison changed the title refactor(Combinatorics): move Walk from SimpleGraph to HasAdj refactor(Combinatorics): move Walk from SimpleGraph to HasAdj (and refactor) Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants