Documentation

Mathlib.GroupTheory.CoprodI

The coproduct (a.k.a. the free product) of groups or monoids #

Given an ι-indexed family M of monoids, we define their coproduct (a.k.a. free product) Monoid.CoprodI M. As usual, we use the suffix I for an indexed (co)product, leaving Coprod for the coproduct of two monoids.

When ι and all M i have decidable equality, the free product bijects with the type Monoid.CoprodI.Word M of reduced words. This bijection is constructed by defining an action of Monoid.CoprodI M on Monoid.CoprodI.Word M.

When M i are all groups, Monoid.CoprodI M is also a group (and the coproduct in the category of groups).

Main definitions #

Remarks #

There are many answers to the question "what is the coproduct of a family M of monoids?", and they are all equivalent but not obviously equivalent. We provide two answers. The first, almost tautological answer is given by Monoid.CoprodI M, which is a quotient of the type of words in the alphabet Σ i, M i. It's straightforward to define and easy to prove its universal property. But this answer is not completely satisfactory, because it's difficult to tell when two elements x y : Monoid.CoprodI M are distinct since Monoid.CoprodI M is defined as a quotient.

The second, maximally efficient answer is given by Monoid.CoprodI.Word M. An element of Monoid.CoprodI.Word M is a word in the alphabet Σ i, M i, where the letter ⟨i, 1⟩ doesn't occur and no adjacent letters share an index i. Since we only work with reduced words, there is no need for quotienting, and it is easy to tell when two elements are distinct. However it's not obvious that this is even a monoid!

We prove that every element of Monoid.CoprodI M can be represented by a unique reduced word, i.e. Monoid.CoprodI M and Monoid.CoprodI.Word M are equivalent types. This means that Monoid.CoprodI.Word M can be given a monoid structure, and it lets us tell when two elements of Monoid.CoprodI M are distinct.

There is also a completely tautological, maximally inefficient answer given by MonCat.Colimits.ColimitType. Whereas Monoid.CoprodI M at least ensures that (any instance of) associativity holds by reflexivity, in this answer associativity holds because of quotienting. Yet another answer, which is constructively more satisfying, could be obtained by showing that Monoid.CoprodI.Rel is confluent.

References #

[van der Waerden, Free products of groups][MR25465]

inductive Monoid.CoprodI.Rel {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
FreeMonoid ((i : ι) × M i)FreeMonoid ((i : ι) × M i)Prop

A relation on the free monoid on alphabet Σ i, M i, relating ⟨i, 1⟩ with 1 and ⟨i, x⟩ * ⟨i, y⟩ with ⟨i, x * y⟩.

Instances For
    def Monoid.CoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
    Type (max u_1 u_2)

    The free product (categorical coproduct) of an indexed family of monoids.

    Equations
    Instances For
      instance instMonoidCoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
      Equations
      instance instInhabitedCoprodI {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
      Equations
      theorem Monoid.CoprodI.Word.ext_iff {ι : Type u_1} {M : ιType u_2} :
      ∀ {inst : (i : ι) → Monoid (M i)} (x y : Monoid.CoprodI.Word M), x = y x.toList = y.toList
      theorem Monoid.CoprodI.Word.ext {ι : Type u_1} {M : ιType u_2} :
      ∀ {inst : (i : ι) → Monoid (M i)} (x y : Monoid.CoprodI.Word M), x.toList = y.toListx = y
      structure Monoid.CoprodI.Word {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
      Type (max u_1 u_2)

      The type of reduced words. A reduced word cannot contain a letter 1, and no two adjacent letters can come from the same summand.

      • toList : List ((i : ι) × M i)

        A Word is a List (Σ i, M i), such that 1 is not in the list, and no two adjacent letters are from the same summand

      • ne_one : lself.toList, l.snd 1

        A reduced word does not contain 1

      • chain_ne : List.Chain' (fun (l l' : (i : ι) × M i) => l.fst l'.fst) self.toList

        Adjacent letters are not from the same summand.

      Instances For
        def Monoid.CoprodI.of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} :

        The inclusion of a summand into the free product.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Monoid.CoprodI.of_apply {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) :
          Monoid.CoprodI.of m = (Con.mk' (conGen (Monoid.CoprodI.Rel M))) (FreeMonoid.of { fst := i, snd := m })
          theorem Monoid.CoprodI.ext_hom {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [Monoid N] (f : Monoid.CoprodI M →* N) (g : Monoid.CoprodI M →* N) (h : ∀ (i : ι), MonoidHom.comp f Monoid.CoprodI.of = MonoidHom.comp g Monoid.CoprodI.of) :
          f = g

          See note [partially-applied ext lemmas].

          @[simp]
          theorem Monoid.CoprodI.lift_symm_apply {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [Monoid N] (f : Monoid.CoprodI M →* N) (i : ι) :
          Monoid.CoprodI.lift.symm f i = MonoidHom.comp f Monoid.CoprodI.of
          def Monoid.CoprodI.lift {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_3} [Monoid N] :
          ((i : ι) → M i →* N) (Monoid.CoprodI M →* N)

          A map out of the free product corresponds to a family of maps out of the summands. This is the universal property of the free product, characterizing it as a categorical coproduct.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            @[simp]
            theorem Monoid.CoprodI.lift_of {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [Monoid N] (fi : (i : ι) → M i →* N) {i : ι} (m : M i) :
            (Monoid.CoprodI.lift fi) (Monoid.CoprodI.of m) = (fi i) m
            theorem Monoid.CoprodI.induction_on {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {C : Monoid.CoprodI MProp} (m : Monoid.CoprodI M) (h_one : C 1) (h_of : ∀ (i : ι) (m : M i), C (Monoid.CoprodI.of m)) (h_mul : ∀ (x y : Monoid.CoprodI M), C xC yC (x * y)) :
            C m
            theorem Monoid.CoprodI.of_leftInverse {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [DecidableEq ι] (i : ι) :
            Function.LeftInverse (Monoid.CoprodI.lift (Pi.mulSingle i (MonoidHom.id (M i)))) Monoid.CoprodI.of
            theorem Monoid.CoprodI.of_injective {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (i : ι) :
            Function.Injective Monoid.CoprodI.of
            theorem Monoid.CoprodI.lift_mrange_le {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [Monoid N] (f : (i : ι) → M i →* N) {s : Submonoid N} (h : ∀ (i : ι), MonoidHom.mrange (f i) s) :
            MonoidHom.mrange (Monoid.CoprodI.lift f) s
            theorem Monoid.CoprodI.mrange_eq_iSup {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {N : Type u_4} [Monoid N] (f : (i : ι) → M i →* N) :
            MonoidHom.mrange (Monoid.CoprodI.lift f) = ⨆ (i : ι), MonoidHom.mrange (f i)
            instance Monoid.CoprodI.instInvCoprodIToMonoidToDivInvMonoid {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] :
            Equations
            • One or more equations did not get rendered due to their size.
            theorem Monoid.CoprodI.inv_def {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] (x : Monoid.CoprodI G) :
            x⁻¹ = MulOpposite.unop ((Monoid.CoprodI.lift fun (i : ι) => MonoidHom.comp (MonoidHom.op Monoid.CoprodI.of) (MulEquiv.toMonoidHom (MulEquiv.inv' (G i)))) x)
            theorem Monoid.CoprodI.lift_range_le {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] {N : Type u_5} [Group N] (f : (i : ι) → G i →* N) {s : Subgroup N} (h : ∀ (i : ι), MonoidHom.range (f i) s) :
            MonoidHom.range (Monoid.CoprodI.lift f) s
            theorem Monoid.CoprodI.range_eq_iSup {ι : Type u_1} (G : ιType u_4) [(i : ι) → Group (G i)] {N : Type u_5} [Group N] (f : (i : ι) → G i →* N) :
            MonoidHom.range (Monoid.CoprodI.lift f) = ⨆ (i : ι), MonoidHom.range (f i)
            @[simp]
            theorem Monoid.CoprodI.Word.empty_toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
            Monoid.CoprodI.Word.empty.toList = []
            def Monoid.CoprodI.Word.empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :

            The empty reduced word.

            Equations
            • Monoid.CoprodI.Word.empty = { toList := [], ne_one := (_ : a[], ¬a.snd = 1), chain_ne := (_ : List.Chain' (fun (l l' : (i : ι) × M i) => l.fst l'.fst) []) }
            Instances For
              instance Monoid.CoprodI.Word.instInhabitedWord {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
              Equations
              • Monoid.CoprodI.Word.instInhabitedWord = { default := Monoid.CoprodI.Word.empty }
              def Monoid.CoprodI.Word.prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : Monoid.CoprodI.Word M) :

              A reduced word determines an element of the free product, given by multiplication.

              Equations
              Instances For
                @[simp]
                theorem Monoid.CoprodI.Word.prod_empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] :
                Monoid.CoprodI.Word.prod Monoid.CoprodI.Word.empty = 1
                def Monoid.CoprodI.Word.fstIdx {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : Monoid.CoprodI.Word M) :

                fstIdx w is some i if the first letter of w is ⟨i, m⟩ with m : M i. If w is empty then it's none.

                Equations
                Instances For
                  theorem Monoid.CoprodI.Word.fstIdx_ne_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {w : Monoid.CoprodI.Word M} {i : ι} :
                  Monoid.CoprodI.Word.fstIdx w some i lList.head? w.toList, i l.fst
                  theorem Monoid.CoprodI.Word.Pair.ext {ι : Type u_1} {M : ιType u_2} :
                  ∀ {inst : (i : ι) → Monoid (M i)} {i : ι} (x y : Monoid.CoprodI.Word.Pair M i), x.head = y.headx.tail = y.tailx = y
                  theorem Monoid.CoprodI.Word.Pair.ext_iff {ι : Type u_1} {M : ιType u_2} :
                  ∀ {inst : (i : ι) → Monoid (M i)} {i : ι} (x y : Monoid.CoprodI.Word.Pair M i), x = y x.head = y.head x.tail = y.tail
                  structure Monoid.CoprodI.Word.Pair {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] (i : ι) :
                  Type (max u_1 u_2)

                  Given an index i : ι, Pair M i is the type of pairs (head, tail) where head : M i and tail : Word M, subject to the constraint that first letter of tail can't be ⟨i, m⟩. By prepending head to tail, one obtains a new word. We'll show that any word can be uniquely obtained in this way.

                  Instances For
                    instance Monoid.CoprodI.Word.instInhabitedPair {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] (i : ι) :
                    Equations
                    • One or more equations did not get rendered due to their size.
                    @[simp]
                    theorem Monoid.CoprodI.Word.cons_toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) (hmw : Monoid.CoprodI.Word.fstIdx w some i) (h1 : m 1) :
                    (Monoid.CoprodI.Word.cons m w hmw h1).toList = { fst := i, snd := m } :: w.toList
                    def Monoid.CoprodI.Word.cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) (hmw : Monoid.CoprodI.Word.fstIdx w some i) (h1 : m 1) :

                    Construct a new Word without any reduction. The underlying list of cons m w _ _ is ⟨_, m⟩::w

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Monoid.CoprodI.Word.rcons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} (p : Monoid.CoprodI.Word.Pair M i) :

                      Given a pair (head, tail), we can form a word by prepending head to tail, except if head is 1 : M i then we have to just return Word since we need the result to be reduced.

                      Equations
                      Instances For
                        @[simp]
                        theorem Monoid.CoprodI.Word.prod_rcons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} (p : Monoid.CoprodI.Word.Pair M i) :
                        theorem Monoid.CoprodI.Word.rcons_inj {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} :
                        Function.Injective Monoid.CoprodI.Word.rcons
                        theorem Monoid.CoprodI.Word.mem_rcons_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] {i : ι} {j : ι} (p : Monoid.CoprodI.Word.Pair M i) (m : M j) :
                        { fst := j, snd := m } (Monoid.CoprodI.Word.rcons p).toList { fst := j, snd := m } p.tail.toList m 1 ∃ (h : i = j), m = hp.head
                        @[simp]
                        theorem Monoid.CoprodI.Word.fstIdx_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) (hmw : Monoid.CoprodI.Word.fstIdx w some i) (h1 : m 1) :
                        @[simp]
                        theorem Monoid.CoprodI.Word.prod_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (i : ι) (m : M i) (w : Monoid.CoprodI.Word M) (h1 : m 1) (h2 : Monoid.CoprodI.Word.fstIdx w some i) :
                        def Monoid.CoprodI.Word.consRecOn {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Monoid.CoprodI.Word MSort u_4} (w : Monoid.CoprodI.Word M) (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : Monoid.CoprodI.Word M) → (h1 : Monoid.CoprodI.Word.fstIdx w some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
                        motive w

                        Induct on a word by adding letters one at a time without reduction, effectively inducting on the underlying List.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[simp]
                          theorem Monoid.CoprodI.Word.consRecOn_empty {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Monoid.CoprodI.Word MSort u_4} (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : Monoid.CoprodI.Word M) → (h1 : Monoid.CoprodI.Word.fstIdx w some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
                          Monoid.CoprodI.Word.consRecOn Monoid.CoprodI.Word.empty h_empty h_cons = h_empty
                          @[simp]
                          theorem Monoid.CoprodI.Word.consRecOn_cons {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {motive : Monoid.CoprodI.Word MSort u_4} (i : ι) (m : M i) (w : Monoid.CoprodI.Word M) (h1 : Monoid.CoprodI.Word.fstIdx w some i) (h2 : m 1) (h_empty : motive Monoid.CoprodI.Word.empty) (h_cons : (i : ι) → (m : M i) → (w : Monoid.CoprodI.Word M) → (h1 : Monoid.CoprodI.Word.fstIdx w some i) → (h2 : m 1) → motive wmotive (Monoid.CoprodI.Word.cons m w h1 h2)) :
                          Monoid.CoprodI.Word.consRecOn (Monoid.CoprodI.Word.cons m w h1 h2) h_empty h_cons = h_cons i m w h1 h2 (Monoid.CoprodI.Word.consRecOn w h_empty h_cons)
                          def Monoid.CoprodI.Word.equivPair {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] (i : ι) :

                          The equivalence between words and pairs. Given a word, it decomposes it as a pair by removing the first letter if it comes from M i. Given a pair, it prepends the head to the tail.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            theorem Monoid.CoprodI.Word.equivPair_symm {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] (i : ι) (p : Monoid.CoprodI.Word.Pair M i) :
                            theorem Monoid.CoprodI.Word.equivPair_eq_of_fstIdx_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {w : Monoid.CoprodI.Word M} (h : Monoid.CoprodI.Word.fstIdx w some i) :
                            (Monoid.CoprodI.Word.equivPair i) w = { head := 1, tail := w, fstIdx_ne := h }
                            theorem Monoid.CoprodI.Word.mem_equivPair_tail_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {j : ι} {w : Monoid.CoprodI.Word M} (m : M i) :
                            { fst := i, snd := m } ((Monoid.CoprodI.Word.equivPair j) w).tail.toList { fst := i, snd := m } List.tail w.toList i j ∃ (h : w.toList []), List.head w.toList h = { fst := i, snd := m }
                            theorem Monoid.CoprodI.Word.mem_of_mem_equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {j : ι} {w : Monoid.CoprodI.Word M} (m : M i) :
                            { fst := i, snd := m } ((Monoid.CoprodI.Word.equivPair j) w).tail.toList{ fst := i, snd := m } w.toList
                            theorem Monoid.CoprodI.Word.equivPair_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {w : Monoid.CoprodI.Word M} :
                            ((Monoid.CoprodI.Word.equivPair i) w).head = if h : ∃ (h : w.toList []), (List.head w.toList h).fst = i then (_ : (List.head w.toList (_ : w.toList [])).fst = i)(List.head w.toList (_ : w.toList [])).snd else 1
                            instance Monoid.CoprodI.Word.summandAction {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] (i : ι) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            instance Monoid.CoprodI.Word.instMulActionCoprodIWordInstMonoidCoprodI {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] :
                            Equations
                            • Monoid.CoprodI.Word.instMulActionCoprodIWordInstMonoidCoprodI = MulAction.ofEndHom (Monoid.CoprodI.lift fun (x : ι) => MulAction.toEndHom)
                            theorem Monoid.CoprodI.Word.smul_def {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) :
                            m w = Monoid.CoprodI.Word.rcons (let src := (Monoid.CoprodI.Word.equivPair i) w; { head := m * ((Monoid.CoprodI.Word.equivPair i) w).head, tail := src.tail, fstIdx_ne := (_ : Monoid.CoprodI.Word.fstIdx src.tail some i) })
                            theorem Monoid.CoprodI.Word.of_smul_def {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] (i : ι) (w : Monoid.CoprodI.Word M) (m : M i) :
                            Monoid.CoprodI.of m w = Monoid.CoprodI.Word.rcons (let src := (Monoid.CoprodI.Word.equivPair i) w; { head := m * ((Monoid.CoprodI.Word.equivPair i) w).head, tail := src.tail, fstIdx_ne := (_ : Monoid.CoprodI.Word.fstIdx src.tail some i) })
                            theorem Monoid.CoprodI.Word.equivPair_smul_same {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) :
                            (Monoid.CoprodI.Word.equivPair i) (Monoid.CoprodI.of m w) = { head := m * ((Monoid.CoprodI.Word.equivPair i) w).head, tail := ((Monoid.CoprodI.Word.equivPair i) w).tail, fstIdx_ne := (_ : Monoid.CoprodI.Word.fstIdx ((Monoid.CoprodI.Word.equivPair i) w).tail some i) }
                            @[simp]
                            theorem Monoid.CoprodI.Word.equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (p : Monoid.CoprodI.Word.Pair M i) :
                            (Monoid.CoprodI.Word.equivPair i) p.tail = { head := 1, tail := p.tail, fstIdx_ne := (_ : Monoid.CoprodI.Word.fstIdx p.tail some i) }
                            theorem Monoid.CoprodI.Word.smul_eq_of_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (m : M i) (w : Monoid.CoprodI.Word M) :
                            m w = Monoid.CoprodI.of m w
                            theorem Monoid.CoprodI.Word.mem_smul_iff {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {j : ι} {m₁ : M i} {m₂ : M j} {w : Monoid.CoprodI.Word M} :
                            { fst := i, snd := m₁ } (Monoid.CoprodI.of m₂ w).toList ¬i = j { fst := i, snd := m₁ } w.toList m₁ 1 ∃ (hij : i = j), { fst := i, snd := m₁ } List.tail w.toList (∃ (m' : M j), { fst := j, snd := m' } List.head? w.toList m₁ = (_ : j = i)(m₂ * m')) Monoid.CoprodI.Word.fstIdx w some j m₁ = (_ : j = i)m₂
                            theorem Monoid.CoprodI.Word.mem_smul_iff_of_ne {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {j : ι} (hij : i j) {m₁ : M i} {m₂ : M j} {w : Monoid.CoprodI.Word M} :
                            { fst := i, snd := m₁ } (Monoid.CoprodI.of m₂ w).toList { fst := i, snd := m₁ } w.toList
                            theorem Monoid.CoprodI.Word.cons_eq_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} {m : M i} {ls : Monoid.CoprodI.Word M} {h1 : Monoid.CoprodI.Word.fstIdx ls some i} {h2 : m 1} :
                            Monoid.CoprodI.Word.cons m ls h1 h2 = Monoid.CoprodI.of m ls
                            theorem Monoid.CoprodI.Word.rcons_eq_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (p : Monoid.CoprodI.Word.Pair M i) :
                            Monoid.CoprodI.Word.rcons p = Monoid.CoprodI.of p.head p.tail
                            @[simp]
                            theorem Monoid.CoprodI.Word.equivPair_head_smul_equivPair_tail {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {i : ι} (w : Monoid.CoprodI.Word M) :
                            Monoid.CoprodI.of ((Monoid.CoprodI.Word.equivPair i) w).head ((Monoid.CoprodI.Word.equivPair i) w).tail = w
                            theorem Monoid.CoprodI.Word.equivPair_tail_eq_inv_smul {ι : Type u_1} [DecidableEq ι] {G : ιType u_4} [(i : ι) → Group (G i)] [(i : ι) → DecidableEq (G i)] {i : ι} (w : Monoid.CoprodI.Word G) :
                            ((Monoid.CoprodI.Word.equivPair i) w).tail = (Monoid.CoprodI.of ((Monoid.CoprodI.Word.equivPair i) w).head)⁻¹ w
                            theorem Monoid.CoprodI.Word.smul_induction {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] {C : Monoid.CoprodI.Word MProp} (h_empty : C Monoid.CoprodI.Word.empty) (h_smul : ∀ (i : ι) (m : M i) (w : Monoid.CoprodI.Word M), C wC (Monoid.CoprodI.of m w)) (w : Monoid.CoprodI.Word M) :
                            C w
                            @[simp]
                            theorem Monoid.CoprodI.Word.prod_smul {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] (m : Monoid.CoprodI M) (w : Monoid.CoprodI.Word M) :
                            def Monoid.CoprodI.Word.equiv {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] :

                            Each element of the free product corresponds to a unique reduced word.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              instance Monoid.CoprodI.Word.instDecidableEqWord {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] :
                              Equations
                              instance Monoid.CoprodI.Word.instDecidableEqCoprodI {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] [(i : ι) → DecidableEq (M i)] [DecidableEq ι] :
                              Equations
                              inductive Monoid.CoprodI.NeWord {ι : Type u_1} (M : ιType u_2) [(i : ι) → Monoid (M i)] :
                              ιιType (max u_1 u_2)

                              A NeWord M i j is a representation of a non-empty reduced words where the first letter comes from M i and the last letter comes from M j. It can be constructed from singletons and via concatenation, and thus provides a useful induction principle.

                              Instances For
                                def Monoid.CoprodI.NeWord.toList {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : Monoid.CoprodI.NeWord M i j) :
                                List ((i : ι) × M i)

                                The list represented by a given NeWord

                                Equations
                                Instances For
                                  theorem Monoid.CoprodI.NeWord.toList_ne_nil {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) :
                                  def Monoid.CoprodI.NeWord.head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : Monoid.CoprodI.NeWord M i j) :
                                  M i

                                  The first letter of a NeWord

                                  Equations
                                  Instances For
                                    def Monoid.CoprodI.NeWord.last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (_w : Monoid.CoprodI.NeWord M i j) :
                                    M j

                                    The last letter of a NeWord

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem Monoid.CoprodI.NeWord.toList_head? {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) :
                                      @[simp]
                                      theorem Monoid.CoprodI.NeWord.toList_getLast? {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) :
                                      def Monoid.CoprodI.NeWord.toWord {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) :

                                      The Word M represented by a NeWord M i j

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        theorem Monoid.CoprodI.NeWord.of_word {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] (w : Monoid.CoprodI.Word M) (h : w Monoid.CoprodI.Word.empty) :
                                        ∃ (i : ι) (j : ι) (w' : Monoid.CoprodI.NeWord M i j), Monoid.CoprodI.NeWord.toWord w' = w

                                        Every nonempty Word M can be constructed as a NeWord M i j

                                        def Monoid.CoprodI.NeWord.prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) :

                                        A non-empty reduced word determines an element of the free product, given by multiplication.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.singleton_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.singleton_last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.prod_singleton {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} (x : M i) (hne_one : x 1) :
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.append_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : Monoid.CoprodI.NeWord M i j} {hne : j k} {w₂ : Monoid.CoprodI.NeWord M k l} :
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.append_last {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : Monoid.CoprodI.NeWord M i j} {hne : j k} {w₂ : Monoid.CoprodI.NeWord M k l} :
                                          @[simp]
                                          theorem Monoid.CoprodI.NeWord.append_prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} {k : ι} {l : ι} {w₁ : Monoid.CoprodI.NeWord M i j} {hne : j k} {w₂ : Monoid.CoprodI.NeWord M k l} :
                                          def Monoid.CoprodI.NeWord.replaceHead {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (x : M i) (_hnotone : x 1) (_w : Monoid.CoprodI.NeWord M i j) :

                                          One can replace the first letter in a non-empty reduced word by an element of the same group

                                          Equations
                                          Instances For
                                            @[simp]
                                            theorem Monoid.CoprodI.NeWord.replaceHead_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (x : M i) (hnotone : x 1) (w : Monoid.CoprodI.NeWord M i j) :
                                            def Monoid.CoprodI.NeWord.mulHead {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) (x : M i) (hnotone : x * Monoid.CoprodI.NeWord.head w 1) :

                                            One can multiply an element from the left to a non-empty reduced word if it does not cancel with the first element in the word.

                                            Equations
                                            Instances For
                                              @[simp]
                                              theorem Monoid.CoprodI.NeWord.mulHead_head {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) (x : M i) (hnotone : x * Monoid.CoprodI.NeWord.head w 1) :
                                              @[simp]
                                              theorem Monoid.CoprodI.NeWord.mulHead_prod {ι : Type u_1} {M : ιType u_2} [(i : ι) → Monoid (M i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord M i j) (x : M i) (hnotone : x * Monoid.CoprodI.NeWord.head w 1) :
                                              def Monoid.CoprodI.NeWord.inv {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (_w : Monoid.CoprodI.NeWord G i j) :

                                              The inverse of a non-empty reduced word

                                              Equations
                                              Instances For
                                                @[simp]
                                                theorem Monoid.CoprodI.NeWord.inv_prod {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord G i j) :
                                                @[simp]
                                                theorem Monoid.CoprodI.NeWord.inv_head {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord G i j) :
                                                @[simp]
                                                theorem Monoid.CoprodI.NeWord.inv_last {ι : Type u_1} {G : ιType u_4} [(i : ι) → Group (G i)] {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord G i j) :
                                                theorem Monoid.CoprodI.lift_word_ping_pong {ι : Type u_1} {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [MulAction G α] (X : ιSet α) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} {k : ι} (w : Monoid.CoprodI.NeWord H i j) (hk : j k) :
                                                (Monoid.CoprodI.lift f) (Monoid.CoprodI.NeWord.prod w) X k X i
                                                theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_other_i {ι : Type u_1} {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} {k : ι} (w : Monoid.CoprodI.NeWord H i j) (hhead : k i) (hlast : k j) :
                                                (Monoid.CoprodI.lift f) (Monoid.CoprodI.NeWord.prod w) 1
                                                theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_head_eq_last {ι : Type u_1} [hnontriv : Nontrivial ι] {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} (w : Monoid.CoprodI.NeWord H i i) :
                                                (Monoid.CoprodI.lift f) (Monoid.CoprodI.NeWord.prod w) 1
                                                theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_head_card {ι : Type u_1} [hnontriv : Nontrivial ι] {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord H i j) (hcard : 3 Cardinal.mk (H i)) (hheadtail : i j) :
                                                (Monoid.CoprodI.lift f) (Monoid.CoprodI.NeWord.prod w) 1
                                                theorem Monoid.CoprodI.lift_word_prod_nontrivial_of_not_empty {ι : Type u_1} [hnontriv : Nontrivial ι] {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 Cardinal.mk ι ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {i : ι} {j : ι} (w : Monoid.CoprodI.NeWord H i j) :
                                                (Monoid.CoprodI.lift f) (Monoid.CoprodI.NeWord.prod w) 1
                                                theorem Monoid.CoprodI.empty_of_word_prod_eq_one {ι : Type u_1} [hnontriv : Nontrivial ι] {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 Cardinal.mk ι ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) {w : Monoid.CoprodI.Word H} (h : (Monoid.CoprodI.lift f) (Monoid.CoprodI.Word.prod w) = 1) :
                                                w = Monoid.CoprodI.Word.empty
                                                theorem Monoid.CoprodI.lift_injective_of_ping_pong {ι : Type u_1} [hnontriv : Nontrivial ι] {G : Type u_4} [Group G] {H : ιType u_5} [(i : ι) → Group (H i)] (f : (i : ι) → H i →* G) (hcard : 3 Cardinal.mk ι ∃ (i : ι), 3 Cardinal.mk (H i)) {α : Type u_6} [MulAction G α] (X : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hpp : Pairwise fun (i j : ι) => ∀ (h : H i), h 1(f i) h X j X i) :
                                                Function.Injective (Monoid.CoprodI.lift f)

                                                The Ping-Pong-Lemma.

                                                Given a group action of G on X so that the H i acts in a specific way on disjoint subsets X i we can prove that lift f is injective, and thus the image of lift f is isomorphic to the free product of the H i.

                                                Often the Ping-Pong-Lemma is stated with regard to subgroups H i that generate the whole group; we generalize to arbitrary group homomorphisms f i : H i →* G and do not require the group to be generated by the images.

                                                Usually the Ping-Pong-Lemma requires that one group H i has at least three elements. This condition is only needed if # ι = 2, and we accept 3 ≤ # ι as an alternative.

                                                def Monoid.CoprodI.FreeGroupBasis.coprodI {ι : Type u_4} {X : ιType u_5} {G : ιType u_6} [(i : ι) → Group (G i)] (B : (i : ι) → FreeGroupBasis (X i) (G i)) :
                                                FreeGroupBasis ((i : ι) × X i) (Monoid.CoprodI G)

                                                Given a family of free groups with distinguished bases, then their free product is free, with a basis given by the union of the bases of the components.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  The free product of free groups is itself a free group.

                                                  Equations
                                                  @[simp]
                                                  theorem freeGroupEquivCoprodI_apply {ι : Type u_1} (a : FreeGroup ι) :
                                                  freeGroupEquivCoprodI a = (FreeGroup.lift fun (i : ι) => Monoid.CoprodI.of (FreeGroup.of ())) a
                                                  @[simp]
                                                  theorem freeGroupEquivCoprodI_symm_apply {ι : Type u_1} (a : Monoid.CoprodI fun (x : ι) => FreeGroup Unit) :
                                                  (MulEquiv.symm freeGroupEquivCoprodI) a = (Monoid.CoprodI.lift fun (i : ι) => FreeGroup.lift fun (x : Unit) => FreeGroup.of i) a

                                                  A free group is a free product of copies of the free_group over one generator.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem FreeGroup.injective_lift_of_ping_pong {ι : Type u_1} [Nontrivial ι] {G : Type u_1} [Group G] (a : ιG) {α : Type u_4} [MulAction G α] (X : ιSet α) (Y : ιSet α) (hXnonempty : ∀ (i : ι), Set.Nonempty (X i)) (hXdisj : Pairwise fun (i j : ι) => Disjoint (X i) (X j)) (hYdisj : Pairwise fun (i j : ι) => Disjoint (Y i) (Y j)) (hXYdisj : ∀ (i j : ι), Disjoint (X i) (Y j)) (hX : ∀ (i : ι), a i (Y i) X i) (hY : ∀ (i : ι), a⁻¹ i (X i) Y i) :
                                                    Function.Injective (FreeGroup.lift a)

                                                    The Ping-Pong-Lemma.

                                                    Given a group action of G on X so that the generators of the free groups act in specific ways on disjoint subsets X i and Y i we can prove that lift f is injective, and thus the image of lift f is isomorphic to the free group.

                                                    Often the Ping-Pong-Lemma is stated with regard to group elements that generate the whole group; we generalize to arbitrary group homomorphisms from the free group to G and do not require the group to be generated by the elements.