Skip to content

feat(Combinatorics/SimpleGraph): The Cayley graph for structures with Mul/Add#35084

Open
edegeltje wants to merge 11 commits intoleanprover-community:masterfrom
edegeltje:cayley_graph
Open

feat(Combinatorics/SimpleGraph): The Cayley graph for structures with Mul/Add#35084
edegeltje wants to merge 11 commits intoleanprover-community:masterfrom
edegeltje:cayley_graph

Conversation

@edegeltje
Copy link
Collaborator

@edegeltje edegeltje commented Feb 10, 2026

This pr:

  • adds the definition SimpleGraph.mulCayley, defining the simple graph induced by a Mul instance,
  • proves various lemmas about the above,
  • adds/proves the additive versions of all of the above,
  • redefines SimpleGraph.circulantGraph to use addCayley,
  • reproves lemmas about circulantGraph to use the new addCayley lemmas.

some related zulip conversation: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Cayley.20and.20circulant.20graph/with/572839048


Open in Gitpod

@github-actions github-actions bot added the t-combinatorics Combinatorics label Feb 10, 2026
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

PR summary d1366e1a1a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Combinatorics.SimpleGraph.Cayley (new file) 520

Declarations diff

+ instance [Group G] [DecidableEq G] [DecidablePred (· ∈ s)] : DecidableRel (mulCayley s).Adj
+ instance [Mul G] [Fintype G] [DecidableEq G] [DecidablePred (· ∈ s)] :
+ mulCayley
+ mulCayley_adj
+ mulCayley_adj'
+ mulCayley_adj_mul_left_iff
+ mulCayley_compl_singleton_one
+ mulCayley_empty
+ mulCayley_eq_erase_one
+ mulCayley_eq_symm
+ mulCayley_eq_union_one
+ mulCayley_mono
+ mulCayley_singleton_one
+ mulCayley_univ

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).

@[to_additive (attr := simp)]
lemma mulCayley_adj' [Mul G] (u v : G) :
(mulCayley s).Adj u v ↔ u ≠ v ∧ ∃ g ∈ s, (u * g = v ∨ u = v * g) := by
simp only [mulCayley, fromRel_adj, ne_eq, and_congr_right_iff]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does unfold mulCayley; grind or unfold mulCayley; aesop work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, the aesop version works... but i prefer not to use hammers. Is it ok that i changed it to a one-liner using simp instead?

@edegeltje edegeltje requested a review from vihdzp February 11, 2026 16:53
vlad902 added a commit to vlad902/mathlib4 that referenced this pull request Feb 13, 2026
Right now the `cycleGraph` definition relies on `circulantGraph` which
requires importing Group definitions from the algebra hierarchy. This
causes large-imports for me in later PRs where I try to make more
widespread use of cycleGraphs, so here I redefine it to be its own
independent object, and leave splitting it from `circulantGraph` to
another PR (this is parallel to leanprover-community#35084.)
vlad902 added a commit to vlad902/mathlib4 that referenced this pull request Feb 13, 2026
Right now the `cycleGraph` definition relies on `circulantGraph` which
requires importing Group definitions from the algebra hierarchy. This
causes large-imports for me in later PRs where I try to make more
widespread use of cycleGraphs, so here I redefine it to be its own
independent object, and leave splitting it from `circulantGraph` to
another PR (this is parallel to leanprover-community#35084.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants