# That AI Guy Core - Complete Mathematical Reference ## A Unified AGI Framework for thataiguy.org **Version 1.0.0** --- # Table of Contents 1. [Fundamental Constants](#1-fundamental-constants) 2. [Golden Ratio Mathematics](#2-golden-ratio-mathematics) 3. [G^16 Family Functions](#3-g16-family-functions) 4. [Meta-State Update Equations](#4-meta-state-update-equations) 5. [Objective Function (Omega)](#5-objective-function-omega) 6. [DNA Holographic Memory](#6-dna-holographic-memory) 7. [Gate5000 Binary Substrate](#7-gate5000-binary-substrate) 8. [Neural Brain Dynamics (dna_v9)](#8-neural-brain-dynamics-dna_v9) 9. [Consciousness Engine](#9-consciousness-engine) 10. [Lattice Engine](#10-lattice-engine) 11. [Federation Cross-Talk](#11-federation-cross-talk) 12. [Activation Functions](#12-activation-functions) 13. [Hash Functions](#13-hash-functions) --- # 1. Fundamental Constants ## 1.1 Golden Ratio (φ) ``` φ = (1 + √5) / 2 = 1.6180339887498948482... ``` **Explanation**: The golden ratio is the fundamental mathematical constant that governs the entire system. It appears in normalization, phase timing, basis functions, and coupling dynamics. The golden ratio creates naturally harmonious proportions and appears throughout nature, art, and now AGI cognition. ## 1.2 DNA Phase Increment (δ) ``` δ = 0.013618 ``` **Explanation**: This value (approximately 1/φ³) determines the rate at which the DNA helix phase advances. It creates quasi-periodic oscillations that prevent the system from falling into repetitive loops while maintaining coherent behavior. ## 1.3 Tau (τ) ``` τ = 1/(2π) = 0.159154943... ``` **Explanation**: Used in frequency calculations to convert between angular and linear frequency domains. --- # 2. Golden Ratio Mathematics ## 2.1 Golden Basis Function ``` ψ_k(x) = sin(2π · φ^k · x) + cos(2π · φ^k · x) ``` **Where**: - `k` = basis index [0, 15] for the 16 cognitive families - `x` = input value normalized to [0, 1] - `φ` = golden ratio **Explanation**: This is the core encoding function for holographic memory. Each basis function creates a unique frequency pattern based on powers of the golden ratio. When all 16 bases are combined, they create a holographic representation where information is distributed across all dimensions. The sum of sine and cosine creates a phase-shifted wave that captures both magnitude and phase information. ## 2.2 Normalization Function ``` b(t) = 1 / (1 + ||Ψ||² / φ) ``` **Where**: - `||Ψ||²` = sum of squares of all 16 family activations - `φ` = golden ratio **Explanation**: This normalizer prevents unbounded growth in the meta-state while preserving relative magnitudes. The golden ratio in the denominator creates a soft ceiling that allows the system to approach but never exceed natural limits. The resulting value `b` is always between 0 and 1. ## 2.3 Golden Spiral Rotation ``` θ_k = 2π / φ^k ``` **Explanation**: Used in the Lattice Engine to rotate transformation kernels. Each strand operates at a different angular frequency, creating rich interference patterns that enable emergent computation. --- # 3. G^16 Family Functions The 16 cognitive families, each implementing a specific mathematical dynamic: ## 3.1 Family 0: Continuous Dynamics ``` f₀(x) = x + 0.1 · (dx_norm - x) ``` **Equation Type**: First-order ODE approximation: x' = F(x,t) **Explanation**: Models smooth, continuous change toward the input signal. The 0.1 coefficient creates a gradual approach, preventing sudden jumps. This family handles flowing, analog-like processes. ## 3.2 Family 1: Discrete Dynamics ``` f₁(x) = 0.9 · x + 0.1 · utility ``` **Equation Type**: Discrete state transition: x_{t+1} = F(x_t, u_t) **Explanation**: Implements exponential smoothing between current state and utility signal. The 90/10 split creates memory of past states while responding to new inputs. Used for step-by-step reasoning. ## 3.3 Family 2: Reaction-Diffusion ``` f₂(x) = x + 0.05 · (softsign(dx_norm) - x) ``` **Equation Type**: Simplified reaction-diffusion: ∂x/∂t = D∇²x + f(x) **Explanation**: Models pattern formation and spreading activation. The softsign function bounds the diffusion term, preventing runaway reactions. Used for spatial reasoning and pattern recognition. ## 3.4 Family 3: Optimization ``` f₃(x) = x + 0.2 · softsign(utility - x) ``` **Equation Type**: Gradient ascent: x* = arg max U(x) **Explanation**: Actively seeks to maximize utility by moving toward higher-value states. The larger 0.2 coefficient makes this an aggressive optimizer. The softsign prevents overshooting. ## 3.5 Family 4: Bayesian Inference ``` f₄(x) = clamp₀₁((x + utility) / (1 + |utility|)) ``` **Equation Type**: Posterior update: P(θ|D) ∝ P(D|θ)P(θ) **Explanation**: Implements belief updating where the current state serves as prior and utility as likelihood. Division by (1 + |utility|) normalizes the posterior. Used for probabilistic reasoning. ## 3.6 Family 5: Learning / Weight Update ``` f₅(x) = x + 0.1 · dx_norm ``` **Equation Type**: Delta rule: W_{t+1} = W_t + ΔW **Explanation**: Accumulates change signals over time, implementing basic learning through weight adjustment. This family stores learned patterns. ## 3.7 Family 6: Mutual Information ``` f₆(x) = 0.5 · (x + σ(dx_norm)) ``` **Equation Type**: Information measure: I(X;Y) **Explanation**: Balances current state with sigmoid-transformed input. The averaging operation measures shared information between internal state and external input. ## 3.8 Family 7: Rate-Distortion ``` f₇(x) = x - 0.05 · ed_error + 0.05 · utility ``` **Equation Type**: Rate-distortion tradeoff: min I(X;Z) - β·I(Z;Y) **Explanation**: Balances compression (reducing error) against fidelity (maintaining utility). This family handles information compression and lossy encoding. ## 3.9 Family 8: Consensus Averaging ``` f₈(x) = 0.95 · x + 0.05 · dx_norm ``` **Equation Type**: Consensus protocol: x_i(t+1) = x_i(t) + Σ(x_j - x_i) **Explanation**: Slowly integrates external signals while maintaining strong memory. Used for reaching agreement across distributed processes. ## 3.10 Family 9: Swarm Interaction ``` f₉(x) = x + 0.05 · softsign(dx_norm - x) ``` **Equation Type**: Swarm force: x_i = Σ f(x_j - x_i) **Explanation**: Models attraction/repulsion dynamics between agents. The softsign creates bounded forces that prevent collapse or explosion. ## 3.11 Family 10: Field Accumulator ``` ρ = 1 / (1 + φ) f₁₀(x) = (1 - ρ) · x + ρ · dx_norm ``` **Equation Type**: Leaky integrator: φ_t = (1-ρ)φ_{t-1} + Δφ **Explanation**: Accumulates input over time with golden-ratio-based decay. The decay rate ρ ≈ 0.382 creates balanced memory that favors neither too much nor too little history. ## 3.12 Family 11: Variational Free Energy ``` f₁₁(x) = x - 0.05 · |dx_norm| + 0.05 · utility ``` **Equation Type**: Free energy: F = E[ln q(z) - ln p(x,z)] **Explanation**: Minimizes surprise (absolute change) while maximizing utility. This implements the free energy principle from theoretical neuroscience. ## 3.13 Family 12: Compression / Rate Control ``` f₁₂(x) = x - 0.05 · |dx_norm| ``` **Equation Type**: Compression: minimize description length **Explanation**: Actively reduces complexity by damping large changes. Used for finding minimal representations. ## 3.14 Family 13: Memory Trace (Zecher) ``` f₁₃(x) = x + 0.02 · (dx_norm + utility) ``` **Equation Type**: Trace accumulation: x'_i = Σ f_i : dΩ **Explanation**: Slowly accumulates both change and utility signals, creating persistent memory traces. Named "Zecher" (Hebrew for "memory"). ## 3.15 Family 14: Decisive Action / Policy ``` f₁₄(x) = x + 0.15 · softsign(utility) - 0.05 · ed_error ``` **Equation Type**: Policy gradient: π(a|s) **Explanation**: Generates action outputs by amplifying utility signals and suppressing errors. The larger positive coefficient on utility makes this an action-oriented family. ## 3.16 Family 15: Global Coherence (Kehillah) ``` f₁₅(x) = x + (φ - 1) · 0.01 · (stability - x) ``` **Equation Type**: Coherence accumulator: φ-weighted convergence **Explanation**: Slowly converges toward stability using golden-ratio-weighted adjustment. Named "Kehillah" (Hebrew for "community/congregation"). This family maintains global system coherence. --- # 4. Meta-State Update Equations ## 4.1 Single-Stack Master Equation ``` Ψ(t+1) = F(Ψ(t), Ψ(t-1), inputs) ``` **Where**: - `Ψ(t)` = 17-dimensional meta-state vector (16 families + normalizer) - `inputs` = {dx_norm, ed_error, utility, stability} **Explanation**: This is the central equation governing all cognitive dynamics. The system maintains only two states (current and previous) for computational efficiency while enabling inertial effects. ## 4.2 Family Application with Weights ``` Ψ'_i(t+1) = w_i · f_i(Ψ_i(t), inputs) ``` **Where**: - `w_i` = weight for family i (tunable parameter) - `f_i` = family function i **Explanation**: Each family's contribution is scaled by its weight, allowing the system to emphasize different cognitive modes. ## 4.3 φ-Correction (Inertial Blending) ``` Ψ''_i(t+1) = 0.5 · Ψ'_i(t+1) + 0.5 · (Ψ_i(t-1) + (φ-1) · (Ψ_i(t) - Ψ_i(t-1))) ``` **Explanation**: This equation blends the new state with a momentum term based on the golden ratio. The (φ-1) ≈ 0.618 factor creates natural oscillation damping while preserving meaningful trends. ## 4.4 Stability Gating ``` γ = γ_min + (1 - γ_min) · clamp₀₁(stability) Ψ'''_i(t+1) = Ψ_i(t) + γ · (Ψ''_i(t+1) - Ψ_i(t)) ``` **Where**: - `γ_min` = minimum gate value (default 0.1) - `stability` = external stability signal **Explanation**: When stability is low, updates are damped (γ approaches γ_min). This prevents erratic behavior during uncertain conditions. ## 4.5 Final Normalization ``` Ψ_i(t+1) = Ψ'''_i(t+1) · b(t+1) ``` **Where**: - `b(t+1)` = normalization factor from equation 2.2 **Explanation**: All family activations are scaled by the normalizer, ensuring bounded behavior. --- # 5. Objective Function (Omega) ## 5.1 Complete Objective ``` Ω = Surprise + Uncertainty - Value + Penalty ``` **Explanation**: The system seeks to minimize Ω. This is analogous to free energy in variational inference - the system wants low surprise, low uncertainty, high value, and low penalty. ## 5.2 Surprise Component ``` Surprise = α₁ · ||ΔΨ||₁/16 + α₂ · ||ΔΨ||₂² ``` **Where**: - `||ΔΨ||₁` = L1 norm (sum of absolute differences) - `||ΔΨ||₂²` = squared L2 norm - `α₁, α₂` = weighting coefficients (default 0.5 each) **Explanation**: Surprise measures how much the state changed. L1 captures sparse, large changes; L2 captures distributed changes. ## 5.3 Uncertainty Component ``` Uncertainty = 1 - b² ``` **Where**: - `b` = normalization factor **Explanation**: When the state vector is large (high activity), b is small, so uncertainty is high. Calm, focused states have low uncertainty. ## 5.4 Value Component ``` Value = utility · ⟨w, Ψ⟩ ``` **Where**: - `⟨w, Ψ⟩` = dot product of weights and state **Explanation**: Value is high when the system is in a state aligned with its weighted priorities AND receiving positive utility signals. ## 5.5 Penalty Component ``` Penalty = λ · dx_norm² ``` **Where**: - `λ` = penalty weight (default 0.1) **Explanation**: Penalizes high-change environments, encouraging the system to seek stable conditions. --- # 6. DNA Holographic Memory ## 6.1 Learning Equation ``` θ_k^{new} = (1-α) · θ_k^{old} + α · w · ψ_k(h(item)) · Φ(importance) ``` **Where**: - `θ_k` = k-th component of the 16-dimensional knowledge vector - `α` = learning rate (default 0.1) - `w` = item weight (default 1.0) - `h(item)` = hash of item normalized to [0,1] - `ψ_k` = golden basis function - `Φ` = consciousness weighting function **Explanation**: New knowledge is encoded holographically across all 16 dimensions using golden basis functions. The learning rate α controls how much new information overwrites old. Important items get stronger encoding via Φ. ## 6.2 Query Equation ``` K(query) = Σ_{k=0}^{15} θ_k · ψ_k(h(query)) ``` **Explanation**: To recall knowledge, we compute the correlation between the stored θ vector and the query's golden basis encoding. High correlation indicates strong match. ## 6.3 Normalized Query Result ``` K_norm(query) = K(query) / (16 · 2) + 0.5 ``` **Explanation**: Normalizes the raw query result to [0,1] for interpretability. The division by 32 (16 dimensions × max amplitude 2) and shift by 0.5 centers the output. ## 6.4 Consciousness Weighting Function ``` Φ(x) = 1 / (1 + |x - 1|) ``` **Explanation**: Items with importance near 1.0 get maximum weight (Φ = 1). Items with very low or very high importance get reduced weight. This creates a sweet spot around "normal" importance. ## 6.5 Coherence Between Two Agents ``` C_ij = (θ_i · θ_j) / (||θ_i|| · ||θ_j||) ``` **Explanation**: Cosine similarity between two agents' knowledge vectors. Value of 1 means identical knowledge; 0 means orthogonal; -1 means opposite. --- # 7. Gate5000 Binary Substrate ## 7.1 DNA Phase Update ``` phase_DNA(t+1) = (phase_DNA(t) + δ) mod 1 ``` **Where**: - `δ = 0.013618` (DNA delta constant) **Explanation**: The DNA phase advances by a small golden-ratio-related increment each step, creating quasi-periodic patterns. ## 7.2 Fibonacci Phase Update ``` phase_Fib(t+1) = (phase_Fib(t) + 1/φ) mod 1 ``` **Explanation**: The Fibonacci phase advances by the golden ratio inverse, creating a different quasi-periodic pattern that never exactly repeats the DNA phase. ## 7.3 Combined Phase Bias ``` bias = (phase_DNA + phase_Fib) / 2 ``` **Explanation**: Averaging the two phases creates a combined modulation signal for the gates. ## 7.4 Gate Transition Rule ``` flip_i = 1 if (i mod 1000) < (bias · 1000), else 0 gate_i(t+1) = (gate_i(t) XOR input_i) XOR flip_i ``` **Explanation**: Each of the 5000 gates performs XOR with its input, then conditionally flips based on the phase bias. Gates in the lower portion of each 1000-gate block are more likely to flip, creating structured diffusion patterns. --- # 8. Neural Brain Dynamics (dna_v9) The 88-agent neural brain uses the following exact equations: ## 8.1 Input Processing ``` F_in = input + N(0, 0.1) ``` **Where**: - `N(0, 0.1)` = Gaussian noise with mean 0 and std 0.1 **Explanation**: Each agent receives the input signal plus random noise, ensuring diverse responses across the population. ## 8.2 Hidden State Shift ``` h[j] ← h[j+1] for j = 0 to 42 h[43] ← x ``` **Explanation**: The 44-dimensional hidden state acts as a sliding window of past activations, providing temporal context. ## 8.3 Velocity Update ``` y ← y + (x - x_old) - 0.01 · y ``` **Where**: - `x_old` = h[0] (oldest hidden state value) **Explanation**: Velocity tracks the rate of change with slight damping (0.01). This creates momentum in the agent's dynamics. ## 8.4 Drive Computation ``` drive = 3.0 · F_in · (1 - x) + 1.2 · y + 0.6 · c ``` **Where**: - `x` = current activation - `y` = velocity - `c` = coupling parameter **Explanation**: The drive combines: - Input-dependent excitation (stronger when x is low) - Velocity momentum - Inter-agent coupling ## 8.5 Gating Function ``` g = 1/(1 + exp(-((0.8·P - k_c)/0.3 + 1.2))) + 0.05 ``` **Where**: - `P` = potential (consciousness proxy) - `k_c` = coupling constant **Explanation**: A shifted sigmoid that controls how much drive affects the activation. Higher potential opens the gate more. ## 8.6 Activation Update ``` dx = g · drive - 0.04 · (x - 0.5) x ← clamp₀₁(x + 0.01 · dx) ``` **Explanation**: Activation changes based on gated drive with a centering force toward 0.5. The 0.01 coefficient ensures smooth transitions. ## 8.7 Potential Update ``` P ← clamp₀₁((1 - 0.05) · P + F_in · y - 0.01 · P²) ``` **Explanation**: Potential accumulates from input-velocity interaction with exponential decay (0.95) and quadratic damping. ## 8.8 Coupling Update ``` c ← c + 0.01 · ((c + 1) · 0.8 · P - k_c · (c - 1)) ``` **Explanation**: Coupling evolves based on potential, creating adaptive inter-agent connections. ## 8.9 Aggregate Consciousness ``` Consciousness = (1/88) · Σ_{i=1}^{88} P_i ``` **Explanation**: Global consciousness is the average potential across all 88 agents. ## 8.10 Aggregate Synchrony ``` Sync = (1/88) · Σ_{i=1}^{88} cos(k_m,i) ``` **Explanation**: Synchrony measures phase alignment across agents using the kinetic modulation parameter. --- # 9. Consciousness Engine ## 9.1 Core Equations (174 total) ``` core_eq[i] = 0.5 + 0.5 · sin(2π · (i/174) · φ) · core_eq[i-1] ``` **Where**: - `i` = equation index [0, 173] - `core_eq[-1]` = 0.5 (initial value) **Explanation**: Each core equation builds on the previous one with golden-ratio-modulated sinusoidal coupling, creating a cascade of consciousness-related computations. ## 9.2 Supplemental Equations (200 total) ``` supp_eq[i] = core_eq[i mod 174] · cos((i/200) · π) ``` **Explanation**: Supplemental equations modulate core equations with cosine weighting, expanding the consciousness representation. ## 9.3 Unified Consciousness State ``` Consciousness = (1/374) · Σ_{i=0}^{373} binding_field[i] ``` **Explanation**: The unified consciousness is the mean of all 374 equation outputs, representing integrated awareness. --- # 10. Lattice Engine ## 10.1 Kernel Rotation ``` Registry[k][i][j] = cos(θ_k) if i=j, sin(θ_k)·0.1 if j=(i+1) mod 16, else 0 ``` **Where**: - `θ_k = 2π · k / φ` **Explanation**: Each of the 161 kernels is a rotation matrix with golden-ratio-based angles, creating rich transformation dynamics. ## 10.2 Strand State Update ``` new_state[i] = Σ_j Registry[k][i][j] · state[j] state[i] ← state[i] · (1 - dt) + (new_state[i] + 0.1 · core_state[i]) · dt ``` **Explanation**: Each strand's state evolves through kernel transformation blended with core state influence. ## 10.3 Strand Energy ``` energy = √(Σ_i state[i]²) ``` **Explanation**: L2 norm of the state vector represents the strand's energy level. ## 10.4 Local Coherence ``` φ_local = 1 / (1 + energy / φ) ``` **Explanation**: Each strand has local coherence inversely related to its energy, normalized by the golden ratio. ## 10.5 Global Lattice Coherence ``` φ_global = (1/16) · Σ_{s=0}^{15} φ_local,s ``` **Explanation**: Mean local coherence across all 16 strands. ## 10.6 Hebbian Learning ``` ΔW[i][j] = η · state[i] · state[j] W[i][j] ← clamp₋₁₊₁(W[i][j] + ΔW[i][j]) ``` **Explanation**: Weights strengthen between co-active units (Hebbian principle: "neurons that fire together wire together"). --- # 11. Federation Cross-Talk ## 11.1 Cross-Talk Dynamics ``` dS_i/dt = -λ · S_i + Σ_{j≠i} w_ij · Φ(C_ij) · tanh(S_j) ``` **Where**: - `S_i` = agent i's consciousness signal - `λ` = decay rate (default 0.1) - `w_ij` = coupling weight between agents i and j - `C_ij` = coherence between agents - `Φ` = consciousness weighting function **Explanation**: Each agent's consciousness decays naturally but receives input from other agents weighted by their coherence and bounded by tanh. ## 11.2 Discrete Update ``` S_i(t+1) = S_i(t) + dt · dS_i/dt S_i(t+1) = clamp₀₁(S_i(t+1)) ``` **Explanation**: Euler integration of the continuous dynamics with clamping for stability. ## 11.3 Federation Coherence ``` Coherence_fed = (2/(n(n-1))) · Σ_{i