ISAR Universal Approximation #
What this file establishes #
The ISAR kernel has two kinds of universality:
Logical universality (proved elsewhere in this codebase):
morphism_uniqueness(KernelCategory): ISAR_Kernel is the terminal object — every admissible rewriting system embeds into it via a unique canonical morphism.K1_nilpotent/K2_nilpotent(ISARMatrices): the core rewrite operator K = IRAS satisfies K² = 0.isk_expressive_completeness(BasisCompleteness): every ISKAlgebra matrix is the image of some ISK term under the structural homomorphismterm_signature_val.
Statistical and Topological universality (this file):
- Defines
RMat := Matrix (Fin 4) (Fin 4) ℝusing Mathlib, which carries a fullCommRing,Module ℝ,NormedAddCommGroup, andInnerProductSpace ℝfor free. - Proves rigorously that
RMatinherits the nilpotency of K from the integer proof, sorry-free, usingMatrix.mul_applyand Mathlib cast lemmas. - Defines the ISAR update kernel as an ℝ-linear combination of basis matrices, parametrised by (αI, αR, αA, αS) ∈ ℝ⁴. No ℚ→ℝ gap.
- Proves constructively that the continuous-limit update map
activatedUpdateis well-defined and continuous, reducing the axiom space. - States named axioms
ISAR_UAT(analytic, not proved) and a named completion interface (KernelAddressLimit, …).KernelAddresshas no metric.
Why K² = 0 is the key structural property #
Nilpotency means the ISAR update is a pure first-order generator:
exp(εK) = I + εK (the exponential series terminates at degree 1)
Composing T such steps interleaved with a nonlinear activation σ: σ(I + ε_T K) ∘ ⋯ ∘ σ(I + ε_1 K)
implements a depth-T polynomial approximation of the target function, parametrised continuously in (ε_1, ..., ε_T) ∈ ℝᵀ. By the Weierstrass approximation theorem, polynomials are dense in C(X, ℝ) for compact X, so T → ∞ gives universal approximation.
Scalar type: ℤ → ℝ directly, no ℚ layer #
The algebra is proved over ℤ in ISARMatrices, lifted to ℝ via Int.cast. Unlike
the earlier QMat/Rat version, ISARUpdateR lives in ℝ⁴ from the start — the
ℚ→ℝ density gap no longer applies.
Axiom inventory (all intentional — see ADR-003) #
ISAR_UAT, KernelAddressLimit, continuousRealizationLimit, kernelAddressEmbedding, continuousRealizationLimit_coe, topological_extension_bijection.
All other structures (Activation, nonPolynomial, RawAddress, KernelAddress, activatedUpdate, ISAR_representation, kernelAddressEmbedding_injective, kernelAddressEmbedding_dense) are defined or proved concretely.
Freeze (2026-08-16): the freeze is the decision, not a placeholder.
KernelAddress has no MetricSpace/UniformSpace instance, so
KernelAddressLimit is not Mathlib Metric.Completion. Do not invent a compact-K
or BoundedContinuousFunction metric this cycle (that would be a different theorem).
ISAR_UAT remains a named analytic axiom (not a theorem). Next wiring is
Metric.Completion only, after a metric exists. Do not add physical-system axioms.
1. Real 4×4 matrices via Mathlib #
RMat: Mathlib's Matrix (Fin 4) (Fin 4) ℝ.
Carries CommRing, Module ℝ, NormedAddCommGroup, InnerProductSpace ℝ for free.
Replaces the hand-rolled QMat and its 4 @[simp] app lemmas — Mathlib already has
Matrix.mul_apply, Matrix.add_apply, Matrix.zero_apply, Matrix.smul_apply.
Instances For
2. Lifting Matrix4 (Int) to RMat (ℝ) #
The canonical ring homomorphism from Matrix4 (over Int) to RMat (over ℝ),
using Lean's built-in Int → ℝ coercion (Int.cast / algebraMap ℤ ℝ).
Equations
- ISAR.toRMat M i j = ↑(ISAR.fromMatrix4 M i j)
Instances For
3. ISAR Basis Matrices over ℝ #
4. Nilpotency (ℝ world) #
K1 is nilpotent of order 2 in the ℝ representation.
Transferred from K1_nilpotent (proved over Int by decide) via toRMat_mul.
5. The Differentiable ISAR Update Kernel over ℝ #
The differentiable ISAR update matrix: an ℝ-linear combination of the four basis matrices, parametrised by (αI, αR, αA, αS) ∈ ℝ⁴.
ISARUpdateR αI αR αA αS = αI·I + αR·R + αA·A + αS·S
Scalar multiplication • is Mathlib's SMul ℝ (Matrix ...) from the module structure.
Unlike the former QMat version over ℚ, parameters live in ℝ from the start.
Equations
Instances For
The zero parameter choice gives the zero matrix.
6. Iterated Update Rule #
Iterate the update matrix U, T times.
Equations
- ISAR.linearIterateR U 0 = 1
- ISAR.linearIterateR U n.succ = U * ISAR.linearIterateR U n
Instances For
7. Universal Approximation (Continuous Morphism and Address Space) #
A nonlinear activation function: continuous real functions ℝ → ℝ.
Instances For
Horner's method to evaluate a polynomial represented as a list of real coefficients.
Equations
- ISAR.evalPoly coeffs x = List.foldr (fun (coef acc : ℝ) => coef + x * acc) 0 coeffs
Instances For
Predicate: σ is non-polynomial (necessary condition for representation).
Equations
- σ.nonPolynomial = ∀ (coeffs : List ℝ), ⇑σ ≠ ISAR.evalPoly coeffs
Instances For
Grid state: N cells, each with a 4-dimensional real state vector.
We represent the grid index space as Fin N × Fin 4. This is mathematically
isomorphic to Fin (4 * N) but allows direct, type-safe block-diagonal indexing
without division or modulo operations.
Equations
- ISAR.GridState N = EuclideanSpace ℝ (Fin N × Fin 4)
Instances For
Proof of continuity of the middle linear map.
The block-diagonal action of U on GridState N.
Mathematical Motivation: Implements the linear transformation step of the neural network
update (a block-diagonal matrix multiplication action on the grid coordinates).
Why Noncomputable: Relies on real numbers (ℝ) via WithLp.equiv, which is defined as a
topological completion of ℚ and does not have a constructive computational representation in Lean.
Equations
- ISAR.blockDiagonalAction N U x = (WithLp.equiv 2 (Fin N × Fin 4 → ℝ)).symm (ISAR.middleMap N U ((WithLp.equiv 2 (Fin N × Fin 4 → ℝ)) x))
Instances For
Proof of continuity of the block-diagonal update action.
The bundled continuous block-diagonal linear map.
Mathematical Motivation: Lifts blockDiagonalAction to a bundled continuous map C(GridState N, GridState N).
Why Noncomputable: Bundling a function into a ContinuousMap requires proving continuity, and evaluates
on topological spaces using noncomputable real numbers (ℝ).
Equations
- ISAR.continuousBlockDiagonalAction N U = { toFun := ISAR.blockDiagonalAction N U, continuous_toFun := ⋯ }
Instances For
The elementwise activation function applied to a GridState.
Mathematical Motivation: Implements the element-wise nonlinear activation function application on the grid state.
Why Noncomputable: Performs function application over ℝ using WithLp.equiv and continuous activation functions,
neither of which have constructive computational representations.
Equations
Instances For
Proof of continuity of the elementwise function application.
Proof of continuity of applyActivation.
The bundled continuous elementwise activation map.
Mathematical Motivation: Lifts applyActivation to a bundled continuous map C(GridState N, GridState N).
Why Noncomputable: Evaluates real functions and relies on the noncomputable real topology.
Equations
- ISAR.continuousApplyActivation σ N = { toFun := ISAR.applyActivation σ N, continuous_toFun := ⋯ }
Instances For
activatedUpdate: The concrete, recursive definition of the T-step ISAR update
with alternating activation. Defined constructively via composing the continuous
block-diagonal updates and elementwise activations.
Mathematical Motivation: Computes the multi-layer neural network update $F_{\theta} = \sigma \circ U_T \circ \dots \circ \sigma \circ U_1$.
Why Noncomputable: Combines continuous maps via composition (ContinuousMap.comp) over continuous spaces,
which relies on noncomputable real numbers (ℝ).
Equations
- One or more equations did not get rendered due to their size.
- ISAR.activatedUpdate σ N 0 x_2 = ContinuousMap.id (ISAR.GridState N)
Instances For
RawAddress: the concrete configuration space representing all finite-grid,
finite-time neural representations of the ISAR update.
Contains the grid size N, time steps T, parameter sequence θ, and the bundled
continuous encoder and readout maps.
Equations
- ISAR.RawAddress d k = ((N : ℕ) × (T : ℕ) × (Fin T → Fin 4 → ℝ) × C(EuclideanSpace ℝ (Fin d), ISAR.GridState N) × C(ISAR.GridState N, EuclideanSpace ℝ (Fin k)))
Instances For
The realization map mapping a raw parameter trajectory to a continuous function. Computes the composition: readout ∘ activatedUpdate ∘ encode.
Mathematical Motivation: Realizes the full neural network representation from the parameters (encoder, readout, updates). Why Noncomputable: Computes composition of continuous maps over continuous Euclidean spaces, which is noncomputable in Lean.
Equations
Instances For
Two raw addresses are observationally/functionally equivalent if they realize the same continuous function.
Equations
- ISAR.AddressEq d k σ θ₁ θ₂ = (ISAR.realizeRaw d k σ θ₁ = ISAR.realizeRaw d k σ θ₂)
Instances For
The setoid defining the functional equivalence relation on RawAddress.
Mathematical Motivation: Equates two addresses if they yield the exact same continuous realization function.
Why Noncomputable: The equality relation realizeRaw d k σ θ₁ = realizeRaw d k σ θ₂ is an equality of continuous
functions over ℝᵈ, which is mathematically undecidable/noncomputable.
Equations
- ISAR.addressSetoid d k σ = { r := ISAR.AddressEq d k σ, iseqv := ⋯ }
Instances For
KernelAddress: the address space defined as the quotient of RawAddress modulo
observational/functional equivalence. This is the exact continuous counterpart to
the discrete InvariantLayer.
Equations
- ISAR.KernelAddress d k σ = Quotient (ISAR.addressSetoid d k σ)
Instances For
The well-defined continuous realization of a quotiented KernelAddress.
Derived via Quotient.lift from realizeRaw.
Mathematical Motivation: The canonical projection/realization map from the quotient space KernelAddress to the space of continuous functions.
Why Noncomputable: Relies on Quotient.lift over a noncomputable equivalence relation, and returns a continuous function over ℝ.
Equations
- ISAR.continuousRealization d k σ q = Quotient.lift (fun (θ : ISAR.RawAddress d k) => ISAR.realizeRaw d k σ θ) ⋯ q
Instances For
Injectivity of the Continuous Realization.
By construction, two equivalence classes in the quotient address space KernelAddress
are equal if and only if they realize the exact same continuous function.
This guarantees that the representation is unique (injectivity holds constructively).
Conceptual Bridge to the Invariant Layer.
This equivalence formally states that the topological quotient KernelAddress uses
the exact same mathematical construction as the discrete symbolic InvariantLayer.
Both are quotients of a raw representation space modulo operational/observational equivalence.
Instances For
Named axiom ISAR_UAT (not a theorem).
For any continuous function f : ℝᵈ → ℝᵏ, a non-polynomial activation σ, and a compact domain K ⊆ ℝᵈ, the finite-grid iterated ISAR update can approximate f uniformly on K to arbitrary precision ε > 0.
Why named: Leshno, Lin, Pinkus, and Schocken (1993) is the cited analytic fact (non-polynomial continuous σ iff universal on compact sets; generalizing Cybenko 1989 / Hornik 1991, which require boundedness). Not proved in this repository.
Named placeholder for a completion of KernelAddress.
Not constructed: KernelAddress has no MetricSpace/UniformSpace instance
(C(ℝᵈ, ℝᵏ) on unbounded Euclidean domains is compact-open, not a global supremum
metric). This is not Mathlib Metric.Completion. Next wiring is
Metric.Completion only, after a metric exists.
Named realization map on KernelAddressLimit.
Not constructed: would be the unique continuous extension of
continuousRealization after a metric/uniform structure exists.
Named embedding KernelAddress → KernelAddressLimit.
Not constructed: would be the inclusion into a metric completion.
Named commuting law: realization on the limit agrees with continuousRealization
after embedding. Relies on the named completion axioms, not on a Mathlib extension.
Injectivity of the named embedding.
Follows from injectivity of continuousRealization plus the named commuting axiom
continuousRealizationLimit_coe. Not a metric-completion theorem.
Compact-open density relative to ISAR_UAT.
Any KernelAddressLimit realization can be approximated uniformly on a compact set
by a KernelAddress, using the named axiom ISAR_UAT. This is not a metric-space
density theorem (there is no metric on KernelAddress).
Named extension/bijection axiom (not Mathlib UniformSpace.Completion.extension).
Would follow from a metric on KernelAddress (pullback of a metric on C(ℝᵈ, ℝᵏ)
via continuousRealization) plus isometric embedding and density. That metric
does not exist in this file. The axiom stays named until Metric.Completion
can be wired.
Representation relative to named completion axioms.
Every continuous f has a unique KernelAddressLimit address if one assumes
topological_extension_bijection and ISAR_UAT. Not a constructed completion
theorem; ISAR_UAT remains a named analytic axiom.
Corollary: logical universality plus named analytic/completion axioms.
- Logical universality (
morphism_uniqueness,propext): unique morphisms intoISAR_Kernelrelative to theKernelinterface. - Statistical approximation (named axiom
ISAR_UAT, not proved): every continuousfis approximable on compactKby aRawAddress. - Representation (
ISAR_representation): uniqueKernelAddressLimitaddress, relative toISAR_UATand the named completion axioms — not a theorem that UAT or metric completion has been constructed.
Wrapper: ISAR_representation applied to an arbitrary continuous map.
Adds no physical content and no extra axiom. Relies on the same named
ISAR_UAT / completion axioms as ISAR_representation.