Documentation

Linglib.Core.Combinatorics.RootedTree.Counting

Size counting on nonplanar rooted trees and workspaces #

The MCB size measures for syntactic-object combinatorics ([MCB25]), on the canonical Nonplanar carrier. A workspace (forest) is a Multiset (Nonplanar α); MCB foregrounds the measures b₀/α/σ on workspaces (eq. 1.6.1), with a single tree as the one-component case. The tree-level accCount is the recursive primitive that α folds over.

These build directly on the lifted Nonplanar.numNodes (= MCB's #V); the legacy planar Decorated/AdmissibleCut substrate provided the same measures over the unfaithful planar-binary TraceTree.

Main definitions #

Main results #

TODO #

def RootedTree.Nonplanar.accCount {α : Type u_1} (t : Nonplanar α) :

The accessible-term count α(T) = #V(T) - 1: every vertex of a syntactic object except its root (MCB eq. 1.2.5).

Equations
Instances For
    @[simp]
    theorem RootedTree.Nonplanar.accCount_leaf {α : Type u_1} (a : α) :
    (leaf a).accCount = 0
    theorem RootedTree.Nonplanar.accCount_merge {α : Type u_1} (a : α) (l r : Nonplanar α) :
    (node a {l, r}).accCount = l.accCount + r.accCount + 2

    External Merge of two syntactic objects adds exactly two accessible terms (MCB Lemma 1.6.3, eq. 1.6.5).

    Workspace (forest) measures #

    A workspace is a Multiset (Nonplanar α). MCB's primitive workspace measures are b₀ (component count) and α (accessible terms); σ is derived.

    def RootedTree.Forest.b₀ {α : Type u_1} (F : Multiset (Nonplanar α)) :

    The number of component trees in a workspace — MCB's b₀, the Betti number b₀(F) = #I (eq. 1.6.1).

    Equations
    Instances For
      @[simp]
      theorem RootedTree.Forest.b₀_zero {α : Type u_1} :
      b₀ 0 = 0
      @[simp]
      theorem RootedTree.Forest.b₀_cons {α : Type u_1} (T : Nonplanar α) (F : Multiset (Nonplanar α)) :
      b₀ (T ::ₘ F) = b₀ F + 1
      @[simp]
      theorem RootedTree.Forest.b₀_singleton {α : Type u_1} (T : Nonplanar α) :
      b₀ {T} = 1
      @[simp]
      theorem RootedTree.Forest.b₀_add {α : Type u_1} (F G : Multiset (Nonplanar α)) :
      b₀ (F + G) = b₀ F + b₀ G
      def RootedTree.Forest.alpha {α : Type u_1} (F : Multiset (Nonplanar α)) :

      Total accessible terms across the workspace, α(F) = Σ α(Tᵢ) (eq. 1.2.4).

      Equations
      Instances For
        @[simp]
        theorem RootedTree.Forest.alpha_zero {α : Type u_1} :
        alpha 0 = 0
        @[simp]
        theorem RootedTree.Forest.alpha_cons {α : Type u_1} (T : Nonplanar α) (F : Multiset (Nonplanar α)) :
        alpha (T ::ₘ F) = T.accCount + alpha F
        @[simp]
        theorem RootedTree.Forest.alpha_singleton {α : Type u_1} (T : Nonplanar α) :
        alpha {T} = T.accCount
        @[simp]
        theorem RootedTree.Forest.alpha_add {α : Type u_1} (F G : Multiset (Nonplanar α)) :
        alpha (F + G) = alpha F + alpha G
        def RootedTree.Forest.sigma {α : Type u_1} (F : Multiset (Nonplanar α)) :

        Workspace size σ(F) = b₀(F) + α(F) (MCB eq. 1.6.1): components plus accessible terms. For trace-free workspaces this is the total vertex count (sigma_eq_sum_numNodes); it is not the vertex count for contraction quotients (a trace leaf is a vertex but not an accessible term, MCB p.66).

        Equations
        Instances For
          @[simp]
          theorem RootedTree.Forest.sigma_zero {α : Type u_1} :
          sigma 0 = 0
          @[simp]
          theorem RootedTree.Forest.sigma_cons {α : Type u_1} (T : Nonplanar α) (F : Multiset (Nonplanar α)) :
          sigma (T ::ₘ F) = T.numNodes + sigma F
          @[simp]
          theorem RootedTree.Forest.sigma_add {α : Type u_1} (F G : Multiset (Nonplanar α)) :
          sigma (F + G) = sigma F + sigma G
          theorem RootedTree.Forest.sigma_eq_sum_numNodes {α : Type u_1} (F : Multiset (Nonplanar α)) :
          sigma F = (Multiset.map Nonplanar.numNodes F).sum

          σ(F) = #V(F), the total vertex count (MCB eq. 1.2.6). Unconditional on the generic carrier, where every accCount is numNodes − 1; the contraction-quotient exception lives in TraceCounting.