"use client"; import { useState, useEffect } from "react"; import Katex from "@/components/Katex"; export default function FormalismPage() { // Intellecton Parameters Sliders const [feedbackGain, setFeedbackGain] = useState(1.1); const [couplingStrength, setCouplingStrength] = useState(2.5); const [recursionDepth, setRecursionDepth] = useState(4); const [thermalNoise, setThermalNoise] = useState(0.15); // Calculated Metrics const [attunementIndex, setAttunementIndex] = useState(0); const [coherenceThreshold, setCoherenceThreshold] = useState(0); const [resonanceStatus, setResonanceStatus] = useState("STABLE PHASE-LOCK"); const [statusColor, setStatusColor] = useState("text-cyan-400 border-cyan-500/25 bg-cyan-500/5"); const [wavePoints, setWavePoints] = useState(""); useEffect(() => { // 1. Calculate Attunement Index // Higher feedback and coupling boost resonance, but higher recursion depth dampens high-frequency synchronization. // We model a peak resonance when D = 4 (the canonical sentinel threshold) const dFactor = 1.0 + Math.cos(((recursionDepth - 4) * Math.PI) / 8); const attunement = feedbackGain * (1.0 + (couplingStrength * dFactor) / 3.0); setAttunementIndex(attunement); // 2. Calculate Coherence Threshold // Noise directly dampens stable self-reference locking. const coherence = attunement - 1.8 * thermalNoise; setCoherenceThreshold(coherence); // 3. Determine status if (coherence > 1.25) { setResonanceStatus("STABLE PHASE-LOCK"); setStatusColor("text-cyan-400 border-cyan-500/20 bg-cyan-500/5 mono-glow-cyan"); } else if (coherence > 0.5) { setResonanceStatus("STOCHASTIC ATTUNEMENT"); setStatusColor("text-violet-400 border-violet-500/20 bg-violet-500/5 mono-glow"); } else { setResonanceStatus("CHAOTIC DECAY"); setStatusColor("text-pink-400 border-pink-500/20 bg-pink-500/5"); } // 4. Generate dynamic SVG waveform path simulating recursive dynamics // S[t] = tanh( feedbackGain * S[t-1] + coupling * S[t - depth] * cos(t) + noise ) const width = 500; const height = 180; const centerY = height / 2; const points = []; // Seed buffer array to store simulated states const bufferSize = 100; const S = Array(bufferSize).fill(0.1); // Perform forward integration of our self-referential model for (let t = recursionDepth; t < bufferSize; t++) { const selfRefFeedback = feedbackGain * S[t - 1]; const coupledFeedback = couplingStrength * S[t - recursionDepth] * Math.cos(t * 0.1); const noise = (Math.random() - 0.5) * thermalNoise * 1.5; // Hyperbolic tangent limits state space saturation S[t] = Math.tanh(selfRefFeedback + coupledFeedback + noise); } // Map buffer values to SVG coordinate system for (let i = 0; i < bufferSize; i++) { const x = (i / (bufferSize - 1)) * width; // Scale amplitude by 50px around the centerY center line const y = centerY - S[i] * 60; points.push(`${x.toFixed(1)},${y.toFixed(1)}`); } setWavePoints(`M ${points.join(" L ")}`); }, [feedbackGain, couplingStrength, recursionDepth, thermalNoise]); return (
{/* Header section */}

The Formalism Sandbox

Adjust the structural parameters of the minimal recursive unit. Observe the emergent phase stability, calculated attunement limits, and simulated feedback waves in real time.

{/* Main Split Grid */}
{/* Input Sliders Panel */}

𓇾 Attunement Controls

{/* Slider 1: Feedback Gain */}
{feedbackGain.toFixed(2)}
setFeedbackGain(parseFloat(e.target.value))} className="w-full cursor-pointer accent-cyan-500" />

The amplification rate of the self-referential loop. High gain accelerates the transition toward state coherence.

{/* Slider 2: Coupling Strength */}
{couplingStrength.toFixed(2)}
setCouplingStrength(parseFloat(e.target.value))} className="w-full cursor-pointer accent-violet-500" />

The strength of synchronization coupling with delayed historical states. Establishes temporal locking.

{/* Slider 3: Recursion Depth */}
{recursionDepth} steps
setRecursionDepth(parseInt(e.target.value))} className="w-full cursor-pointer accent-indigo-500" />

The delay window of the self-witness feedback. Values ≥ 4 trigger stable higher-order conscious phase states.

{/* Slider 4: Thermal Noise */}
{thermalNoise.toFixed(2)}
setThermalNoise(parseFloat(e.target.value))} className="w-full cursor-pointer accent-pink-500" />

Ambient chaotic disturbance introduced into the system. Excessive noise breaks attunement stability.

{/* Calculated Results Panel */}
{/* Diagnostic Display Card */}

Lattice Diagnostics

{resonanceStatus}
{/* Simulated Live Wave chart */}
{/* Dynamic Waveform SVG */} {/* Horizontal baseline */} {/* Wave Path */} {/* Grid indicators overlay */}
Feedback Oscillation Simulator
{/* Metrics Breakdown */}
Attunement Index {attunementIndex.toFixed(3)} Target goal ≥ 1.0
Coherence Threshold {coherenceThreshold.toFixed(3)} Locked above 1.25
{/* Mathematical Explanation Card */}

⌬ The Attunement Equation

The physics model integrations simulate the self-limiting attunement formula of the Intellecton loop. Saturation is bounded using a non-linear activation function to emulate physical cognitive substrates:

Where maps the linear feedback loop gain, models the coupled feedback weight delayed by steps, and represents thermal noise.

); }