Skip to content

feat(Combinatorics/Quiver/Schreier): word evaluation and reachability#38310

Open
ZRTMRH wants to merge 4 commits intoleanprover-community:masterfrom
ZRTMRH:schreier-word-eval
Open

feat(Combinatorics/Quiver/Schreier): word evaluation and reachability#38310
ZRTMRH wants to merge 4 commits intoleanprover-community:masterfrom
ZRTMRH:schreier-word-eval

Conversation

@ZRTMRH
Copy link
Copy Markdown
Contributor

@ZRTMRH ZRTMRH commented Apr 20, 2026

Adds word evaluation and reachability results to the Schreier graph API.

  • SchreierGraph.evalWord : evaluates a word List (S × Bool) as an element of the ambient group, where (s, true) contributes ι s and (s, false) contributes (ι s)⁻¹.
  • SchreierGraph.evalWord_eq_lift : agreement with FreeGroup.lift.
  • SchreierGraph.evalWord_mem_closure : every word evaluates into the subgroup generated by ι.
  • SchreierGraph.pathFromWord : a Bool-tagged word yields a path in Symmetrify (SchreierGraph V ι) from x to evalWord ι w • x.
  • SchreierGraph.reachable_iff : two vertices are connected by a path in the symmetrification iff some element of the subgroup closure carries one to the other.

Follow-up to #36320.

This PR was written with AI assistance (Claude). The code has been reviewed by the author.


Open in Gitpod

ZRTMRH added 4 commits April 20, 2026 14:53
Add `SchreierGraph.evalWord` — a list-based evaluation of words
(generators tagged with a forward/inverse bit) as elements of the
ambient group — together with basic rewriting lemmas, the link to
`FreeGroup.lift`, and membership in the subgroup generated by `ι`.

This is preparation for the path-from-word and reachability results
that follow in a subsequent PR.
Build on the word-evaluation API to construct paths in the symmetrified
Schreier graph from Bool-tagged words, and use this to characterise
reachability:

* `SchreierGraph.pathFromWord` — a word of generators/inverses gives a
  path in `Symmetrify (SchreierGraph V ι)` from `x` to `evalWord ι w • x`.
* `SchreierGraph.nonempty_path_of_mem_closure` — every element of the
  subgroup generated by `ι` is realised by such a path.
* `SchreierGraph.exists_mem_closure_of_path` — conversely, a path
  witnesses a closure element.
* `SchreierGraph.reachable_iff` — the iff packaging the two directions.
…struction

* Tag `evalWord_cons_true`/`evalWord_cons_false` as `@[simp]` and drop
  the now-redundant `evalWord_singleton_*` lemmas.
* Simplify `evalWord_append` using `cases b <;> simp`.
* Rewrite `pathFromWord` in term mode via `Path.cast`.
…oofs

* Tighten the section docstring for Reachability.
* Use `rcases` instead of `match ... with` inside the cons case of
  `exists_mem_closure_of_path`.
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Apr 20, 2026
@github-actions
Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Apr 20, 2026
@github-actions
Copy link
Copy Markdown

PR summary 79540a76d4

Import changes exceeding 2%

% File
+51.19% Mathlib.Combinatorics.Quiver.Schreier

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Combinatorics.Quiver.Schreier 295 446 +151 (+51.19%)
Import changes for all files
Files Import difference
Mathlib.Combinatorics.Quiver.Schreier 151

Declarations diff

+ evalWord
+ evalWord_append
+ evalWord_cons_false
+ evalWord_cons_true
+ evalWord_eq_lift
+ evalWord_mem_closure
+ evalWord_nil
+ exists_mem_closure_of_path
+ nonempty_path_of_mem_closure
+ pathFromWord
+ reachable_iff

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@github-actions github-actions bot added the t-combinatorics Combinatorics label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant