Documentation

Linglib.Syntax.Minimalist.Derivation.Basic

Derivations #

An ordered derivation is an initial syntactic object with a sequence of Merge steps, each placing its new daughter on a side. External Merge adds an item, and Internal Merge raises a mover: the step re-merges the mover with the remainder deleteAccessible mover current, the current object with the mover's occurrences replaced by the trace of the mover's head. Which item heads the mover is a theory's choice, so the steps and stages take the trace encoder as a parameter, by default the head by selection. Internal Merge also comes in its two stages: extract puts a copy of the mover on a stack beside the object, leaving its trace, and remerge merges the copy on top back, so a derivation runs on a configuration of the object and the stack (Derivation.run) and copies extracted in one order merge back in the reverse. Each step is the algebraic Merge on the workspace of the current object, the items it introduces, and the items still to come, when it matches no accessible term of those items and an Internal Merge raises a uniquely accessible term (Step.mergeOp_workspace); an admissible derivation is then the iterated algebraic Merge on the workspace of its initial object and its items (Derivation.mergeOpList_initial). The node being commutative, the two sides build the same object; the side is a planarization datum that matters only for the surface order, which Linearization/Replay.lean recovers on an ordered planar accumulator, since the final object is an unordered quotient. Since node is noncomputable, so are Step.apply and Derivation.final, while the movers are read off the steps. A derivation extends by further steps, whose early stages and movers are the original's, and normalizes by moving every new daughter to the left, which changes no stage and no mover.

Main definitions #

Main results #

TODO #

References #

Steps #

A derivation step. A Merge step attaches its new daughter on an Edge of the mother, a planarization datum that externalization reads and the derived object ignores. im records only the mover; the trace it leaves is that of its head under the trace encoder the step is applied with. Internal Merge is also available in its two stages, extract and remerge ([MCB25] Proposition 1.4.2), so that several copies can wait on the stack of the workspace.

  • em (side : Edge) (item : SyntacticObject) : Step

    External Merge, the new item as the daughter on side.

  • im (mover : SyntacticObject) (side : Edge := Edge.left) : Step

    Internal Merge raises mover to the daughter on side, the left unless stated otherwise, leaving the trace of its head in its place.

  • extract (mover : SyntacticObject) : Step

    The unit stage of Internal Merge puts a copy of mover on top of the stack, leaving the trace of its head in its place.

  • remerge (side : Edge := Edge.left) : Step

    The copy on top of the stack merges back as the daughter on side.

Instances For
    structure Minimalist.Derivation.Cfg (α : Type u_1) :
    Type u_1

    A configuration of a derivation is the object under construction and the stack of copies extracted from it, the top first.

    • current : α

      The object under construction.

    • stack : List α

      The extracted copies not yet merged back, the top first.

    Instances For
      def Minimalist.Derivation.Cfg.map {α : Type u_1} {β : Type u_2} (f : α → β) (c : Cfg α) :
      Cfg β

      A map applied to the object and to every copy on the stack.

      Equations
      Instances For
        @[simp]
        theorem Minimalist.Derivation.Cfg.map_current {α : Type u_1} {β : Type u_2} (f : α → β) (c : Cfg α) :
        (map f c).current = f c.current
        @[simp]
        theorem Minimalist.Derivation.Cfg.map_stack {α : Type u_1} {β : Type u_2} (f : α → β) (c : Cfg α) :
        (map f c).stack = List.map f c.stack

        The object a step builds from the current one, the copies on the stack aside. External Merge adds the item on the given side, Internal Merge merges the remainder and the mover, leaving the trace of its head under τ, and an extraction leaves the remainder. remerge needs the stack (Step.run).

        Equations
        Instances For

          A step on a configuration. An extraction pushes the mover's copy onto the stack, remerge merges the copy on top back by External Merge, and the other steps leave the stack alone.

          Equations
          Instances For
            theorem Minimalist.Step.apply_em_left {τ : SyntacticObject → Option LexicalItem.Token} (item current : SyntacticObject) :
            (em Edge.left item).apply current τ = item.merge current
            theorem Minimalist.Step.apply_em_right {τ : SyntacticObject → Option LexicalItem.Token} (item current : SyntacticObject) :
            (em Edge.right item).apply current τ = current.merge item
            theorem Minimalist.Step.apply_im {τ : SyntacticObject → Option LexicalItem.Token} (mover : SyntacticObject) (side : Edge) (current : SyntacticObject) :
            (im mover side).apply current τ = (mover.deleteAccessible current τ).merge mover
            theorem Minimalist.Step.apply_em {τ : SyntacticObject → Option LexicalItem.Token} (side : Edge) (item current : SyntacticObject) :
            (em side item).apply current τ = item.merge current

            The sides build the same object; they differ only at externalization.

            The mover of an Internal-Merge step or an extraction.

            Equations
            Instances For
              @[simp]
              theorem Minimalist.Step.mover?_em (side : Edge) (item : SyntacticObject) :
              (em side item).mover? = none
              @[simp]
              theorem Minimalist.Step.mover?_im (mover : SyntacticObject) (side : Edge) :
              (im mover side).mover? = some mover
              @[simp]
              theorem Minimalist.Step.leftward_em (side : Edge) (item : SyntacticObject) :
              (em side item).leftward = em Edge.left item
              @[simp]
              theorem Minimalist.Step.leftward_im (mover : SyntacticObject) (side : Edge) :
              (im mover side).leftward = im mover
              @[simp]
              theorem Minimalist.Step.apply_leftward {τ : SyntacticObject → Option LexicalItem.Token} (step : Step) (current : SyntacticObject) :
              step.leftward.apply current τ = step.apply current τ

              A step and its leftward form build the same object.

              theorem Minimalist.Step.run_leftward {τ : SyntacticObject → Option LexicalItem.Token} (step : Step) (c : Derivation.Cfg SyntacticObject) :
              step.leftward.run c τ = step.run c τ

              A step and its leftward form reach the same configuration.

              theorem Minimalist.Step.run_im {τ : SyntacticObject → Option LexicalItem.Token} (mover : SyntacticObject) (side : Edge) (c : Derivation.Cfg SyntacticObject) :
              (im mover side).run c τ = (remerge side).run ((extract mover).run c τ) τ

              Internal Merge is an extraction followed by merging the copy back ([MCB25] Proposition 1.4.2).

              Derivations as workspace Merges #

              A step merges the current object with the items it introduces, beside a spectator workspace of the items still to come. When it matches no accessible term of the spectators, and an Internal Merge raises a uniquely accessible proper term, the step is the algebraic Merge on the workspace (Step.mergeOp_workspace), and a derivation is the iterated algebraic Merge on the workspace of its initial object and its items (mergeOpList_initial). The two stages of Internal Merge, extract and remerge, act on the stack beside the object, which this workspace leaves out, so they are not admissible here.

              The item an External Merge step introduces.

              Equations
              Instances For

                The items a list of steps introduces.

                Equations
                Instances For
                  @[simp]
                  theorem Minimalist.Step.itemsList_cons (step : Step) (steps : List Step) :
                  itemsList (step :: steps) = step.items + itemsList steps

                  A step applies an algebraic Merge at the current object, External Merge with the item or the unit stage followed by External Merge of the remainder with the mover.

                  Equations
                  Instances For

                    A step at the current object is admissible beside a spectator workspace W when it matches no accessible term of W, and an Internal Merge raises a uniquely accessible proper term that is not a trace.

                    Equations
                    Instances For
                      theorem Minimalist.Step.mergeOp_workspace {step : Step} {current : SyntacticObject} {W : Workspace} (h : Admissible current W step) :
                      (step.mergeOp current) (ConnesKreimer.of' (Multiset.map Subtype.val ({current} + step.items + W))) = ConnesKreimer.of' (Multiset.map Subtype.val ({step.apply current} + W))

                      An admissible step is the algebraic Merge on the workspace of the current object, the items it introduces, and the spectators.

                      The algebraic Merges of a list of steps from the current object, composed in order.

                      Equations
                      Instances For

                        Every step of a list is admissible beside the items still to come.

                        Equations
                        Instances For
                          theorem Minimalist.Step.mergeOpList_workspace (steps : List Step) (current : SyntacticObject) :
                          AdmissibleList steps current → (mergeOpList steps current) (ConnesKreimer.of' (Multiset.map Subtype.val ({current} + itemsList steps))) = ConnesKreimer.of' {↑(List.foldl (fun (so : SyntacticObject) (step : Step) => step.apply so) current steps)}

                          Admissible steps compose to the algebraic Merge from the workspace of the current object and the items they introduce to the object they build.

                          theorem Minimalist.Step.foldl_run_of_admissibleList (steps : List Step) (current : SyntacticObject) (st : List SyntacticObject) :
                          AdmissibleList steps current → List.foldl (fun (c : Derivation.Cfg SyntacticObject) (step : Step) => step.run c) { current := current, stack := st } steps = { current := List.foldl (fun (so : SyntacticObject) (step : Step) => step.apply so) current steps, stack := st }

                          Admissible steps leave the stack alone and build what they build on the object.

                          Derivations #

                          An initial syntactic object with a sequence of steps.

                          • initial : SyntacticObject

                            The initial syntactic object (a lexical item, in canonical derivations).

                          • steps : List Step

                            The ordered sequence of Merge/Move steps.

                          Instances For

                            The configuration after every step, under the trace encoder τ.

                            Equations
                            Instances For

                              The object after every step, under the trace encoder τ.

                              Equations
                              Instances For

                                The number of derivation steps.

                                Equations
                                Instances For

                                  The movers of the im and extract steps.

                                  Equations
                                  Instances For

                                    The mover of step i, when that step is an Internal Merge or an extraction.

                                    Equations
                                    Instances For

                                      The first n steps.

                                      Equations
                                      Instances For

                                        The derivation continued by steps.

                                        Equations
                                        Instances For

                                          The object after the first n steps, under the trace encoder τ.

                                          Equations
                                          Instances For
                                            @[simp]
                                            theorem Minimalist.Derivation.final_take {τ : SyntacticObject → Option LexicalItem.Token} (d : Derivation) (n : ℕ) :
                                            (d.take n).final τ = d.stageAt n τ

                                            Extension #

                                            The early stages and the movers of an extended derivation are the original's.

                                            @[simp]
                                            theorem Minimalist.Derivation.length_append (d : Derivation) (steps : List Step) :
                                            (d.append steps).length = d.length + steps.length
                                            @[simp]
                                            theorem Minimalist.Derivation.append_assoc (d : Derivation) (steps steps' : List Step) :
                                            (d.append steps).append steps' = d.append (steps ++ steps')
                                            theorem Minimalist.Derivation.take_append_of_le {d : Derivation} {n : ℕ} (h : n ≤ d.length) (steps : List Step) :
                                            (d.append steps).take n = d.take n

                                            The first n ≤ d.length steps of an extension are d's.

                                            @[simp]
                                            theorem Minimalist.Derivation.take_length_append (d : Derivation) (steps : List Step) :
                                            (d.append steps).take d.length = d
                                            theorem Minimalist.Derivation.stageAt_append_of_le {τ : SyntacticObject → Option LexicalItem.Token} {d : Derivation} {n : ℕ} (h : n ≤ d.length) (steps : List Step) :
                                            (d.append steps).stageAt n τ = d.stageAt n τ
                                            theorem Minimalist.Derivation.run_append {τ : SyntacticObject → Option LexicalItem.Token} (d : Derivation) (steps : List Step) :
                                            (d.append steps).run τ = List.foldl (fun (c : Cfg SyntacticObject) (step : Step) => step.run c τ) (d.run τ) steps
                                            @[simp]
                                            theorem Minimalist.Derivation.movedItems_append (d : Derivation) (steps : List Step) :
                                            (d.append steps).movedItems = d.movedItems ++ List.filterMap Step.mover? steps
                                            theorem Minimalist.Derivation.lt_length_of_mem_mover? {d : Derivation} {i : ℕ} {m : SyntacticObject} (h : m ∈ d.mover? i) :
                                            i < d.length

                                            A step at index i has a mover only if i indexes a step.

                                            The mover of a step is one of the derivation's movers.

                                            theorem Minimalist.Derivation.mover?_append_of_lt {d : Derivation} {i : ℕ} (h : i < d.length) (steps : List Step) :
                                            (d.append steps).mover? i = d.mover? i

                                            The early steps of an extension have the original's movers.

                                            The sides of Merge #

                                            The node being commutative, the derived object does not depend on the sides at which the steps attach their daughters; leftward is the normal form, and the stages and movers of a derivation are those of its normal form.

                                            The derivation with every new daughter on the left.

                                            Equations
                                            Instances For
                                              @[simp]

                                              The items a derivation introduces by External Merge.

                                              Equations
                                              Instances For

                                                A derivation is admissible when each of its steps is, beside the items still to come.

                                                Equations
                                                Instances For

                                                  An admissible derivation is the iterated algebraic Merge on the workspace of its initial object and its items: the composite of its steps' Merges sends that workspace to its final object.

                                                  Carrier tests #