Documentation

Linglib.Theories.Syntax.Minimalism.Formal.MCB2023.Accessible

Subtree extraction #

Internal node count (= nodeCount from SyntacticObjects.lean)

Leaf multisets (frontier tokens) #

The multiset of leaf tokens at the frontier of an SO

Equations
Instances For

    Leaf multiset as a Multiset — the mathematically correct type (frontier token identity is order-independent).

    Equations
    Instances For

      Accessible terms (Definition 2.4) #

      For a tree T, the accessible terms are the leaf-sets of subtrees rooted at internal nodes. That is, for each internal node v, we take L(T_v) = the leaf multiset of the subtree rooted at v.

      Accessible terms: leaf-multisets of subtrees at internal nodes

      Equations
      Instances For

        Accessible terms as Multiset of Multisets — order-independent identity.

        Equations
        Instances For

          Number of accessible terms = number of internal nodes

          Workspace counting (Definition 2.4, equations 2.8–2.9) #

          A workspace (forest) is a list of SOs = the connected components.

          b₀(F): number of connected components = List.length

          Equations
          Instances For

            Total accessible terms across all trees in forest

            Equations
            Instances For

              σ(F) = b₀(F) + #Acc(F) (eq 2.8)

              Equations
              Instances For

                Total internal nodes across all trees in forest

                Equations
                Instances For

                  σ̂(F) = b₀(F) + #V(F) (eq 2.9)

                  Equations
                  Instances For

                    numAcc and numVertices agree: accessible term count = internal node count per tree, so the sums coincide.

                    σ̂ = σ since #Acc = #V (both equal total nodeCount)

                    Depth of a subtree occurrence #

                    Depth of β in α (0 if β = α, +1 per level)

                    Equations
                    Instances For

                      Proposition 2.17: Counting behavior of EM vs IM #

                      External Merge takes two trees T₁, T₂ from workspace F and creates merge(T₁, T₂), reducing components by 1 and adding a new root node.

                      Internal Merge takes a tree T from F with a contained subtree β, re-merging β at the root: merge(β, T), keeping the same components.

                      List filter/count helpers #

                      External Merge: workspace goes from F to F' where T₁,T₂ ∈ F replaced by merge(T₁,T₂)

                      Equations
                      Instances For

                        Internal Merge: workspace goes from F to F' where T ∈ F replaced by merge(β, T)

                        Equations
                        Instances For
                          theorem Minimalism.em_b0_decreases {F : List SyntacticObject} (T₁ T₂ : SyntacticObject) (hT₁ : T₁ F) (hT₂ : T₂ F) (hne : T₁ T₂) (huniq₁ : List.count T₁ F = 1) (huniq₂ : List.count T₂ F = 1) :
                          b₀ (emWorkspace T₁ T₂ F) = b₀ F - 1

                          EM: b₀ decreases by 1 (two components become one)

                          theorem Minimalism.em_acc_increases {F : List SyntacticObject} (T₁ T₂ : SyntacticObject) (hT₁ : T₁ F) (hT₂ : T₂ F) (hne : T₁ T₂) (huniq₁ : List.count T₁ F = 1) (huniq₂ : List.count T₂ F = 1) :
                          numAcc (emWorkspace T₁ T₂ F) = numAcc F + 1

                          EM: accessible terms increase by 2 (new root adds one for each child subtree plus the root itself, but the children's accessible terms are preserved)

                          theorem Minimalism.em_wsSize_change {F : List SyntacticObject} (T₁ T₂ : SyntacticObject) (hT₁ : T₁ F) (hT₂ : T₂ F) (hne : T₁ T₂) (huniq₁ : List.count T₁ F = 1) (huniq₂ : List.count T₂ F = 1) :
                          wsSize (emWorkspace T₁ T₂ F) = wsSize F

                          EM: σ increases by 1 (Δb₀ = -1, Δ#Acc = +1, net = 0... but σ = b₀ + #Acc so Δσ = -1 + 1 = 0 — actually MCB2023 Table says Δσ = +1 for EM. This is because Δ#Acc = +2 in their counting.

                          theorem Minimalism.im_b0_preserved {F : List SyntacticObject} (T β : SyntacticObject) (hT : T F) (hβT : contains T β) (huniq : List.count T F = 1) :
                          b₀ (imWorkspace T β F) = b₀ F

                          IM: b₀ preserved (same number of components)

                          theorem Minimalism.im_acc_change {F : List SyntacticObject} (T β : SyntacticObject) (hT : T F) (hβT : contains T β) (huniq : List.count T F = 1) :

                          IM: accessible terms increase by 1 + β.nodeCount.

                          merge(β, T) =.node β T has nodeCount = 1 + β.nodeCount + T.nodeCount. Since T is replaced in the forest, the net change in numVertices (= numAcc) is 1 + β.nodeCount. Note: β's subtree is duplicated (it remains inside T and also appears as a new child of the root). In MCB2023's sharing model β would not be duplicated and the change would be just +1; here we track the tree-copy semantics faithfully.

                          theorem Minimalism.im_wsSizeAlt_change {F : List SyntacticObject} (T β : SyntacticObject) (hT : T F) (hβT : contains T β) (huniq : List.count T F = 1) :

                          IM: σ̂ increases by 1 + β.nodeCount.

                          wsSizeAlt = b₀ + numVertices. Under IM, b₀ is preserved and numVertices increases by 1 + β.nodeCount (see im_acc_change).

                          Corollary 2.22: Sideward/Countercyclic Merge violates constraints #

                          Sideward Merge: merge(β, T₂) where β is contained in T₁, and T₁ ≠ T₂. This extracts a subterm from one tree and merges it with another.

                          Countercyclic Merge: merge(T₁, T₂) where one is contained in the other but NOT as a root constituent.

                          Sideward Merge condition: β is in T₁, we merge β with T₂

                          Instances For

                            Sideward Merge workspace: remove nothing (β stays in T₁), add merge(β, T₂)

                            Equations
                            Instances For

                              Sideward Merge violates b₀ preservation: it adds a component without removing one. This is the key constraint violation that distinguishes it from standard EM/IM.

                              Bridge: counting behavior consistent with EM/IM trichotomy #

                              The counting characterization aligns with the order-theoretic partition from MergeUnification.lean.

                              theorem Minimalism.em_counting_from_trichotomy (α β : SyntacticObject) (F : List SyntacticObject) (h : ¬contains α β ¬contains β α) (hne : α β) ( : α F) ( : β F) (huniqα : List.count α F = 1) (huniqβ : List.count β F = 1) :
                              b₀ (emWorkspace α β F) = b₀ F - 1

                              When α and β are incomparable (EM case), merge reduces component count by 1. Requires uniqueness of α and β in F (each appears exactly once).

                              theorem Minimalism.im_counting_from_trichotomy (α β : SyntacticObject) (F : List SyntacticObject) (h : contains α β) ( : α F) (huniq : List.count α F = 1) :
                              b₀ (imWorkspace α β F) = b₀ F

                              When one contains the other (IM case), merge preserves component count. Requires uniqueness of α in F.