Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Combinatorics/Quiver/     Datei vom 15.10.2026 mit Größe 11 kB image not shown  

Quelle  Schreier.lean   Sprache: Lean

 

/-
Copyright (c) 2026 Runtian Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Runtian Zhou
-/

module

public import Mathlib.Combinatorics.Quiver.Covering
public import Mathlib.Combinatorics.Quiver.SingleObj
public import Mathlib.GroupTheory.FreeGroup.Basic

/-!
# Schreier Graphs

This module defines Schreier graphs as quivers with labelled edges.

Given a monoid `M` acting on a type `V` and a map `ι : S → M`, the Schreier graph has
vertices `V` and a directed edge `x → ι(s) • x` for each `x : V` and `s : S`.

## Main definitions

* `SchreierGraph V ι` - The Schreier graph of an action, with vertices of type `V` and edges
  labelled by elements of `S` via `ι : S → M`.
* `SchreierGraph.labelling` - The prefunctor from a Schreier graph to `SingleObj S` that
  extracts edge labels.
* `SchreierGraph.evalWord` - Evaluation of a word in generators and their inverses as an
  element of the ambient group, by lifting the corresponding element of the free group
  along `FreeGroup.lift`.
* `SchreierGraph.pathFromWord` - The path in the symmetrified Schreier graph induced by a
  word of generators (forward edges) and inverses (backward edges).

## Main results

* `SchreierGraph.labelling_isCovering` - The labelling prefunctor is a covering when we have
  a group action.
* `SchreierGraph.evalWord_mem_closure` - The evaluation of any word lies in the subgroup
  generated by the image of `ι`.
* `SchreierGraph.exists_evalWord_of_mem_closure` - Conversely, every element of that subgroup
  is the evaluation of some word.
* `SchreierGraph.reachable_iff` - Two vertices of a Schreier graph are connected by a path in
  its symmetrification iff they are related by an element of the subgroup generated by `ι`.

## Examples

* The (left) **Cayley graph** of a group `M` with generators `ι : S → M` is the Schreier graph
  where `V = M` and the action is left multiplication.

## Implementation notes

Although referred to informally as graphs, Schreier graphs have multiple, directed, labelled
edges between nodes and so are implemented here as quivers.

## References

* [Y. Vorobets, *Notes on the Schreier graphs of the Grigorchuk group*][Vorobets2012]
-/


@[expose] public section

namespace Quiver

/-- A Schreier graph for a monoid `M` acting on `V` with generators `ι : S → M`.
Vertices are elements of `V`, and there is an edge from `x` to `y` for each `s : S`
such that `ι s • x = y`. -/

@[nolint unusedArguments, ext]
structure SchreierGraph (V : Type*) {M : Type*} [SMul M V] {S : Type*} (_ι : S → M) where
  /-- Wraps a vertex of the acted-upon type into the Schreier graph. -/
  ofVertex ::
  /-- The underlying vertex. -/
  toVertex : V

namespace SchreierGraph

section Basic

variable (V : Type*) {M : Type*} [SMul M V] {S : Type*} (ι : S → M)

/-- Equivalence between the original vertex type and the Schreier graph type. -/
@[simps]
def equiv : V ≃ SchreierGraph V ι where
  toFun := SchreierGraph.ofVertex
  invFun := SchreierGraph.toVertex
  left_inv _ := rfl
  right_inv _ := rfl

/-- Transport the scalar multiplication to the Schreier graph vertices. -/
instance schreierGraphSMul : SMul M (SchreierGraph V ι) where
  smul x y := ⟨x • y.toVertex⟩

/-- The quiver structure on a Schreier graph. An arrow from `x` to `y` exists when
there is an `s : S` such that `(ι s) • x = y`. -/

instance schreierGraphQuiver : Quiver (SchreierGraph V ι) where
  Hom x y := { s : S // (ι s) • x = y }

/-- The labelling of arrows in a Schreier graph by elements of `S`.
This is encoded as a prefunctor to `SingleObj S`. -/

@[simps]
def labelling : SchreierGraph V ι ⥤q SingleObj S where
  obj _ := SingleObj.star S
  map e := e.val

end Basic

section MulAction

variable (V : Type*) {M : Type*} [Monoid M] [MulAction M V] {S : Type*} (ι : S → M)

/-- The monoid acts on the vertices of the Schreier graph. -/
instance : MulAction M (SchreierGraph V ι) where
  one_smul x := by
    ext
    exact one_smul M x.toVertex
  mul_smul a b x := by
    ext
    exact mul_smul a b x.toVertex

end MulAction

section GroupAction

/-!
### Schreier graphs for group actions

When we have a group action, the labelling becomes a covering.
-/


variable {V : Type*} {M : Type*} [Group M] [MulAction M V] {S : Type*} (ι : S → M)

/-- The star map of the labelling prefunctor as an equivalence. -/
@[simps]
def labellingStarEquiv (x : SchreierGraph V ι) :
    Quiver.Star x ≃ Quiver.Star (SingleObj.star S) where
  toFun := (labelling V ι).star x
  invFun := fun ⟨_, s⟩ => ⟨ι s • x, s, rfl⟩
  left_inv := fun ⟨_, _, rfl⟩ => rfl
  right_inv := fun ⟨_, _⟩ => rfl

/-- The costar map of the labelling prefunctor as an equivalence. -/
@[simps]
def labellingCostarEquiv (x : SchreierGraph V ι) :
    Quiver.Costar x ≃ Quiver.Costar (SingleObj.star S) where
  toFun := (labelling V ι).costar x
  invFun := fun ⟨_, s⟩ => ⟨(ι s)⁻¹ • x, s, by simp⟩
  left_inv := by
    rintro ⟨v, s, hs⟩
    simp only [Prefunctor.costar_apply, labelling_map]
    have : (ι s)⁻¹ • x = v := by rw [← hs, inv_smul_smul]
    subst this; rfl
  right_inv := fun ⟨_, _⟩ => rfl

/-- The labelling prefunctor is a covering for Schreier graphs with group actions. -/
theorem labelling_isCovering : (labelling V ι).IsCovering where
  star_bijective u := (labellingStarEquiv ι u).bijective
  costar_bijective u := (labellingCostarEquiv ι u).bijective

/-- If a prefunctor between Schreier graphs commutes with the labelling (i.e., labels are
preserved), then it commutes with the group action. In other words, morphisms that preserve edge
labels also preserve the group structure. -/

lemma map_smul_of_comp_labelling_eq {W : Type*} [MulAction M W]
    (φ : SchreierGraph V ι ⥤q SchreierGraph W ι) (φm : φ ⋙q labelling W ι = labelling V ι)
    (v : SchreierGraph V ι) (s : S) :
    φ.obj (ι s • v) = ι s • (φ.obj v) := by
  -- The key is that φ preserves labels, so edges labelled 's' stay labelled 's'
  let e : v ⟶ ι s • v := ⟨s, rfl⟩
  -- φ.map e is an edge from φ.obj v, and its label is preserved
  have h := (φ.map e).property
  -- This says: `ι (φ.map e).val • φ.obj v = φ.obj (ι s • v)`
  -- We need to show `(φ.map e).val = s`
  have label_eq : (φ.map e).val = s := by
    -- `φm` says `φ ⋙q labelling = labelling`
    -- So `(φ ⋙q labelling).map e = labelling.map e`
    have : (φ ⋙q labelling W ι).map e = (labelling V ι).map e := by
      rw [φm]
    simp only [Prefunctor.comp_map, labelling_map] at this
    exact this
  rw [label_eq] at h
  exact h.symm

end GroupAction

section evalWord

/-!
### Word evaluation

Evaluating a word (list of generators tagged with a boolean for forward/inverse direction)
as an element of the ambient group, by lifting it through the free group. Words are kept in
list form because `pathFromWord` recurses on the list: distinct words give distinct paths,
even when they evaluate to the same group element.
-/


variable {M : Type*} [Group M] {S : Type*} (ι : S → M)

/-- Evaluate a word `List (S × Bool)` as an element of the group `M`. A pair `(s, true)`
contributes `ι s`; a pair `(s, false)` contributes `(ι s)⁻¹`. -/

def evalWord (w : List (S × Bool)) : M := FreeGroup.lift ι (FreeGroup.mk w)

@[simp]
theorem evalWord_nil : evalWord ι [] = 1 := rfl

@[simp]
theorem evalWord_cons_true (s : S) (w : List (S × Bool)) :
    evalWord ι ((s, true) :: w) = ι s * evalWord ι w := rfl

@[simp]
theorem evalWord_cons_false (s : S) (w : List (S × Bool)) :
    evalWord ι ((s, false) :: w) = (ι s)⁻¹ * evalWord ι w := rfl

theorem evalWord_append (w₁ w₂ : List (S × Bool)) :
    evalWord ι (w₁ ++ w₂) = evalWord ι w₁ * evalWord ι w₂ := by
  rw [evalWord, ← FreeGroup.mul_mk, map_mul]; rfl

/-- The evaluation of any word lies in the subgroup generated by the image of `ι`. -/
theorem evalWord_mem_closure (w : List (S × Bool)) :
    evalWord ι w ∈ Subgroup.closure (Set.range ι) := by
  rw [← FreeGroup.range_lift_eq_closure]
  exact ⟨FreeGroup.mk w, rfl⟩

/-- Every element of the subgroup generated by the image of `ι` is the evaluation of a word. -/
theorem exists_evalWord_of_mem_closure {g : M} (hg : g ∈ Subgroup.closure (Set.range ι)) :
    ∃ w : List (S × Bool), evalWord ι w = g := by
  rw [← FreeGroup.range_lift_eq_closure] at hg
  obtain ⟨x, rfl⟩ := hg
  obtain ⟨w, rfl⟩ := Quot.exists_rep x
  exact ⟨w, rfl⟩

end evalWord

section Reachability

/-!
### Reachability in symmetrified Schreier graphs

Reachability in the symmetrified Schreier graph characterises the orbit of the subgroup
generated by `ι`.
-/


variable {V : Type*} {M : Type*} [Group M] [MulAction M V] {S : Type*} (ι : S → M)

/-- Construct a path in the symmetrified Schreier graph from a Bool-tagged word.
A pair `(s, true)` contributes a forward edge for `ι s`; `(s, false)` contributes a backward
edge, representing motion along `(ι s)⁻¹`. -/

def pathFromWord (x : SchreierGraph V ι) : ∀ w : List (S × Bool),
    Path (Symmetrify.of.obj x) (Symmetrify.of.obj (evalWord ι w • x))
  | [] => Path.nil.cast rfl (one_smul M x).symm
  | (s, true) :: w =>
      ((pathFromWord x w).cons <| .inl ⟨s, rfl⟩).cast rfl
        (mul_smul (ι s) (evalWord ι w) x).symm
  | (s, false) :: w =>
      let edge : ((ι s)⁻¹ • (evalWord ι w • x) : SchreierGraph V ι) ⟶ evalWord ι w • x :=
        ⟨s, by simp [← mul_smul]⟩
      ((pathFromWord x w).cons <| .inr edge).cast rfl
        (mul_smul (ι s)⁻¹ (evalWord ι w) x).symm

/-- If `g` lies in the subgroup generated by the image of `ι`, then `g • y` is reachable from
`y` in the symmetrification, for every vertex `y` of the Schreier graph. -/

theorem reachable_of_mem_closure {g : M} (hg : g ∈ Subgroup.closure (Set.range ι))
    (y : SchreierGraph V ι) :
    Reachable (Symmetrify.of.obj y) (Symmetrify.of.obj (g • y)) := by
  obtain ⟨w, rfl⟩ := exists_evalWord_of_mem_closure ι hg
  exact ⟨pathFromWord ι y w⟩

/-- A path in the symmetrified Schreier graph exhibits an element of the subgroup generated by
`ι` that carries the source to the target. -/

theorem exists_mem_closure_of_path {x : SchreierGraph V ι}
    {y : Symmetrify (SchreierGraph V ι)}
    (p : Path (Symmetrify.of.obj x) y) :
    ∃ g ∈ Subgroup.closure (Set.range ι), g • x = y := by
  induction p with
  | nil => exact ⟨1, Subgroup.one_mem _, one_smul M x⟩
  | cons _ e ih =>
    obtain ⟨g, hg_mem, hg_smul⟩ := ih
    rcases e with ⟨s, hs⟩ | ⟨s, hs⟩
    · refine ⟨ι s * g, ?_, ?_⟩
      · exact Subgroup.mul_mem _ (Subgroup.subset_closure (Set.mem_range_self s)) hg_mem
      · rw [mul_smul, hg_smul, hs]
    · refine ⟨(ι s)⁻¹ * g, ?_, ?_⟩
      · exact Subgroup.mul_mem _
          (Subgroup.inv_mem _ (Subgroup.subset_closure (Set.mem_range_self s))) hg_mem
      · rw [mul_smul, hg_smul, ← hs]
        exact inv_smul_smul _ _

/-- Two vertices of a Schreier graph are connected by a path in the symmetrified quiver iff
some element of the subgroup generated by `ι` carries one to the other. -/

theorem reachable_iff (x y : SchreierGraph V ι) :
    Reachable (Symmetrify.of.obj x) (Symmetrify.of.obj y) ↔
    ∃ g ∈ Subgroup.closure (Set.range ι), g • x = y := by
  refine ⟨fun ⟨p⟩ => exists_mem_closure_of_path ι p, ?_⟩
  rintro ⟨g, hg_mem, rfl⟩
  exact reachable_of_mem_closure ι hg_mem x

end Reachability

end SchreierGraph

end Quiver

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.10 Sekunden  ¤

*© Formatika GbR, Deutschland