Documentation

Linglib.Morphology.Nanosyntax.TreeSpellout

Nanosyntax: Tree-Based Spellout #

Extension of rank-based Superset spellout (Morphology/Exponence/Containment/Contiguity.lean) to tree-structured spellout. Implements the Superset Principle (SP) for trees: a lexical entry M ↔ S' can spell out syntactic target S if S' structurally contains S (NanoTree.Contains). Among matching entries, the Elsewhere Condition selects the smallest (by tree size).

The SP on trees is a consequence of [Sta09a]'s Matching relation (formalized in [TTML18] as (35)): M matches S iff there exists a node N in M's stored tree such that S and N have the same root label and mutually matching daughters. For the right-branching single-daughter trees used in Bantu class prefix analysis, structural containment and bidirectional Matching coincide; the implementation uses containment as the simpler equivalent formulation.

Main declarations #

Morphological type of an exponent derived from nanosyntactic spellout. Suffixes arise from spellout-driven movement (roll-up, unary foot); prefixes arise from subderivation (binary foot) — [Dek21] for this diagnostic on indefinite markers.

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

      NanoTree #

      inductive Morphology.Nanosyntax.NanoTree (F : Type u_1) :
      Type u_1

      A nanosyntactic feature tree. Simpler than Syntax — no traces, no binding, no category/word split. Just labeled nodes with an ordered list of daughters.

      leaf f = a terminal feature. node f children = feature f dominating daughters.

      Instances For
        partial def Morphology.Nanosyntax.instReprNanoTree.repr {F✝ : Type u_1} [Repr F✝] :
        NanoTree F✝Std.Format
        @[instance_reducible]
        instance Morphology.Nanosyntax.instReprNanoTree {F✝ : Type u_1} [Repr F✝] :
        Repr (NanoTree F✝)
        Equations

        Decidable equality #

        Defined by structural recursion (not deriving DecidableEq, which routes the nested List through well-founded recursion and does not kernel-reduce; decide-style spellout evaluations need the structural form).

        def Morphology.Nanosyntax.NanoTree.decEq {F : Type u_1} [DecidableEq F] (s t : NanoTree F) :
        Decidable (s = t)

        Structural decidable equality on trees.

        Equations
        Instances For
          def Morphology.Nanosyntax.NanoTree.decEq.decEqList {F : Type u_1} [DecidableEq F] (cs ds : List (NanoTree F)) :
          Decidable (cs = ds)

          Structural decidable equality on daughter lists.

          Equations
          Instances For

            Size #

            Number of nodes in the tree. Used by the Elsewhere Condition to select the smallest matching entry.

            Equations
            Instances For

              Containment (Superset Principle on trees) #

              Contains self target: target occurs in self as a sub-constituent. Implements the tree-generalized Superset Principle ([Cah09] §2.2, [TTML18] (36)): entry M matches target S if M's stored tree contains S.

              For right-branching single-daughter trees (all Bantu class prefix structures), this is equivalent to the bidirectional Matching relation ([TTML18] (35)).

              For 1D chains: a chain of depth n contains all chains of depth k ≤ n, matching SpanRule.Matches (chain_contains_iff_le).

              Instances For
                @[simp]
                theorem Morphology.Nanosyntax.NanoTree.contains_leaf_iff {F : Type u_1} {f : F} {t : NanoTree F} :
                (leaf f).Contains t leaf f = t
                theorem Morphology.Nanosyntax.NanoTree.contains_node_iff {F : Type u_1} {f : F} {cs : List (NanoTree F)} {t : NanoTree F} :
                (node f cs).Contains t node f cs = t ccs, c.Contains t
                def Morphology.Nanosyntax.NanoTree.decContains {F : Type u_1} [DecidableEq F] (s t : NanoTree F) :
                Decidable (s.Contains t)

                Structural decision procedure for containment (kernel-reducible).

                Equations
                Instances For
                  def Morphology.Nanosyntax.NanoTree.decContains.decAny {F : Type u_1} [DecidableEq F] (cs : List (NanoTree F)) (t : NanoTree F) :
                  Decidable (∃ ccs, c.Contains t)

                  Does some member of cs contain t?

                  Equations
                  Instances For
                    @[instance_reducible]
                    instance Morphology.Nanosyntax.NanoTree.instDecidableContainsOfDecidableEq {F : Type u_1} [DecidableEq F] (s t : NanoTree F) :
                    Decidable (s.Contains t)
                    Equations
                    theorem Morphology.Nanosyntax.NanoTree.Contains.trans {F : Type u_1} {a b c : NanoTree F} (h₁ : a.Contains b) (h₂ : b.Contains c) :
                    theorem Morphology.Nanosyntax.NanoTree.le_sizeList_of_mem {F : Type u_1} {cs : List (NanoTree F)} {c : NanoTree F} (h : c cs) :

                    Each daughter's size is bounded by the daughters' total size.

                    theorem Morphology.Nanosyntax.NanoTree.size_lt_of_mem {F : Type u_1} {f : F} {cs : List (NanoTree F)} {c : NanoTree F} (h : c cs) :
                    c.size < (node f cs).size

                    Containment is size-monotone: a contained tree is no larger.

                    theorem Morphology.Nanosyntax.NanoTree.Contains.eq_of_size_le {F : Type u_1} {s t : NanoTree F} (h : s.Contains t) (hs : s.size t.size) :
                    s = t

                    Containment is size-strict off the diagonal: a contained tree of no smaller size is the tree itself.

                    theorem Morphology.Nanosyntax.NanoTree.Contains.antisymm {F : Type u_1} {s t : NanoTree F} (h₁ : s.Contains t) (h₂ : t.Contains s) :
                    s = t

                    The foot of a tree: the feature at the bottom of the leftmost spine. For right-branching chains [Fn [... [F0]]], the foot is F0 — the deepest feature on the functional sequence.

                    Equations
                    Instances For

                      Tree lexical entry #

                      structure Morphology.Nanosyntax.TreeLexEntry (F : Type u_1) (α : Type u_2) :
                      Type (max u_1 u_2)

                      A nanosyntactic lexical entry storing a tree rather than a scalar rank, paired with an exponent of type α (String in concrete fragments). The tree encodes the full feature geometry that the morpheme lexicalizes.

                      Contrast with SpanRule (Morphology/Exponence/Containment/Contiguity.lean) which stores only a span (depth on a 1D functional sequence).

                      • tree : NanoTree F

                        The stored feature tree.

                      • exponent : α

                        The exponent.

                      • morphType : MorphType

                        Morphological type (suffix or prefix).

                      Instances For
                        @[instance_reducible]
                        instance Morphology.Nanosyntax.instReprTreeLexEntry {F✝ : Type u_1} {α✝ : Type u_2} [Repr F✝] [Repr α✝] :
                        Repr (TreeLexEntry F✝ α✝)
                        Equations
                        def Morphology.Nanosyntax.instReprTreeLexEntry.repr {F✝ : Type u_1} {α✝ : Type u_2} [Repr F✝] [Repr α✝] :
                        TreeLexEntry F✝ α✝Std.Format
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Morphology.Nanosyntax.TreeLexEntry.Matches {F : Type u_1} {α : Type u_2} (entry : TreeLexEntry F α) (target : NanoTree F) :

                          A tree-based entry matches a target under the Superset Principle iff its stored tree contains the target as a sub-constituent.

                          Equations
                          Instances For
                            @[instance_reducible]
                            instance Morphology.Nanosyntax.instDecidableMatchesOfDecidableEq {F : Type u_1} {α : Type u_2} [DecidableEq F] (entry : TreeLexEntry F α) (target : NanoTree F) :
                            Decidable (entry.Matches target)
                            Equations

                            The shared exponence core #

                            @[instance_reducible]

                            A tree lexical entry exposes the shared exponence core interface (Morphology.Exponence.Rule): contexts are syntactic targets, applicability is Superset-Principle matching.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            theorem Morphology.Nanosyntax.TreeLexEntry.le_iff {F : Type u_1} {α : Type u_2} {a b : TreeLexEntry F α} :
                            a b b.tree.Contains a.tree

                            The specificity order is reverse containment of the stored trees: a is at least as specific as b exactly when b's tree contains a's. Tree size is therefore a faithful specificity measure (Contains.size_le), which is what licenses smallest-tree selection.

                            Tree spellout (Elsewhere Condition) #

                            def Morphology.Nanosyntax.treeSelect {F : Type u_1} {α : Type u_2} [DecidableEq F] (entries : List (TreeLexEntry F α)) (target : NanoTree F) :
                            Option (TreeLexEntry F α)

                            The matching entry with the smallest stored tree (first-listed on ties): Minimize Junk over tree-generalized Superset matching, as the shared core's Exponence.selectBy at the tree-size score dualized so the smallest tree wins.

                            Equations
                            Instances For
                              def Morphology.Nanosyntax.treeSpellout {F : Type u_1} {α : Type u_2} [DecidableEq F] (entries : List (TreeLexEntry F α)) (target : NanoTree F) :
                              Option α

                              Phrasal spellout via the tree-generalized Superset Principle: among entries whose tree contains the target, select the one with the smallest tree (most specific match).

                              Parallels Morphology.Containment.spellout, but the matching relation is tree containment instead of rank comparison, and the specificity metric is tree size instead of rank.

                              Equations
                              Instances For
                                theorem Morphology.Nanosyntax.treeSelect_isElsewhereWinner {F : Type u_1} {α : Type u_2} [DecidableEq F] {entries : List (TreeLexEntry F α)} {target : NanoTree F} {e : TreeLexEntry F α} (h : treeSelect entries target = some e) :

                                Smallest-tree selection is an Elsewhere winner of the shared core: the dualized-size score is strictly antitone in specificity (size_strictAnti), so a size-minimal match is maximally specific. An instance of selectBy_isElsewhereWinner.

                                theorem Morphology.Nanosyntax.treeSpellout_isElsewhereWinner {F : Type u_1} {α : Type u_2} [DecidableEq F] {entries : List (TreeLexEntry F α)} {target : NanoTree F} {x : α} (h : treeSpellout entries target = some x) :
                                eentries, e.exponent = x Exponence.IsElsewhereWinner entries target e

                                The spelled-out exponent is an Elsewhere winner's exponent.

                                Foot Condition #

                                def Morphology.Nanosyntax.FootConditionMet {F : Type u_1} {α : Type u_2} (entry : TreeLexEntry F α) (syntacticTree : NanoTree F) :

                                The Foot Condition ([TTML18]): the foot of a lexical entry's stored tree must be present as a feature in the syntactic structure being spelled out.

                                If entry M stores [X [...[Z]]], the Foot Condition requires that Z appear in the structure. This constrains backtracking: when spellout fails and the derivation splits the target into specifier + complement, only entries whose foot matches a feature in the remaining structure are eligible.

                                Equations
                                Instances For

                                  Chain trees (bridge to 1D) #

                                  def Morphology.Nanosyntax.chainTree {F : Type u_1} (feat : F) :
                                  NanoTree F

                                  Build a right-branching chain tree of depth n. chainTree feat 0 = leaf (feat 0) chainTree feat 1 = node (feat 1) [leaf (feat 0)] chainTree feat n = node (feat n) [chainTree feat (n-1)]

                                  A chain of depth n is isomorphic to an SpanRule spanning grade n in the 1D nanosyntax.

                                  Equations
                                  Instances For

                                    Bridge theorems #

                                    theorem Morphology.Nanosyntax.chainTree_succ {F : Type u_1} (feat : F) (n : ) :
                                    chainTree feat (n + 1) = NanoTree.node (feat (n + 1)) [chainTree feat n]
                                    theorem Morphology.Nanosyntax.chainTree_size {F : Type u_1} (feat : F) (n : ) :
                                    (chainTree feat n).size = n + 1

                                    Chain tree size is n + 1 (one node per feature level).

                                    theorem Morphology.Nanosyntax.chainTree_foot {F : Type u_1} (feat : F) (n : ) :
                                    (chainTree feat n).foot = feat 0

                                    The foot of a chain tree is always feat 0 — the bottom of the functional sequence.

                                    theorem Morphology.Nanosyntax.chainTree_injective {F : Type u_1} (feat : F) :
                                    Function.Injective (chainTree feat)

                                    Chains of distinct depths are distinct trees, regardless of the feature assignment — depth alone separates them.

                                    theorem Morphology.Nanosyntax.chain_contains_iff_le {F : Type u_1} (feat : F) (re r : ) :
                                    (chainTree feat re).Contains (chainTree feat r) r re

                                    For right-branching chains, tree containment reduces to rank comparison: a chain of depth re contains a chain of depth r iff r ≤ re. This is exactly the matching condition of the rank-based SpanRule.Matches, establishing that tree-based spellout generalizes (not replaces) rank-based spellout.

                                    Unlike the previous Bool formulation, no injectivity of feat is needed: chain depth alone drives both directions.

                                    Rose-tree interface instances #

                                    NanoTree joins the Core.Order.Branching tower. The structural size/decEq/decContains above remain the kernel-computable specializations ([file-level generality discipline]: WF-derived generics do not kernel-reduce, so decide-style spell-out evaluations need the structural forms).

                                    @[instance_reducible]
                                    Equations
                                    • One or more equations did not get rendered due to their size.