Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Latest commit

 

History

History
223 lines (132 loc) · 14.9 KB

File metadata and controls

223 lines (132 loc) · 14.9 KB

Formal Definitions: The Nested Semantic Graph

Nodes, Edges, Ultrametric Distance, and Tree-Alignment Lattices

Version: 0.2 Date: 2026-05-22 Status: First formalization Depends on: 0.1.md (Internal Literature Review) Grounded in: Few Become One $\S$V (DOI: 10.5281/zenodo.20328374), Tree Distance Cophenetic $\S$2 (DOI: 10.5281/zenodo.20213043), Q-PNA $\S$2-3 (DOI: 10.5281/zenodo.20287742)


1. Introduction

This document provides the formal mathematical definitions for the Nested Semantic Graph (NSG) — a language-neutral representation of meaning as an ultrametric tree of conceptual primitives. The definitions are grounded in three prior works:

  • Few Become One $\S$V — the conceptual proposal: "represent text as a tree of nested concepts rather than a flat sequence of tokens" (V.B), with nodes as conceptual primitives and edges encoding scope/modification relationships
  • Tree Distance Cophenetic $\S$2 — the formal proof that cophenetic distance $d(x,y) = h(\text{lca}(x,y))$ satisfies the ultrametric inequality and implies triadic rigidity
  • Q-PNA $\S$2-3 — the computational architecture: p-adic valuation encoding maps tokens to leaves of a Bruhat-Tits tree; the ultrametric attention mechanism computes distances without learned parameters

All definitions below are accompanied by Python verification in 0.2.py.


2. Conceptual Primitives: Nodes

Definition 1 (Conceptual Primitive). A conceptual primitive is an atomic unit of meaning corresponding roughly to the semantic content carried by an individual morpheme, regardless of whether that morpheme is a free-standing word (as in isolating languages) or a bound affix (as in polysynthetic languages).

Definition 2 (Node). A node $n$ in a nested semantic graph is a labeled vertex representing exactly one conceptual primitive. The label $\lambda(n)$ identifies the semantic category of the primitive.

Definition 3 (Node Categories). Nodes belong to one of the following semantic categories $\mathcal{C}$:

$$\mathcal{C} = {\text{ENTITY}, \text{ACTION}, \text{TENSE}, \text{ASPECT}, \text{EVIDENTIAL}, \text{LOCATIVE}, \text{MANNER}, \text{LOGICAL}}$$

Category Description Example Labels
ENTITY Participants in an event dog, man, stick
ACTION The event or process itself bite, run, give
TENSE Temporal frame past, present, future
ASPECT Internal temporal structure completive, progressive, iterative
EVIDENTIAL Source of information witnessed, reported, inferred
LOCATIVE Spatial reference here, there, upward
MANNER How the action is performed quickly, together, repeatedly
LOGICAL Logical relations between propositions because, if, although

Definition 4 (Node Set). The set of all nodes in a semantic graph is denoted $V(G)$.


3. Scope and Modification: Edges

Definition 5 (Scope Edge). An ordered pair $(a, b)$ with $a, b \in V(G)$ is a scope edge if node $a$ modifies, specifies, or is an argument of node $b$. We write $a \to b$ and say "$a$ is in the scope of $b$."

Definition 6 (Argument Edge). A special case of scope edge where $a$ is a participant (ENTITY) in the event denoted by $b$ (ACTION). We write $a \xrightarrow{\text{arg}} b$. The argument role is specified by a label on the edge: $\text{agent}, \text{patient}, \text{instrument}, \text{recipient}$.

Definition 7 (Modifier Edge). A scope edge where $a$ provides additional specification (TENSE, ASPECT, EVIDENTIAL, LOCATIVE, MANNER) for $b$. We write $a \xrightarrow{\text{mod}} b$.

Definition 8 (Root Node). The root of a nested semantic graph is the unique node $r \in V(G)$ with no outgoing edges (i.e., it is not in the scope of any other node). In an event description, the ACTION node is the root.

Definition 9 (Leaf Node). A node with no incoming edges (i.e., nothing is in its scope).


4. The Nested Semantic Tree

Definition 10 (Nested Semantic Tree). A nested semantic tree (NST) is a triple $T = (V, E, r)$ where:

  • $V$ is a finite set of nodes (Definition 2)
  • $E \subseteq V \times V$ is a set of directed scope edges (Definition 5)
  • $r \in V$ is the unique root node (Definition 8)
  • The directed graph $(V, E)$ forms a rooted tree: every node $v \in V \setminus {r}$ has exactly one outgoing edge, and there is a unique directed path from any node to $r$
  • For all $(a, b) \in E$, $a$ is in the scope of $b$

Definition 11 (Height Function). A height function on a tree $T$ is a mapping $h: V \to \mathbb{R}_{\geq 0}$ satisfying:

  1. $h(r) = H$ where $H > 0$ is the height of the tree
  2. For any edge $a \to b$, $h(a) < h(b)$ (children are strictly lower than parents)
  3. For leaf nodes $\ell$, $h(\ell) = 0$

Definition 12 (Lowest Common Ancestor). For nodes $x, y \in V$, their lowest common ancestor $\text{lca}(x, y)$ is the unique node $z \in V$ such that:

  1. Both $x$ and $y$ are in the subtree rooted at $z$ (i.e., there are directed paths from $x$ to $z$ and from $y$ to $z$)
  2. No proper descendant of $z$ satisfies condition (1)

Equivalently, $\text{lca}(x, y)$ is the deepest node on the unique path from $x$ to $r$ that is also on the unique path from $y$ to $r$.


5. Ultrametric Distance

Definition 13 (Ultrametric Distance on an NST). For nodes $x, y \in V$ in a nested semantic tree $T$, the ultrametric distance is:

$$d_T(x, y) = h(\text{lca}(x, y))$$

That is, the distance between two nodes is the height of their lowest common ancestor — a measure of how far back toward the root one must travel before the two nodes' ancestral paths converge.

Intuition: Two morphemes within the same polysynthetic word-sentence share a shallow LCA (the word-level root), so $d_T$ is small. Two words in different phrases of an English sentence share a deeper LCA (the sentence-level root), so $d_T$ is larger. The distance measures structural proximity, not surface adjacency.

Theorem 1 (Ultrametric Inequality). For any three nodes $x, y, z \in V$:

$$d_T(x, z) \leq \max{d_T(x, y), d_T(y, z)}$$

Proof. (Following Tree Distance Cophenetic $\S$2.) Let $u = \text{lca}(x, y)$, $v = \text{lca}(y, z)$, and $w = \text{lca}(x, z)$. Observe that $u$ and $v$ are both ancestors of $y$, so one is an ancestor of the other. Without loss of generality, assume $h(u) \leq h(v)$, so $u$ is an ancestor of $v$.

Now $w$ must be at least as deep as $v$, because $v$ is a common ancestor of $x$ and $z$ (it is an ancestor of $y$, which is a descendant of the path from $v$ to both $x$ and $z$). Therefore $h(w) \leq h(v)$. Since $d_T(x, z) = h(w)$ and $\max{d_T(x, y), d_T(y, z)} = \max{h(u), h(v)} = h(v)$, we have:

$$d_T(x, z) = h(w) \leq h(v) = \max{h(u), h(v)} = \max{d_T(x, y), d_T(y, z)}$$

$\square$

Corollary 1 (Triadic Rigidity). For any three nodes $x, y, z$, the two largest of ${d_T(x, y), d_T(y, z), d_T(x, z)}$ are equal. Every triangle is isosceles with the base no longer than the equal sides.

Proof. This follows directly from the ultrametric inequality and is verified computationally in 0.2.py. $\square$

Property 1 (All Triangles Are Isosceles). Let $d_1 = d_T(x, y)$, $d_2 = d_T(y, z)$, $d_3 = d_T(x, z)$. Order them: $d_{(1)} \leq d_{(2)} \leq d_{(3)}$. Then $d_{(2)} = d_{(3)}$. There are no scalene triangles in an ultrametric space.

Property 2 (Balls Are Clopen). For any $\epsilon > 0$ and any $x \in V$, the open ball $B(x, \epsilon) = {y : d_T(x, y) < \epsilon}$ is also closed. There is no "boundary" in the usual sense — containment is all-or-nothing.

Property 3 (Nesting). Two ultrametric balls are either disjoint or one contains the other. Partial overlap is impossible. This is the geometric basis for the Threshold Principle (How Geometry Creates Memory, DOI: 10.5281/zenodo.20061155).


6. Semantic Scope and Tree Topology

Definition 14 (Scope Depth). For a node $v \in V$, its scope depth $\delta(v)$ is the length of the unique directed path from $v$ to the root $r$. The scope depth measures how deeply embedded a node is within the semantic hierarchy.

Definition 15 (Conceptual Distance). For two conceptual primitives represented by nodes $x, y$, the conceptual distance is exactly the ultrametric distance $d_T(x, y)$. Two concepts are conceptually close if they share a shallow common ancestor — if they differentiate late in the semantic hierarchy.

Example. In the semantic graph for "dog bit man yesterday":

  • Nodes dog[agent] and man[patient] share LCA bite[action] (the event root). Their distance is $h(\text{bite})$.
  • Nodes dog[agent] and yesterday[tense] also share LCA bite[action]. Their distance is the same.
  • The ultrametric structure captures that both arguments are equally close to the event — there is no "the agent is closer than the patient" in the tree, which reflects the semantic symmetry of participation.

7. The Tree-Alignment Lattice

Definition 16 (Tree-Alignment Lattice). Given two nested semantic trees $T_1 = (V_1, E_1, r_1)$ and $T_2 = (V_2, E_2, r_2)$, a tree-alignment lattice $\mathcal{L}(T_1, T_2)$ is a rooted tree whose leaves correspond to pairs $(v_1, v_2) \in V_1 \times V_2$ and whose internal nodes represent alignments between subtrees of $T_1$ and $T_2$.

Definition 17 (Graph Distance). The ultrametric graph distance between two nested semantic trees is:

$$D(T_1, T_2) = h_{\mathcal{L}}(\text{lca}_{\mathcal{L}}(T_1, T_2))$$

where $h_{\mathcal{L}}$ is the height function on the tree-alignment lattice and $\text{lca}_{\mathcal{L}}$ is the LCA in that lattice.

Definition 18 (Sub-Graph Matching). Given a query graph $G_q$ (a nested semantic tree) and a document graph $G_d$, a match is a subtree isomorphism $\phi: G_q \to G_d$ preserving node labels and edge directions. The match distance is:

$$D_{\text{match}}(G_q, G_d) = \min_{\phi} D(G_q, \phi(G_q))$$

where the minimum is taken over all valid subtree isomorphisms. A perfect match has $D_{\text{match}} = 0$; partial matches have $D_{\text{match}} > 0$ reflecting the structural divergence.

Definition 19 (Ranking). For a query graph $G_q$ and a document corpus ${G_d^{(1)}, \ldots, G_d^{(N)}}$, results are ranked by increasing match distance $D_{\text{match}}(G_q, G_d^{(i)})$. The ultrametric inequality guarantees that results form nested clusters rather than a continuous spectrum — there are natural "cut points" in the ranking.


8. Connection to Cophenetic Distance

Proposition 1 (Equivalence). The ultrametric distance on a nested semantic tree (Definition 13) is exactly the cophenetic distance defined in Tree Distance Cophenetic $\S$2:

$$d_T(x, y) = h(\text{lca}(x, y)) = \text{cophenetic}(x, y)$$

All theorems from Tree Distance Cophenetic apply directly to the NSG formalism.

Proposition 2 (Resolution-Dependence). The height function $h$ is a resolution parameter. At resolution $R$, all nodes with $h(v) \leq R$ are indistinguishable — they form a single ultrametric ball. As resolution increases, finer distinctions emerge. This is the semantic analogue of the renormalization group.


9. Connection to Syntactic Token Calculus

Definition 20 (Token Encoding, from Q-PNA $\S$3.2). Each conceptual primitive (node) is mapped to a semantic prime set, then to a prime product, then to a valuation vector:

  1. Semantic prime assignment: Node label $\lambda(n)$ determines semantic primes $p_1, \ldots, p_k$ with strengths $f_i(n)$
  2. Prime product: $P(n) = \prod_{i=1}^{k} p_i^{f_i(n)}$
  3. Valuation vector: $\vec{v}(n) = (v_{p_1}(P(n)), \ldots, v_{p_k}(P(n))) = (f_1(n), \ldots, f_k(n))$

Proposition 3 (Encoding Preserves Ultrametric Structure). The Q-PNA encoding maps the NST into the Bruhat-Tits tree $\mathcal{T}_p$, and the ultrametric distance on $\mathcal{T}p$ recovers the cophenetic distance on the NST: $d{\mathcal{T}_p}(\vec{v}(x), \vec{v}(y)) = d_T(x, y)$ under appropriate normalization.

Proof sketch: This follows from the tree-p-adic correspondence (Ultrametric Cognition, Proposition 2.5). The valuation vector's $p$-adic metric satisfies the strong triangle inequality, and the LCA in $\mathcal{T}_p$ corresponds to the LCA in the NST. $\square$


10. Language-Neutrality: The Key Property

Definition 21 (Linearization). For a nested semantic tree $T$, a linearization is a total order $\prec$ on the leaf nodes of $T$ that respects the tree structure: for any two leaves $\ell_1, \ell_2$, if $\text{lca}(\ell_1, \ell_2)$ is in the left subtree of some node, then all leaves in the left subtree precede all leaves in the right subtree.

Different languages correspond to different linearizations of the same NST:

Language Linearization Rule Surface Form
English (SVO) Agent precedes action, patient follows "dog bit man yesterday"
Mohawk (polysynthetic) Root verb, prefixes for agent/patient, suffixes for tense/aspect Wakatonhkariá:ton ("I have finished eating")
Turkish (SOV) Agent, patient, action, tense suffix "köpek adamı dün ısırdı"

Theorem 2 (Language Neutrality). For any two languages $L_1$ and $L_2$, and any proposition $P$, the nested semantic trees $T_{L_1}(P)$ and $T_{L_2}(P)$ produced by correct semantic parsing are isomorphic: $T_{L_1}(P) \cong T_{L_2}(P)$. Consequently, the ultrametric distance between any two conceptual primitives is language-invariant.

Proof. This is the core claim of Few Become One $\S$V.B. The proof requires constructing a semantic parser that maps surface forms in any language to the same NST. For the purposes of this document, we treat this as a design goal and verify it for specific examples in 0.2.py. $\square$


11. Python Verification

All definitions above are computationally verified in 0.2.py. The verification suite tests:

  1. Tree construction — Nodes, edges, height, root
  2. LCA computation — Efficient $\mathcal{O}(n \log n)$ preprocessing, $\mathcal{O}(1)$ queries
  3. Ultrametric inequality — Exhaustive verification on all triples
  4. Triadic rigidity — All triangles are isosceles
  5. Language neutrality — English and Mohawk trees are isomorphic
  6. Token encoding — Semantic prime assignment and p-adic valuation

References

  1. Few Become One: Polysynthetic Communication and the Ultrametric Architecture of Language (2026-05-22). DOI: 10.5281/zenodo.20328374. Section V.
  2. The Tree Distance Cophenetic: A Unified Framework for Hierarchical Ontology (2026-05-15). DOI: 10.5281/zenodo.20213043. Section 2.
  3. Q-PNA: Quantum-Native p-Adic Neural Architecture — Research Specification v2.0 (2026-05-19). DOI: 10.5281/zenodo.20287742. Sections 2-3.
  4. How Geometry Creates Memory (2026-05-06). DOI: 10.5281/zenodo.20061155.
  5. Ultrametric Cognition (2026-04). Archive: G:\My Drive\Archive\projects\2026\04\Ultrametric Cognition\. Proposition 2.5.

Formal Definitions v0.2 — Grounded in the published ultrametric-language corpus. Python verification in 0.2.py.