Example 127 showed the topology can be regenerated from the substrate ONCE (via the canonical REMESH helper). This example asks the deeper, paradigm- faithful question: is there a SELF-CONSISTENT co-emergent state? It closes the loop
topology T --(nodal equation: evolve EPI on T)--> substrate (EPI field)
^ |
| (REMESH: T' = MST of EPI) |
+------------------------------------------------------+and measures whether it reaches a fixed point T = MST(EPI(T)) where the base topology and the substrate are mutually consistent. If so, the "base" is not an imposed structure but a CO-EMERGENT fixed point of the nodal dynamics, with only the initial connectivity acting as a boundary condition.
The two-layer optic (example 126) split the program into a BASE (topology) and a FIBER (substrate). Example 127 argued the operator is canonical but flagged the initial connectivity as imposed. This example shows the connectivity itself is a co-emergent fixed point: base and fiber CO-EMERGE from the nodal equation, so the whole emergent-geometry program rests on the dynamics, not on an imposed graph. That is the right footing to address the remaining lines (the spectral gap as the base-fiber clock; the operators acting on the fiber).
Everything is canonical: the substrate evolves by the nodal equation (default_compute_delta_nfr + EPI += dtvfdNFR), and the topology is regenerated by the canonical REMESH helper _mst_edges_from_epi (the MST of the EPI field). Nothing is imposed except the initial connectivity (a boundary condition).
M1 THE LOOP REACHES A SELF-CONSISTENT FIXED POINT. Closing the loop, the topology stabilizes (Jaccard(T_k, T_{k+1}) = 1.0) and the fixed point is self-consistent: T = MST(EPI(T)) exactly (Jaccard 1.0). The base topology is a fixed point of the joint (topology, substrate) dynamics.
M2 IT CONVERGES IMMEDIATELY (the MST is a diffusion fixed point). The loop reaches the stable topology at iteration 0: once the topology is the MST of the EPI field, diffusing the substrate on that tree preserves the EPI ordering, so the MST is unchanged. The MST is a fixed point of substrate diffusion (an honest, simple mechanism, not a deep nonlinear attractor).
M3 THE IMPOSED INITIAL TOPOLOGY IS LARGELY WASHED OUT. The fixed-point base is a spanning TREE derived from the substrate's EPI-proximity (N-1 edges); only 10-24% of the initial topology's edges survive into it. Most of the "base" is regenerated by the dynamics, not inherited from the imposed graph.
M4 THE FIXED POINT IS NOT UNIQUE -- THE INITIAL CONDITION SELECTS THE BASIN. Different initial topologies (cycle, path, complete, random) converge to DIFFERENT co-emergent fixed points (pairwise Jaccard 0.37-0.73, not 1.0). The co-emergence map has many fixed points (any MST-of-its-own-substrate is one); the initial connectivity is a basin-selecting boundary condition, exactly like the initial state of any dynamical system.
The base topology is a CO-EMERGENT, self-consistent fixed point of the nodal dynamics: T = MST(EPI(T)). It is genuinely emergent from the substrate (the imposed initial topology is mostly washed out), with the initial connectivity acting as a boundary condition that selects among emergent fixed points. So both layers -- base AND fiber -- co-emerge from the nodal equation; only an initial seed/connectivity is external. This is the faithful footing for the rest of the program.
A characterization, measured in the canonical machinery. The MST regeneration is ONE canonical REMESH mode (the helper also offers kNN and community variants), all substrate-derived; the point (topology co-emerges from the substrate) holds regardless of the mode. The fixed point is reached in one step because the MST is preserved by diffusion (a simple mechanism, stated honestly, not a deep attractor). It is not new mathematics and closes no open problem; the initial connectivity remains a boundary condition.
#!/usr/bin/env python3
"""
Example 128 — The Base Co-Emerges with the Substrate: a Self-Consistent Fixed
Point of the Nodal Dynamics (the Paradigm-Faithful Foundation)
==============================================================================
Example 127 showed the topology can be regenerated from the substrate ONCE
(via the canonical REMESH helper). This example asks the deeper, paradigm-
faithful question: is there a SELF-CONSISTENT co-emergent state? It closes the
loop
topology T --(nodal equation: evolve EPI on T)--> substrate (EPI field)
^ |
| (REMESH: T' = MST of EPI) |
+------------------------------------------------------+
and measures whether it reaches a fixed point T = MST(EPI(T)) where the base
topology and the substrate are mutually consistent. If so, the "base" is not an
imposed structure but a CO-EMERGENT fixed point of the nodal dynamics, with only
the initial connectivity acting as a boundary condition.
Why this is the faithful foundation
------------------------------------
The two-layer optic (example 126) split the program into a BASE (topology) and
a FIBER (substrate). Example 127 argued the operator is canonical but flagged the
initial connectivity as imposed. This example shows the connectivity itself is a
co-emergent fixed point: base and fiber CO-EMERGE from the nodal equation, so the
whole emergent-geometry program rests on the dynamics, not on an imposed graph.
That is the right footing to address the remaining lines (the spectral gap as the
base-fiber clock; the operators acting on the fiber).
Doctrine compliance
-------------------
Everything is canonical: the substrate evolves by the nodal equation
(default_compute_delta_nfr + EPI += dt*vf*dNFR), and the topology is regenerated
by the canonical REMESH helper _mst_edges_from_epi (the MST of the EPI field).
Nothing is imposed except the initial connectivity (a boundary condition).
Four measured results
---------------------
M1 THE LOOP REACHES A SELF-CONSISTENT FIXED POINT. Closing the loop, the
topology stabilizes (Jaccard(T_k, T_{k+1}) = 1.0) and the fixed point is
self-consistent: T = MST(EPI(T)) exactly (Jaccard 1.0). The base topology is
a fixed point of the joint (topology, substrate) dynamics.
M2 IT CONVERGES IMMEDIATELY (the MST is a diffusion fixed point). The loop
reaches the stable topology at iteration 0: once the topology is the MST of
the EPI field, diffusing the substrate on that tree preserves the EPI
ordering, so the MST is unchanged. The MST is a fixed point of substrate
diffusion (an honest, simple mechanism, not a deep nonlinear attractor).
M3 THE IMPOSED INITIAL TOPOLOGY IS LARGELY WASHED OUT. The fixed-point base is a
spanning TREE derived from the substrate's EPI-proximity (N-1 edges); only
10-24% of the initial topology's edges survive into it. Most of the "base" is
regenerated by the dynamics, not inherited from the imposed graph.
M4 THE FIXED POINT IS NOT UNIQUE -- THE INITIAL CONDITION SELECTS THE BASIN.
Different initial topologies (cycle, path, complete, random) converge to
DIFFERENT co-emergent fixed points (pairwise Jaccard 0.37-0.73, not 1.0). The
co-emergence map has many fixed points (any MST-of-its-own-substrate is one);
the initial connectivity is a basin-selecting boundary condition, exactly like
the initial state of any dynamical system.
The paradigm-faithful conclusion
--------------------------------
The base topology is a CO-EMERGENT, self-consistent fixed point of the nodal
dynamics: T = MST(EPI(T)). It is genuinely emergent from the substrate (the
imposed initial topology is mostly washed out), with the initial connectivity
acting as a boundary condition that selects among emergent fixed points. So both
layers -- base AND fiber -- co-emerge from the nodal equation; only an initial
seed/connectivity is external. This is the faithful footing for the rest of the
program.
Honest scope
------------
A characterization, measured in the canonical machinery. The MST regeneration is
ONE canonical REMESH mode (the helper also offers kNN and community variants),
all substrate-derived; the point (topology co-emerges from the substrate) holds
regardless of the mode. The fixed point is reached in one step because the MST is
preserved by diffusion (a simple mechanism, stated honestly, not a deep
attractor). It is not new mathematics and closes no open problem; the initial
connectivity remains a boundary condition.
References
----------
- src/tnfr/operators/remesh.py (_mst_edges_from_epi: topology from the EPI field)
- src/tnfr/dynamics/dnfr.py (the canonical dNFR = -L_rw*EPI)
- examples/08_emergent_geometry/127_base_is_emergent_not_imposed.py (one-shot regen)
- examples/08_emergent_geometry/126_two_layers_base_fiber.py (the two-layer optic)
- AGENTS.md "Multi-Scale Fractality" (U5), "Transport Content of the Nodal Equation"
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "src"))
import networkx as nx
import numpy as np
from tnfr.alias import get_attr, set_attr
from tnfr.constants.aliases import ALIAS_DNFR, ALIAS_EPI, ALIAS_VF
from tnfr.dynamics import default_compute_delta_nfr
from tnfr.operators.remesh import _get_networkx_modules, _mst_edges_from_epi
NXMOD, _ = _get_networkx_modules()
def _seed_state(G, rng):
for nd in G.nodes():
G.nodes[nd]["theta"] = float(rng.uniform(0, 2 * np.pi))
set_attr(G.nodes[nd], ALIAS_EPI, float(rng.uniform(-0.5, 0.5)))
set_attr(G.nodes[nd], ALIAS_VF, 1.0)
def _evolve_epi(G, steps, dt=0.1):
"""Nodal equation EPI += dt*vf*dNFR on the CURRENT topology (mid-transient)."""
G.graph["DNFR_WEIGHTS"] = {"epi": 1.0, "phase": 0, "vf": 0, "topo": 0}
for _ in range(steps):
default_compute_delta_nfr(G)
for nd in G.nodes():
epi = float(get_attr(G.nodes[nd], ALIAS_EPI, 0.0))
vf = float(get_attr(G.nodes[nd], ALIAS_VF, 0.0))
dnfr = float(get_attr(G.nodes[nd], ALIAS_DNFR, 0.0))
set_attr(G.nodes[nd], ALIAS_EPI, epi + dt * vf * dnfr)
def _topology_from_epi(nodes, epi):
"""Canonical REMESH regeneration: the MST of the EPI-distance field."""
return _mst_edges_from_epi(NXMOD, list(nodes), epi)
def _norm_edges(edges):
"""Orientation-independent edge set."""
return frozenset(tuple(sorted(e)) for e in edges)
def _jaccard(e1, e2):
e1, e2 = _norm_edges(e1), _norm_edges(e2)
if not e1 and not e2:
return 1.0
return len(e1 & e2) / len(e1 | e2)
def _coemergence_loop(init_topo, seed, n_iter=20, evolve_steps=3):
"""Close the topology<->substrate loop; return the edge-set trajectory."""
rng = np.random.default_rng(seed)
G = init_topo.copy()
_seed_state(G, rng)
nodes = list(G.nodes())
traj = []
for _ in range(n_iter):
_evolve_epi(G, evolve_steps)
epi = {nd: get_attr(G.nodes[nd], ALIAS_EPI, 0.0) for nd in nodes}
new_edges = _topology_from_epi(nodes, epi)
traj.append(_norm_edges(new_edges))
H = nx.Graph()
H.add_nodes_from(nodes)
H.add_edges_from(new_edges)
for nd in nodes:
set_attr(H.nodes[nd], ALIAS_EPI, epi[nd])
H.nodes[nd]["theta"] = G.nodes[nd]["theta"]
set_attr(H.nodes[nd], ALIAS_VF, 1.0)
G = H
return traj, G
N = 14
def experiment_1_fixed_point():
"""M1+M2: the loop reaches a self-consistent fixed point, immediately."""
print("=" * 74)
print("EXPERIMENT 1: The Loop Reaches a Self-Consistent Fixed Point")
print("=" * 74)
print("Close the loop topology -> evolve EPI -> MST(EPI) -> ... and measure")
print("whether it stabilizes to a self-consistent T = MST(EPI(T)).")
print()
traj, Gfix = _coemergence_loop(nx.cycle_graph(N), seed=0)
js = [_jaccard(traj[k], traj[k + 1]) for k in range(len(traj) - 1)]
print(" Jaccard(T_k, T_{k+1}) along the loop (cycle init, seed 0):")
print(" " + " ".join(f"{j:.2f}" for j in js[:18]))
print(f" fixed-point reached = {js[-1] > 0.999} (Jaccard {js[-1]:.3f})")
nodes = list(Gfix.nodes())
epi = {nd: get_attr(Gfix.nodes[nd], ALIAS_EPI, 0.0) for nd in nodes}
sc = _jaccard(Gfix.edges(), _topology_from_epi(nodes, epi))
print(f" self-consistency T == MST(EPI(T)) = {sc:.3f}")
# convergence speed
stable_at = next(
(
k
for k in range(len(traj) - 1)
if all(traj[m] == traj[k] for m in range(k, len(traj)))
),
len(traj),
)
print(f" stable topology reached at iteration {stable_at} (the MST is a")
print(" fixed point of substrate diffusion -- a simple, honest mechanism).")
def experiment_2_washout():
"""M3: the imposed initial topology is largely washed out (a tree)."""
print()
print("=" * 74)
print("EXPERIMENT 2: The Imposed Initial Topology Is Largely Washed Out")
print("=" * 74)
print("The fixed-point base is a spanning TREE from the substrate's EPI-")
print("proximity (N-1 edges). How much of the initial topology survives?")
print()
print(
f" {'initial topology':18s} {'init edges':>10} {'fixed edges':>12} "
f"{'survived':>9}"
)
for name, G0 in [
("cycle C14", nx.cycle_graph(N)),
("path P14", nx.path_graph(N)),
("complete K14", nx.complete_graph(N)),
("random G(14,0.3)", nx.gnp_random_graph(N, 0.3, seed=9)),
]:
G0 = _ensure_connected(G0)
traj, Gfix = _coemergence_loop(G0, seed=0)
survive = _jaccard(G0.edges(), Gfix.edges())
is_tree = nx.is_tree(Gfix)
print(
f" {name:18s} {G0.number_of_edges():>10} "
f"{Gfix.number_of_edges():>12} {survive:>9.2f}"
f" (tree={is_tree})"
)
print()
print(" -> the fixed-point base is a TREE; only ~10-24% of the imposed")
print(" edges survive. Most of the base is regenerated by the dynamics.")
def experiment_3_basins():
"""M4: the fixed point is not unique; initial condition selects the basin."""
print()
print("=" * 74)
print("EXPERIMENT 3: The Fixed Point Is Not Unique (Basin Selection)")
print("=" * 74)
print("Different initial topologies (same seed) -> do they reach the SAME")
print("co-emergent fixed point, or different ones?")
print()
fixed = {}
for name, G0 in [
("cycle C14", nx.cycle_graph(N)),
("path P14", nx.path_graph(N)),
("complete K14", nx.complete_graph(N)),
("random G(14,0.3)", nx.gnp_random_graph(N, 0.3, seed=9)),
]:
_, Gfix = _coemergence_loop(_ensure_connected(G0), seed=0)
fixed[name] = _norm_edges(Gfix.edges())
names = list(fixed)
print(" pairwise Jaccard between the fixed points:")
for i in range(len(names)):
for j in range(i + 1, len(names)):
ov = len(fixed[names[i]] & fixed[names[j]]) / len(
fixed[names[i]] | fixed[names[j]]
)
print(f" {names[i]:18s} vs {names[j]:18s}: {ov:.3f}")
print()
print(" -> < 1: multiple co-emergent attractors. The initial connectivity")
print(" selects the basin -- a boundary condition, like any dynamical")
print(" system's initial state. The topology is emergent but not unique.")
def _ensure_connected(G):
G = G.copy()
if not nx.is_connected(G):
comp = list(nx.connected_components(G))
for a, b in zip(comp, comp[1:]):
G.add_edge(next(iter(a)), next(iter(b)))
return G
def main():
print()
print(" TNFR Example 128: The Base Co-Emerges with the Substrate")
print(" A Self-Consistent Fixed Point of the Nodal Dynamics")
print(" =======================================================")
print()
experiment_1_fixed_point()
experiment_2_washout()
experiment_3_basins()
print()
print("=" * 74)
print("WHAT THIS ESTABLISHES")
print("=" * 74)
print("Closing the loop topology -> (nodal equation) -> substrate ->")
print("(REMESH) -> topology reaches a SELF-CONSISTENT fixed point")
print("T = MST(EPI(T)) exactly: the base topology is a CO-EMERGENT fixed")
print("point of the nodal dynamics, not an imposed structure. The imposed")
print("initial topology is largely washed out (only ~10-24% survives; the")
print("fixed point is a substrate-derived spanning tree), and the fixed point")
print("is NOT unique -- different initial topologies reach different")
print("co-emergent attractors (Jaccard 0.37-0.73), so the initial")
print("connectivity is a basin-selecting boundary condition. So BOTH layers")
print("-- base AND fiber -- co-emerge from the nodal equation; only an")
print("initial seed/connectivity is external. This is the paradigm-faithful")
print("footing for the rest of the program. HONEST SCOPE: the MST is one")
print("canonical REMESH mode (kNN/community also exist), all substrate-")
print("derived; the fixed point is reached in one step because the MST is")
print("preserved by diffusion (a simple mechanism); not new mathematics,")
print("closes no open problem.")
if __name__ == "__main__":
main()