Module

Script.lean

Nyll.ProCGroups.ReidemeisterSchreier.Discrete.Presentations.Tietze.Script
29 declarations indexed from sourceView source ↗

Verified Tietze move scripts

ElementaryTietzeMove records genuine presentation transformations with indexed source and target presentations. VerifiedTietzeScript is the typed sequence of those moves; it evaluates to a semantic PresentationEquivCertificate and exposes an inspectable trace, move count, and weighted cost.

Semantic equivalence constructors live in the Tietze core and operation modules. They are not re-exported here as a parallel family of “script” wrappers.

Declarations

ReidemeisterSchreier.Discrete.Presentations.ElementaryTietzeMove

An inspectable, indexed Tietze move whose endpoints are determined by the mathematical construction which produces its semantic certificate.

In particular, the generator moves do not accept an equivalence or a desired conclusion as an extra field: their certificates are computed from the generator-adjunction and generator-elimination constructions in this library.

Source context 2 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
inductive ElementaryTietzeMove :
    Presentation.{u} → Presentation.{u} → Type (u + 1) where
  /-- Replace a relator set by another set generating the same normal closure. -/
  | replaceRelators
      {X : Type u} {R S : Set (FreeGroup X)}
      (hR_to_S : ∀ r ∈ R, RelatorEquivalent S r 1)
      (hS_to_R : ∀ s ∈ S, RelatorEquivalent R s 1) :
      ElementaryTietzeMove
        (Presentation.ofRelators R) (Presentation.ofRelators S)
  /-- Rename every generator through an equivalence of generator types. -/
  | renameGenerators
      {X Y : Type u} (R : Set (FreeGroup X)) (e : X ≃ Y) :
      ElementaryTietzeMove
        (Presentation.ofRelators R)
        (Presentation.ofRelators (FreeGroup.freeGroupCongr e '' R))
  /-- Adjoin generators together with relators identifying them with prescribed words. -/
  | adjoinGenerators
      {X Y : Type u} (R : Set (FreeGroup X)) (word : Y → FreeGroup X) :
      ElementaryTietzeMove
        (Presentation.ofRelators R)
        (Presentation.ofRelators (Presented.adjoinGeneratorsRelators R word))
  /-- Eliminate a family of generators by substituting their defining words. -/
  | substituteDefinedGenerators
      {X Y : Type u} (R : Set (FreeGroup (Sum X Y)))
      (word : Y → FreeGroup X) :
      ElementaryTietzeMove
        (Presentation.ofRelators
          (Presented.relatorsWithDefinedGenerators R word))
        (Presentation.ofRelators
          (Presented.relatorsAfterSubstitutingDefinedGenerators R word))
  /-- Delete a family of generators whose defining relators make them trivial. -/
  | deleteTrivialGenerators
      {X Y : Type u} (R : Set (FreeGroup (Sum X Y))) :
      ElementaryTietzeMove
        (Presentation.ofRelators (Presented.relatorsWithTrivialGenerators R))
        (Presentation.ofRelators
          (Presented.relatorsAfterDeletingTrivialGenerators R))
  /--
  Transport to a sum decomposition of the generator type and then substitute the defining words.
  -/
  | substituteDefinedGeneratorsAlongEquiv
      {Z X Y : Type u} (R : Set (FreeGroup Z)) (e : Z ≃ Sum X Y)
      (word : Y → FreeGroup X) :
      ElementaryTietzeMove
        (Presentation.ofRelators
          (Presented.relatorsWithDefinedGeneratorsAlongEquiv R e word))
        (Presentation.ofRelators
          (Presented.relatorsAfterSubstitutingDefinedGeneratorsAlongEquiv R e word))
  /-- Transport to a sum decomposition and then delete the generators made trivial by relators. -/
  | deleteTrivialGeneratorsAlongEquiv
      {Z X Y : Type u} (R : Set (FreeGroup Z)) (e : Z ≃ Sum X Y) :
      ElementaryTietzeMove
        (Presentation.ofRelators
          (Presented.relatorsWithTrivialGeneratorsAlongEquiv R e))
        (Presentation.ofRelators
          (Presented.relatorsAfterDeletingTrivialGeneratorsAlongEquiv R e))
inductive

Kind

L94 ↗
ReidemeisterSchreier.Discrete.Presentations.ElementaryTietzeMove.Kind

Stable tags for script traces and cost functions.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace ElementaryTietzeMove
inductive Kind where
  /-- A relator-set replacement. -/
  | replaceRelators
  /-- A renaming of generators. -/
  | renameGenerators
  /-- An adjunction of generators with defining relators. -/
  | adjoinGenerators
  /-- A substitution eliminating generators with specified defining words. -/
  | substituteDefinedGenerators
  /-- A deletion of generators made trivial by their defining relators. -/
  | deleteTrivialGenerators
deriving DecidableEq, Repr
ReidemeisterSchreier.Discrete.Presentations.ElementaryTietzeMove.kind

Inspect the mathematical kind of an elementary move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace ElementaryTietzeMove
def kind {P Q : Presentation.{u}} : ElementaryTietzeMove P Q → Kind
  | .replaceRelators _ _ => .replaceRelators
  | .renameGenerators _ _ => .renameGenerators
  | .adjoinGenerators _ _ => .adjoinGenerators
  | .substituteDefinedGenerators _ _ => .substituteDefinedGenerators
  | .deleteTrivialGenerators _ => .deleteTrivialGenerators
  | .substituteDefinedGeneratorsAlongEquiv _ _ _ => .substituteDefinedGenerators
  | .deleteTrivialGeneratorsAlongEquiv _ _ => .deleteTrivialGenerators
ReidemeisterSchreier.Discrete.Presentations.ElementaryTietzeMove.toCertificate

Evaluate one indexed move using its source-producing semantic construction.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace ElementaryTietzeMove
def toCertificate {P Q : Presentation.{u}}
    (m : ElementaryTietzeMove P Q) : PresentationEquivCertificate P Q
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript

A well-typed sequence of genuine Tietze moves. The indexed intermediate presentations make an ill-typed move chain unrepresentable.

Source context 2 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
inductive VerifiedTietzeScript :
    Presentation.{u} → Presentation.{u} → Type (u + 1) where
  /-- The empty script at a presentation. -/
  | nil (P : Presentation.{u}) : VerifiedTietzeScript P P
  /-- Prepend an elementary move to a verified script beginning at its target presentation. -/
  | cons {P Q R : Presentation.{u}}
      (head : ElementaryTietzeMove P Q)
      (tail : VerifiedTietzeScript Q R) : VerifiedTietzeScript P R
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.singleton

A one-move verified script.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def singleton {P Q : Presentation.{u}} (m : ElementaryTietzeMove P Q) :
    VerifiedTietzeScript P Q
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.replaceRelators

A verified relator-replacement move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def replaceRelators
    {X : Type u} {R S : Set (FreeGroup X)}
    (hR_to_S : ∀ r ∈ R, RelatorEquivalent S r 1)
    (hS_to_R : ∀ s ∈ S, RelatorEquivalent R s 1) :
    VerifiedTietzeScript
      (Presentation.ofRelators R) (Presentation.ofRelators S)
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.renameGenerators

Rename the complete generator family by an equivalence.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def renameGenerators
    {X Y : Type u} (R : Set (FreeGroup X)) (e : X ≃ Y) :
    VerifiedTietzeScript
      (Presentation.ofRelators R)
      (Presentation.ofRelators (FreeGroup.freeGroupCongr e '' R))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.adjoinGenerators

Adjoin a family of generators together with the defining words which make the extension a Tietze equivalence.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def adjoinGenerators
    {X Y : Type u} (R : Set (FreeGroup X)) (word : Y → FreeGroup X) :
    VerifiedTietzeScript
      (Presentation.ofRelators R)
      (Presentation.ofRelators (Presented.adjoinGeneratorsRelators R word))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.substituteDefinedGenerators

Eliminate a family of generators whose defining words have been included in the relator family.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def substituteDefinedGenerators
    {X Y : Type u} (R : Set (FreeGroup (Sum X Y)))
    (word : Y → FreeGroup X) :
    VerifiedTietzeScript
      (Presentation.ofRelators (Presented.relatorsWithDefinedGenerators R word))
      (Presentation.ofRelators
        (Presented.relatorsAfterSubstitutingDefinedGenerators R word))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.deleteTrivialGenerators

Delete a family of generators carrying the relators y = 1.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def deleteTrivialGenerators
    {X Y : Type u} (R : Set (FreeGroup (Sum X Y))) :
    VerifiedTietzeScript
      (Presentation.ofRelators (Presented.relatorsWithTrivialGenerators R))
      (Presentation.ofRelators (Presented.relatorsAfterDeletingTrivialGenerators R))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.substituteDefinedGeneratorsAlongEquiv

Eliminate a family of defined generators after an explicit splitting of an arbitrary generator type.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def substituteDefinedGeneratorsAlongEquiv
    {Z X Y : Type u} (R : Set (FreeGroup Z)) (e : Z ≃ Sum X Y)
    (word : Y → FreeGroup X) :
    VerifiedTietzeScript
      (Presentation.ofRelators
        (Presented.relatorsWithDefinedGeneratorsAlongEquiv R e word))
      (Presentation.ofRelators
        (Presented.relatorsAfterSubstitutingDefinedGeneratorsAlongEquiv R e word))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.deleteTrivialGeneratorsAlongEquiv

Delete trivial generators after an explicit splitting of an arbitrary generator type.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def deleteTrivialGeneratorsAlongEquiv
    {Z X Y : Type u} (R : Set (FreeGroup Z)) (e : Z ≃ Sum X Y) :
    VerifiedTietzeScript
      (Presentation.ofRelators
        (Presented.relatorsWithTrivialGeneratorsAlongEquiv R e))
      (Presentation.ofRelators
        (Presented.relatorsAfterDeletingTrivialGeneratorsAlongEquiv R e))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.deleteTrivialGeneratorsOfPredicate

Delete exactly the generators selected by a decidable predicate.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def deleteTrivialGeneratorsOfPredicate
    {Z : Type u} (R : Set (FreeGroup Z)) (delete : Z → Prop)
    [DecidablePred delete] :
    VerifiedTietzeScript
      (Presentation.ofRelators
        (Presented.relatorsWithTrivialGeneratorsOfPredicate R delete))
      (Presentation.ofRelators
        (Presented.relatorsAfterDeletingTrivialGeneratorsOfPredicate R delete))
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.trans

Concatenate two verified scripts.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def trans {P Q R : Presentation.{u}}
    (s : VerifiedTietzeScript P Q) (t : VerifiedTietzeScript Q R) :
    VerifiedTietzeScript P R
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.toCertificate

Evaluate a complete move sequence to its semantic certificate.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def toCertificate {P Q : Presentation.{u}}
    (s : VerifiedTietzeScript P Q) : PresentationEquivCertificate P Q
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.trace

The inspectable sequence of move kinds.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def trace {P Q : Presentation.{u}}
    (s : VerifiedTietzeScript P Q) : List ElementaryTietzeMove.Kind
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.moveCount

The number of elementary moves in a verified script.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def moveCount {P Q : Presentation.{u}} (s : VerifiedTietzeScript P Q) : ℕ
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.cost

A customizable additive script cost.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
def cost {P Q : Presentation.{u}}
    (s : VerifiedTietzeScript P Q)
    (weight : ElementaryTietzeMove.Kind → ℕ) : ℕ
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.trace_nil

The empty verified script has an empty move trace.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem trace_nil (P : Presentation.{u}) :
    (VerifiedTietzeScript.nil P).trace = []
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.trace_cons

The trace of a script begins with the kind of its head move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem trace_cons
    {P Q R : Presentation.{u}} (head : ElementaryTietzeMove P Q)
    (tail : VerifiedTietzeScript Q R) :
    (VerifiedTietzeScript.cons head tail).trace = head.kind :: tail.trace
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.trace_singleton

A singleton script records exactly the kind of its sole move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem trace_singleton
    {P Q : Presentation.{u}} (move : ElementaryTietzeMove P Q) :
    (singleton move).trace = [move.kind]
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.moveCount_nil

The empty verified script contains no moves.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem moveCount_nil (P : Presentation.{u}) :
    (VerifiedTietzeScript.nil P).moveCount = 0
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.moveCount_cons

Prepending a move increases the length of a verified script by one.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem moveCount_cons
    {P Q R : Presentation.{u}} (head : ElementaryTietzeMove P Q)
    (tail : VerifiedTietzeScript Q R) :
    (VerifiedTietzeScript.cons head tail).moveCount = tail.moveCount + 1
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.moveCount_singleton

A singleton verified script contains one move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem moveCount_singleton
    {P Q : Presentation.{u}} (move : ElementaryTietzeMove P Q) :
    (singleton move).moveCount = 1
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.moveCount_trans

Concatenating verified scripts adds their move counts.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem moveCount_trans
    {P Q R : Presentation.{u}} (s : VerifiedTietzeScript P Q)
    (t : VerifiedTietzeScript Q R) :
    (s.trans t).moveCount = s.moveCount + t.moveCount
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.cost_nil

The empty verified script has zero cost for every weighting.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem cost_nil
    (weight : ElementaryTietzeMove.Kind → ℕ) (P : Presentation.{u}) :
    (VerifiedTietzeScript.nil P).cost weight = 0
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.cost_cons

The cost of a nonempty script is the head move's weight plus the tail cost.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem cost_cons
    (weight : ElementaryTietzeMove.Kind → ℕ)
    {P Q R : Presentation.{u}} (head : ElementaryTietzeMove P Q)
    (tail : VerifiedTietzeScript Q R) :
    (VerifiedTietzeScript.cons head tail).cost weight =
      weight head.kind + tail.cost weight
ReidemeisterSchreier.Discrete.Presentations.VerifiedTietzeScript.cost_singleton

The cost of a singleton script is the weight assigned to its sole move.

Source context 3 commands

Surrounding namespaces, section variables, and local commands at this declaration.

universe u
namespace ReidemeisterSchreier.Discrete.Presentations
namespace VerifiedTietzeScript
theorem cost_singleton
    (weight : ElementaryTietzeMove.Kind → ℕ)
    {P Q : Presentation.{u}} (move : ElementaryTietzeMove P Q) :
    (singleton move).cost weight = weight move.kind