FenchelNielsenZomorrodian.Discrete.CompactFuchsian.FirstReduction.TransportMaps

39 Theorem | 14 Definition | 1 Abbreviation

This module develops the rewriting and basis constructions behind the subgroup calculations. It tracks words and relations through the chosen transversal to obtain the required presentation or basis statements.

import
Imported by

Declarations

noncomputable abbrev firstReductionCanonicalSchreierRelatorSet
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let hT :=
      firstReductionCanonicalSchreierTransversal_isRightSchreierTransversal
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    Set (FreeGroup ↥(schreierGeneratorSet hT)) :=
  by
    classical
    exact
      ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet
        (firstReductionCanonicalSchreierBasisEquiv
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
        (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
          (f := ellipticQuotientGeneratorImage
            (firstReductionCanonicalSourceSignature
              m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
            (firstReductionCanonicalSourceQuotientImage
              m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
          (rels := relators
            (firstReductionCanonicalSourceSignature
              m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
          (firstReductionCanonicalSchreierTransversal
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))

The Schreier relator set for the canonical first-reduction kernel presentation.

private theorem firstReductionCanonicalSchreier_nonwrapTotalRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin (p - 1)) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_wrapTotalRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_nonwrapGeneratorElimination_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin (p - 1)) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_wrapGeneratorElimination_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalTarget_totalRelation_inverseRotated_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    let τ

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
noncomputable def firstReductionCanonicalTargetTailBlockWord
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    Fin p → FreeGroup (FuchsianGenerator τ) := by
  classical
  dsimp
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  intro k
  exact
    (List.ofFn (fun j : Fin tailLen =>
      xWord τ
        (firstReductionCanonicalTargetTailIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen k j))).prod

The first-reduction canonical target tail-block word is the displayed product over the tail block.

noncomputable def firstReductionCanonicalSecondEdgeForwardWord
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    Fin p → FreeGroup (FuchsianGenerator τ) := by
  classical
  dsimp
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let A :=
    xWord τ
      (firstReductionCanonicalTargetZeroIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  let block :=
    firstReductionCanonicalTargetTailBlockWord
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  intro k
  if h0 : k.val = 0 then
    exact block ⟨p - 1, by omega⟩ * A
  else
    exact block ⟨k.val - 1, by omega⟩

The first-reduction second-edge forward word associated with an index.

noncomputable def firstReductionCanonicalSchreierToTargetGeneratorImage
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let hT :=
      firstReductionCanonicalSchreierTransversal_isRightSchreierTransversal
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    ↥(schreierGeneratorSet hT) → FreeGroup (FuchsianGenerator τ) := by
  classical
  dsimp
  letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
  let σ :=
    firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
  let φ :=
    firstReductionCanonicalSourceFreeQuotientHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let hT :=
    firstReductionCanonicalSchreierTransversal_isRightSchreierTransversal
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let A :=
    xWord τ
      (firstReductionCanonicalTargetZeroIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  let secondWord :=
    firstReductionCanonicalSecondEdgeForwardWord
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  intro z
  if hFirst :
      (z : φ.ker) =
        firstReductionCanonicalFirstPowerKernel
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen then
    exact A⁻¹
  else if hSecond :
      ∃ k : Fin p,
        (z : φ.ker) =
          firstReductionCanonicalSecondEdgeKernelElement
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen k then
    exact secondWord (Classical.choose hSecond)
  else if hTail :
      ∃ j : Fin tailLen, ∃ k : Fin p,
        (z : φ.ker) =
          firstReductionCanonicalTailKernelElement
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen j k then
    let j : Fin tailLen := Classical.choose hTail
    let hk : ∃ k : Fin p,
        (z : φ.ker) =
          firstReductionCanonicalTailKernelElement
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen j k :=
      Classical.choose_spec hTail
    let k : Fin p := Classical.choose hk
    exact
      (xWord τ
        (firstReductionCanonicalTargetTailIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen k j))⁻¹
  else
    exact 1

Evaluating the first-reduction Schreier word through the chosen transversal gives the prescribed target word.

noncomputable def firstReductionCanonicalSchreierToTargetHom
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let hT :=
      firstReductionCanonicalSchreierTransversal_isRightSchreierTransversal
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    FreeGroup ↥(schreierGeneratorSet hT) →* FreeGroup (FuchsianGenerator τ) :=
  FreeGroup.lift
    (firstReductionCanonicalSchreierToTargetGeneratorImage
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)

The homomorphism from the canonical Schreier presentation to the first-reduction target presentation.

private theorem firstReductionCanonicalSchreierToTargetHom_firstPowerWord
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The Schreier-to-target transport homomorphism sends the first-power word to the prescribed target word.

Show proof
private theorem firstReductionCanonicalSchreierToTargetHom_tailWord
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (j : Fin tailLen) (k : Fin p) :
    letI : NeZero p

The Schreier-to-target transport homomorphism sends the tail word to the prescribed target word.

Show proof
private theorem firstReductionCanonicalSchreierToTargetHom_secondEdgeWord
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) :
    letI : NeZero p

The Schreier-to-target transport homomorphism sends the second-edge word to the prescribed target word.

Show proof
private theorem firstReductionCanonicalSchreier_cyclicBlockTotalProduct_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalTarget_totalRelation_image_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalTarget_mapsRelators_of_power_and_total
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    {G : Type*} [Group G] {S : Set G}
    (η :
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      FreeGroup (FuchsianGenerator τ) →* G)
    (hPower :
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ i : Fin τ.numPeriods,
        η ((xWord τ i) ^ τ.periods i) ∈ Subgroup.normalClosure S)
    (hTotal :
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      η (totalRelation τ) ∈ Subgroup.normalClosure S) :
    let τ

The target map satisfies the required power relators and the total relator.

Show proof
noncomputable def firstReductionCanonicalTargetToSchreierGeneratorImage
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let φ :=
      firstReductionCanonicalSourceFreeQuotientHom
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let x : FuchsianGenerator σ :=
      FuchsianGenerator.elliptic
        (firstReductionCanonicalSourceZeroIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
    let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
      simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
    let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
    let hT : IsRightSchreierTransversal φ.ker T :=
      cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
    FuchsianGenerator τ → FreeGroup ↥(schreierGeneratorSet hT) := by
  classical
  dsimp
  letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
  let σ :=
    firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let φ :=
    firstReductionCanonicalSourceFreeQuotientHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let x : FuchsianGenerator σ :=
    FuchsianGenerator.elliptic
      (firstReductionCanonicalSourceZeroIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  let y : FuchsianGenerator σ :=
    FuchsianGenerator.elliptic
      (firstReductionCanonicalSourceOneIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  let tailGen : Fin tailLen → FuchsianGenerator σ := fun j =>
    FuchsianGenerator.elliptic
      (firstReductionCanonicalSourceTailIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen j)
  have hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
    simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
  let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
  let hT : IsRightSchreierTransversal φ.ker T :=
    cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
  let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
    freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
  let a : φ.ker := ⟨(FreeGroup.of x) ^ p, by
    rw [MonoidHom.mem_ker, map_pow, hx]
    apply (Multiplicative.toAdd : Multiplicative (ZMod p) ≃ ZMod p).injective
    simp only [toAdd_pow, toAdd_ofAdd, nsmul_eq_mul, CharP.cast_eq_zero, mul_one, toAdd_one]⟩
  let b : φ.ker := ⟨(FreeGroup.of y) ^ p, by
    have hy : φ (FreeGroup.of y) = Multiplicative.ofAdd (-1 : ZMod p) := by
      simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceOneIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, one_ne_zero, ↓reduceIte, ofAdd_neg, φ, y]
    rw [MonoidHom.mem_ker, map_pow, hy]
    apply (Multiplicative.toAdd : Multiplicative (ZMod p) ≃ ZMod p).injective
    simp only [ofAdd_neg, inv_pow, toAdd_inv, toAdd_pow, toAdd_ofAdd, nsmul_eq_mul, CharP.cast_eq_zero, mul_one,
  neg_zero, toAdd_one]⟩
  let c : Fin tailLen → Fin p → φ.ker := fun j k =>
    ⟨(FreeGroup.of x) ^ (k : ℕ) * FreeGroup.of (tailGen j) *
        ((FreeGroup.of x) ^ (k : ℕ))⁻¹, by
      have htailMap : φ (FreeGroup.of (tailGen j)) = 1 := by
        simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceTailIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, Nat.add_eq_zero_iff, OfNat.ofNat_ne_zero, false_and, ↓reduceIte,
  ofAdd_neg, ite_eq_right_iff, inv_eq_one, ofAdd_eq_one, φ, tailGen]
        omega
      rw [MonoidHom.mem_ker]
      simp only [map_mul, map_pow, hx, htailMap, mul_one, map_inv, mul_inv_cancel]⟩
  intro g
  cases g with
  | elliptic i =>
      by_cases h0 : i.val = 0
      · exact e.symm a
      · by_cases h1 : i.val = 1
        · exact e.symm b
        · let r : Fin (p * tailLen) := ⟨i.val - 2, by
            have hi : i.val < 2 + p * tailLen := by
              simp only [firstReductionCanonicalTargetSignature] at i
              exact i.isLt
            omega⟩
          let k : Fin p := ⟨r.val / tailLen, by
            exact Nat.div_lt_of_lt_mul (by simpa [Nat.mul_comm] using r.isLt)⟩
          let j : Fin tailLen := ⟨r.val % tailLen, Nat.mod_lt _ hTailLen⟩
          exact e.symm (c j k)
  | surfaceA _ => exact 1
  | surfaceB _ => exact 1

Evaluating the first-reduction Schreier word through the chosen transversal gives the prescribed target word.

noncomputable def firstReductionCanonicalTargetToSchreierHom
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let φ :=
      firstReductionCanonicalSourceFreeQuotientHom
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let x : FuchsianGenerator σ :=
      FuchsianGenerator.elliptic
        (firstReductionCanonicalSourceZeroIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
    let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
      simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
    let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
    let hT : IsRightSchreierTransversal φ.ker T :=
      cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
    FreeGroup (FuchsianGenerator τ) →* FreeGroup ↥(schreierGeneratorSet hT) :=
  FreeGroup.lift
    (firstReductionCanonicalTargetToSchreierGeneratorImage
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)

The homomorphism from the first-reduction target presentation back to the canonical Schreier presentation.

private theorem firstReductionCanonicalTargetToSchreierHom_zero
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the zero generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_one
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the one generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_tail
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) (j : Fin tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the tail generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_zero_named
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the named zero generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_one_named
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the named one generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_tail_named
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) (j : Fin tailLen) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the named tail generator to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalTargetToSchreierHom_tailBlock
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) :
    letI : NeZero p

The target-to-Schreier transport homomorphism sends the tail block to its prescribed Schreier word.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_zeroGenerator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_tailGenerator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) (j : Fin tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_oneGenerator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_generators_of_oneGenerator
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (hOne :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let θ :=
        firstReductionCanonicalTargetToSchreierHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      η
          (θ
            (xWord τ
              (firstReductionCanonicalTargetOneIndex
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))) *
        (xWord τ
          (firstReductionCanonicalTargetOneIndex
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))⁻¹ ∈
          Subgroup.normalClosure (relators τ)) :
    letI : NeZero p

The inverse generator map for the first-reduction Schreier-to-target transport has the prescribed value in the one-generator case.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_generators_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSecondEdgeForwardWord_zero
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    let τ

At index zero, the first-reduction second-edge forward word has the stated form.

Show proof
private theorem firstReductionCanonicalSecondEdgeForwardWord_of_ne_zero
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) (h0 : k.val ≠ 0) :
    firstReductionCanonicalSecondEdgeForwardWord
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen k =
      firstReductionCanonicalTargetTailBlockWord
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
        ⟨k.val - 1, by omega⟩

For a nonzero index, the first-reduction second-edge forward word has the stated form.

Show proof
theorem firstReductionCanonicalSchreierToTarget_nonwrapTotalRelator_image_eq_one
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin (p - 1)) :
    letI : NeZero p

In the nonwrapping first-reduction case, the canonical Schreier-to-target map sends the total relator to the identity.

Show proof
theorem firstReductionCanonicalSchreierToTarget_wrapTotalRelator_image_eq_one
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The first-reduction Schreier-to-target map sends the wrapped total relator to the identity.

Show proof
private theorem firstReductionCanonicalSecondEdgeForward_invComp_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (k : Fin p) :
    letI : NeZero p

The inverse-composition word for the first-reduction second-edge forward map lies in the relevant normal closure.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_invComp_generator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (z :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let hT :=
        firstReductionCanonicalSchreierTransversal_isRightSchreierTransversal
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ↥(schreierGeneratorSet hT)) :
    letI : NeZero p

Evaluating the first-reduction Schreier word through the chosen transversal gives the prescribed target word.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_invComp_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

Evaluating the first-reduction Schreier word through the chosen transversal gives the prescribed target word.

Show proof
private theorem firstReductionCanonicalSchreierToTarget_toInv_mem_normalClosure_of_generators
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (hgen :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let θ :=
        firstReductionCanonicalTargetToSchreierHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ y : FuchsianGenerator τ,
        η (θ (FreeGroup.of y)) * (FreeGroup.of y)⁻¹ ∈
          Subgroup.normalClosure (relators τ)) :
    letI : NeZero p

Evaluating the first-reduction Schreier word through the chosen transversal gives the prescribed target word.

Show proof
theorem firstReductionCanonicalSchreierToTarget_firstPowerRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
theorem firstReductionCanonicalSchreierToTarget_tailPowerRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (j : Fin tailLen) (k : Fin p) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
theorem firstReductionCanonicalSchreierToTarget_secondPowerRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_firstDistinguishedPower_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_secondDistinguishedPower_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalSchreier_tailPower_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (j : Fin tailLen) (k : Fin p) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalTargetToSchreier_powerRelator_mem_normalClosure
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (i :
      Fin
        (firstReductionCanonicalTargetSignature
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen).numPeriods) :
    letI : NeZero p

The specified first-reduction relator belongs to the normal closure generated by the source presentation relators.

Show proof
private theorem firstReductionCanonicalTargetToSchreier_mapsTargetRelators
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) :
    letI : NeZero p

The target-to-Schreier map sends every target relator to the corresponding Schreier relator.

Show proof
def FirstReductionCanonicalSchreierRelatorData
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) : Type :=
  (letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let φ :=
      firstReductionCanonicalSourceFreeQuotientHom
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let x : FuchsianGenerator σ :=
      FuchsianGenerator.elliptic
        (firstReductionCanonicalSourceZeroIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
    let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
      simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
    let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
    let hT : IsRightSchreierTransversal φ.ker T :=
      cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
    let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
      freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
    ReidemeisterSchreier.Discrete.Presentations.RelatorQuotientMutualMapData
      (ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T))
      (relators τ))

Relator-quotient mutual map data for the canonical first-reduction Schreier presentation.

def FirstReductionCanonicalForwardMapData
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen) : Type :=
  (letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
    let φ :=
      firstReductionCanonicalSourceFreeQuotientHom
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let x : FuchsianGenerator σ :=
      FuchsianGenerator.elliptic
        (firstReductionCanonicalSourceZeroIndex
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
    let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
      simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
    let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
    let hT : IsRightSchreierTransversal φ.ker T :=
      cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
    let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
      freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
    ReidemeisterSchreier.Discrete.Presentations.RelatorQuotientForwardMapData
      (ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T))
      (relators τ)
      (firstReductionCanonicalTargetToSchreierHom
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))

The first-reduction forward-map data sends the canonical generators to their prescribed finite-quotient images and respects the relators.

noncomputable def firstReductionCanonicalForwardMapData_of_mapsRelators_toInv
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (hMapsRelators :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let φ :=
        firstReductionCanonicalSourceFreeQuotientHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let x : FuchsianGenerator σ :=
        FuchsianGenerator.elliptic
          (firstReductionCanonicalSourceZeroIndex
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
      let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
        simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
      let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
      let hT : IsRightSchreierTransversal φ.ker T :=
        cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
      let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
        freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ r ∈ ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T),
        η r ∈ Subgroup.normalClosure (relators τ))
    (hToInv :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let θ :=
        firstReductionCanonicalTargetToSchreierHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ y : FreeGroup (FuchsianGenerator τ),
        η (θ y) * y⁻¹ ∈ Subgroup.normalClosure (relators τ)) :
    FirstReductionCanonicalForwardMapData
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen := by
  classical
  letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
  let σ :=
    firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
  let φ :=
    firstReductionCanonicalSourceFreeQuotientHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let x : FuchsianGenerator σ :=
    FuchsianGenerator.elliptic
      (firstReductionCanonicalSourceZeroIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  have hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
    simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
  let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
  let hT : IsRightSchreierTransversal φ.ker T :=
    cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
  let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
    freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
  let hrels :=
    firstReductionCanonicalSourceFreeQuotientHom_respects_relators
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let θ :=
    firstReductionCanonicalTargetToSchreierHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let η :=
    firstReductionCanonicalSchreierToTargetHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  refine
    { toHom := η
      mapsRelators := ?_
      inv_toHom := ?_
      to_invHom := ?_ }
  · intro r hr
    simpa [σ, τ, φ, x, hx, T, hT, e, hrels, η] using hMapsRelators r hr
  · intro w
    simpa [σ, τ, φ, x, hx, T, hT, e, hrels, θ, η] using
      firstReductionCanonicalSchreierToTarget_invComp_mem_normalClosure
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen w
  · intro y
    simpa [σ, τ, θ, η] using hToInv y

The first-reduction forward-map data sends the canonical generators to their prescribed finite-quotient images and respects the relators.

noncomputable def firstReductionCanonicalForwardMapData_of_mapsRelators_toInvGenerators
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (hMapsRelators :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let φ :=
        firstReductionCanonicalSourceFreeQuotientHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let x : FuchsianGenerator σ :=
        FuchsianGenerator.elliptic
          (firstReductionCanonicalSourceZeroIndex
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
      let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
        simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
      let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
      let hT : IsRightSchreierTransversal φ.ker T :=
        cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
      let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
        freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ r ∈ ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T),
        η r ∈ Subgroup.normalClosure (relators τ))
    (hToInvGenerators :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let θ :=
        firstReductionCanonicalTargetToSchreierHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ y : FuchsianGenerator τ,
        η (θ (FreeGroup.of y)) * (FreeGroup.of y)⁻¹ ∈
          Subgroup.normalClosure (relators τ)) :
    FirstReductionCanonicalForwardMapData
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen :=
  firstReductionCanonicalForwardMapData_of_mapsRelators_toInv
    m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    hMapsRelators
    (firstReductionCanonicalSchreierToTarget_toInv_mem_normalClosure_of_generators
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen hToInvGenerators)

The first-reduction forward-map data sends the canonical generators to their prescribed finite-quotient images and respects the relators.

noncomputable def firstReductionCanonicalForwardMapData_of_mapsRelators
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (hMapsRelators :
      letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
      let σ :=
        firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let τ :=
        firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
      let φ :=
        firstReductionCanonicalSourceFreeQuotientHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      let x : FuchsianGenerator σ :=
        FuchsianGenerator.elliptic
          (firstReductionCanonicalSourceZeroIndex
            m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
      let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
        simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
      let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
      let hT : IsRightSchreierTransversal φ.ker T :=
        cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
      let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
        freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
      let η :=
        firstReductionCanonicalSchreierToTargetHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
      ∀ r ∈ ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T),
        η r ∈ Subgroup.normalClosure (relators τ)) :
    FirstReductionCanonicalForwardMapData
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen :=
  firstReductionCanonicalForwardMapData_of_mapsRelators_toInvGenerators
    m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    hMapsRelators
    (firstReductionCanonicalSchreierToTarget_toInv_generators_mem_normalClosure
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)

The first-reduction forward-map data sends the canonical generators to their prescribed finite-quotient images and respects the relators.

noncomputable def firstReductionCanonicalSchreierRelatorData_of_forwardMapData
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (D :
      FirstReductionCanonicalForwardMapData
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen) :
    FirstReductionCanonicalSchreierRelatorData
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen := by
  classical
  letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
  let σ :=
    firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  letI : DecidableEq (FuchsianGenerator σ) := Classical.decEq _
  let φ :=
    firstReductionCanonicalSourceFreeQuotientHom
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let x : FuchsianGenerator σ :=
    FuchsianGenerator.elliptic
      (firstReductionCanonicalSourceZeroIndex
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
  let hx : φ (FreeGroup.of x) = Multiplicative.ofAdd (1 : ZMod p) := by
    simp only [Lean.Elab.WF.paramLet, firstReductionCanonicalSourceFreeQuotientHom, id_eq,
  firstReductionCanonicalSourceZeroIndex, FreeGroup.lift_apply_of, ellipticQuotientGeneratorImage,
  firstReductionCanonicalSourceQuotientImage, ↓reduceIte, φ, x]
  let T := Set.range (cyclicQuotientRightRep φ (FreeGroup.of x))
  let hT : IsRightSchreierTransversal φ.ker T :=
    cyclicQuotientRightRep_isRightSchreierTransversal_of_freeGroupGenerator φ x hx
  let e : FreeGroup ↥(schreierGeneratorSet hT) ≃* φ.ker :=
    freeGroupKernelSchreierBasisEquivOfCyclicQuotientGenerator φ x hx
  let hrels :=
    firstReductionCanonicalSourceFreeQuotientHom_respects_relators
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  simpa [FirstReductionCanonicalSchreierRelatorData, σ, τ, φ, x, hx, T, hT, e, hrels] using
    (ReidemeisterSchreier.Discrete.Presentations.relatorQuotientMutualMapDataOfForwardMapData
      (R := ReidemeisterSchreier.Discrete.Presentations.freeGroupPullbackRelatorSet e
          (ReidemeisterSchreier.Discrete.Presentations.freeKernelTransversalRelatorSet
            (f := ellipticQuotientGeneratorImage σ
              (firstReductionCanonicalSourceQuotientImage
                m₁' m₂' tail hp hm₁' hm₂' htail hTailLen))
            (rels := relators σ) T))
      (S := relators τ)
      (invHom :=
        firstReductionCanonicalTargetToSchreierHom
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
      (firstReductionCanonicalTargetToSchreier_mapsTargetRelators
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen)
      D)

First-reduction forward-map data supplies the corresponding canonical Schreier relator data.

noncomputable def firstReductionCanonicalKernelEquivOfRelatorData
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (D :
      FirstReductionCanonicalSchreierRelatorData
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen) :
    letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
    let σ :=
      firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let τ :=
      firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let ξ :=
      firstReductionCanonicalSourceQuotientImage
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    let hrels : ∀ r ∈ relators σ,
        FreeGroup.lift (ellipticQuotientGeneratorImage σ ξ) r = 1 := by
      simpa [ξ, firstReductionCanonicalSourceFreeQuotientHom] using
        firstReductionCanonicalSourceFreeQuotientHom_respects_relators
          m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    (PresentedGroup.toGroup (rels := relators σ)
      (f := ellipticQuotientGeneratorImage σ ξ) hrels).ker ≃*
        FuchsianPresentedGroup τ := by
  classical
  letI : NeZero p := ⟨Nat.ne_of_gt (lt_of_lt_of_le (by decide : 0 < 2) hp)⟩
  let σ :=
    firstReductionCanonicalSourceSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let τ :=
    firstReductionCanonicalTargetSignature m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let ξ :=
    firstReductionCanonicalSourceQuotientImage
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let hpow : ∀ i, ξ i ^ σ.periods i = 1 :=
    firstReductionCanonicalSourceQuotientImage_pow
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let hprod : ∏ i : Fin σ.numPeriods, ξ i = 1 :=
    firstReductionCanonicalSourceQuotientImage_prod
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let hrels : ∀ r ∈ relators σ,
      FreeGroup.lift (ellipticQuotientGeneratorImage σ ξ) r = 1 := by
    simpa [ξ, firstReductionCanonicalSourceFreeQuotientHom] using
      firstReductionCanonicalSourceFreeQuotientHom_respects_relators
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  let i₀ :=
    firstReductionCanonicalSourceZeroIndex
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
  have hi₀ : ξ i₀ = Multiplicative.ofAdd (1 : ZMod p) := by
    simp only [firstReductionCanonicalSourceZeroIndex, firstReductionCanonicalSourceQuotientImage, ↓reduceIte, ξ,
  i₀]
  have hData :
      FuchsianEllipticCyclicSchreierRelatorData σ τ ξ i₀ hi₀ := by
    simpa [FuchsianEllipticCyclicSchreierRelatorData,
      FirstReductionCanonicalSchreierRelatorData, σ, τ, ξ, i₀, hi₀,
      firstReductionCanonicalSourceFreeQuotientHom] using D
  simpa [ellipticQuotientHom, σ, τ, ξ, hpow, hprod, hrels] using
    fuchsianEllipticCyclicKernelEquivOfRelatorData
      σ τ ξ hpow hprod i₀ hi₀ hData

First-reduction canonical relator data identifies the Schreier kernel with the target presented group.

noncomputable def firstReductionCanonicalKernelEquivOfForwardMapData
    {tailLen p : ℕ}
    (m₁' m₂' : ℕ) (tail : Fin tailLen → ℕ)
    (hp : 2 ≤ p) (hm₁' : 2 ≤ m₁') (hm₂' : 2 ≤ m₂')
    (htail : ∀ j, 2 ≤ tail j) (hTailLen : 0 < tailLen)
    (D :
      FirstReductionCanonicalForwardMapData
        m₁' m₂' tail hp hm₁' hm₂' htail hTailLen) :=
  firstReductionCanonicalKernelEquivOfRelatorData
    m₁' m₂' tail hp hm₁' hm₂' htail hTailLen
    (firstReductionCanonicalSchreierRelatorData_of_forwardMapData
      m₁' m₂' tail hp hm₁' hm₂' htail hTailLen D)

First-reduction forward-map data identifies the Schreier kernel with the target presented group.