Shunyaya Symbolic Mathematical Symbols – Collapse-Safety Contract (1.5)

What this page covers
The core contract that guarantees classical parity under collapse for every operator, with pointwise examples, composition rules, map/reduce corollaries, zero-class display, guards/domains, gate neutrality, and minimal QA checks.

Definition (for every operator s_op)

# collapse map
phi((m, a)) = m

# contract (admissible x, y, ...)
phi( s_op(x, y, ...) ) = classical_op( phi(x), phi(y), ... )

This holds for scalars, vectors, matrices, and tensors (elementwise for maps; structurally for reductions) wherever the corresponding classical operation is defined.

Examples (pointwise)

phi( s_add(x, y) ) = phi(x) + phi(y)
phi( s_mul(x, y) ) = phi(x) * phi(y)
phi( s_pow(x, r) ) = ( phi(x) )^r
phi( s_min(x, y) ) = min( phi(x), phi(y) )

Why the contract holds (construction sketch)

  • Magnitudes follow the classical operation exactly by design.
  • Alignment is combined only in rapidity space and/or via bounded gates; it never feeds back into magnitudes.
  • Therefore phi, which returns magnitudes, reproduces the classical result.

Composability (closure under composition)

# if s_op1 and s_op2 each satisfy the contract, then
phi( s_op2( s_op1(x, y), z ) )
= classical_op2( classical_op1( phi(x), phi(y) ), phi(z) )

By structural induction, the same holds for any finite expression tree built from these operators.

Map / Reduce corollaries

# Map: unary s_f satisfies the contract
phi( map(s_f, X) ) = map( f_classical, phi(X) )

# Reduce: associative s_op satisfies the contract
phi( reduce(s_op, X) ) = reduce( op_classical, phi(X) )

Reducers like s_sum have batch/stream parity because the magnitude path equals the classical accumulator.

Zero-class neutrality (display vs collapse)

if m == 0: display (0, +1)   # canonical zero-class (presentation only)
phi((0, +1)) = 0             # collapse unchanged

Guards and domains

  • Definedness: the contract applies only where the classical operation is defined.
    Examples: # Division: forbid division by zero unless using meadow (opt-in totalized) # Power: (phi(x))^r must be classically defined (avoid invalid exponent/base combos)
  • Clamps (alignment-only): eps_a = 1e-6 # enforce |a| <= 1 - eps_a eps_w = 1e-12 # guard for weighted means / denominators These guards never modify magnitudes; they bound alignment transforms and stabilize pooling.

Environment gate neutrality (optional, alignment-only)

a_env = clamp_a( g_t * a_op , eps_a )
phi( (m_op, a_env) ) = m_op

Applying the gate after an operator does not affect magnitudes, preserving the contract with or without gating.

Minimal QA invariants (L0 checks)

# L0.1 Collapse parity
assert phi( s_op(x, y, ...) ) == classical_op( phi(x), phi(y), ... )

# L0.2 Alignment bounds (post-op, post-gate if used)
assert abs(a_out) <= 1 - eps_a

# L0.3 Batch/stream parity (for reducers)
assert phi( s_sum(batch) ) == sum( phi(batch) )
assert phi( fold_stream(s_sum, stream) ) == sum( phi(stream) )


Navigation
Previous: Pooling Weights (1.4)
Next: Optional Environment Gate (Operator Finalizer) (1.6)