Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-adaptedPipeline-generatedprecheck pending
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Fixed-width Transformer approximation on compact domains

Statement

Assume the Axiom of Countable Choice, fix integers d≥1 and n≥2, and fix 1≤p<∞. For a matrix Y∈Rd×n, let ∥Y∥p=(∑r=1d∑j=1n∣Yrj∣p)1/p, and for measurable maps on Rd×n define

dp(f,g)=(∫Rdn∥f(X)−g(X)∥pp dX)1/p,

using dn-dimensional Lebesgue measure. Let T2,1,4 be the finite compositions of the two-head, head-size-one Yun blocks with tokenwise ReLU feedforward width four and no layer normalization. If f:Rd×n→Rd×n is continuous, has compact support, and satisfies f(XP)=f(X)P for every n×n permutation matrix P, then for every ε>0 there is g∈T2,1,4 with dp(f,g)<ε.

For every compact K⊆Rd×n and every continuous f:K→Rd×n, with no permutation condition, there are a trainable positional matrix E∈Rd×n and g∈T2,1,4 such that

(∫K∥f(X)−g(X+E)∥pp dX)1/p<ε.

Facts & Assumptions

Given: Countable Choice, fixed d,n,p, the target maps in the Statement, and ε>0.

[F1]

Each block in T2,1,4 has two unmasked heads of size one, residual attention, a shared tokenwise ReLU feedforward sublayer of width four, and no layer normalization; a scalar query bias is allowed (Transformer encoder, decoder, and fixed-width expressivity blocks).

[F2]

The column-token Yun block and every unpositioned composition of it are permutation equivariant (Position-free unmasked self-attention is permutation equivariant).

[F3]

A two-head, head-size-one modified network with piecewise-affine scalar gates performs exact finite lookup on the distinct-column grid and on position-tagged grids; the first version returns zero on duplicate-column and sentinel grid points (Two-head fixed-width Transformers implement finite-grid lookups).

[F4]

A continuous map from a compact metric space to a metric space is uniformly continuous (Heine-Cantor: a continuous map from a compact metric space to any metric space is uniformly continuous).

[F6]

For decreasing measurable sets of finite measure, the measure of their intersection is the limit of their measures (Continuity from above when one set has finite measure).

Proof

1.1givenF1F2algebra

First consider the compactly supported equivariant map. If f=0, the zero Transformer suffices. Otherwise its support K is a nonempty compact permutation-invariant set. Compactness bounds all scalar entries of matrices in K; choose real a<b with every entry in [a,b]. Since a nonzero continuous function is nonzero on an open set, K has positive measure and the bounds can be chosen with a<b. The common affine map T(X)=(X−a1)/(b−a) sends K into [0,1]d×n and commutes with column permutations. A residual width-four ReLU sublayer implements z↦αz+β on every feature by z+(α−1)(ReLU⁡(z)−ReLU⁡(−z))+β=αz+β; two hidden units handle one feature and finitely many layers handle all d features. Thus T can be inserted in the Yun architecture.

1.2givenF1F3constructchoose

Now consider continuous f on compact K without symmetry. If K has zero Lebesgue measure, the integral is zero for any network. Otherwise let a,b be the minimum and maximum of its scalar entries; again a<b. Put α=(b−a)−1 and choose Erj=(b−a)(j−1)−a(1≤r≤d, 1≤j≤n). The first residual width-four sublayers scale X+E by α, producing entries (Xrj−a)/(b−a)+(j−1). For any mesh δ=1/m used below, put ηδ(t)=−t for 0≤t<δ and ηδ(t)=0 otherwise. For each feature row, apply the residual updates t↦t+ηδ(t−k) in increasing order for k=0,δ,…,n−δ. The kth update sends exactly [k,k+δ) to k and leaves values outside that interval unchanged; hence every column-j value in [j−1,j) is mapped to one of j−1,j−1+δ,…,j−δ. Entries exactly at an upper endpoint lie on finitely many coordinate hyperplanes of measure zero and do not affect the integral. Thus the quantized matrices lie in Gδ,pos from [F3], where position offsets make every column distinct. For each grid cell meeting K, choose a representative XL∈K and set A(L)=f(XL); set arbitrary values, for example zero, on cells disjoint from K. The position-tagged assertion of [F3] realizes this finite table exactly.

1.3F1F3algebra

It remains to replace the modified gates and uniform hardmax in [F3] by the standard ReLU and softmax of T2,1,4. Consider any scalar gate ϕ that is affine on the three intervals cut by c1<c2, with formulas a1t+b1, a2t+b2, and a3t+b3, and with at least one ai=0. Fix 0<ρ<(c2−c1)/2. Replace the parts on [c1−ρ,c1] and [c2−ρ,c2] by linear ramps joining the left, middle, and right affine pieces, and leave ϕ unchanged elsewhere. The resulting continuous piecewise-affine map has knots r1=c1−ρ, r2=c1, r3=c2−ρ, r4=c2 and successive slopes s0=a1, s1, s2=a2, s3, s4=a3. Put Δi=si−si−1. It is a constant plus four ReLUs: use ΔiReLU⁡(t−ri) at knots not in S and ΔiReLU⁡(ri−t) at knots in S, choosing any applicable case S=∅ if a1=0, S={1,2} if a2=0, or S={1,2,3,4} if a3=0; add the constant that matches the left affine piece. In each case the left-tail slope is −∑i∈SΔi=a1 and the right-tail slope is ∑i∉SΔi=a3, while the slope jump at each knot is Δi, so this formula is exact outside the two ramp intervals. It covers the middle-constant sentinel gate as well as the constant-ended pulse and clamp gates used below. The two-piece clipping gate ϕ(t)=−t for t<0 and 0 for t≥0 is exactly ReLU⁡(−t). A width-four ReLU sublayer realizes each ramped scalar gate, including its constant bias, in the modified residual update. On bounded input regions the ramp error is confined to strips whose widths tend to zero with ρ. For any finite score vector s, softmax of λs converges as λ→∞ to equal weights on its maximizing coordinates and zero elsewhere; hence it converges to the uniform hardmax used in [F3].

2.1step 1.1step 1.3F3F4constructchoose

Choose δ=1/m with integer m large enough that n≤δ−d, the duplicate-cell bound below is small, and M=δ−nd>d+1+log⁡(n)/λ for a fixed λ>0. In the modified unpositioned construction, first apply to each feature row the residual gate t↦t+χM(t), where χM(t)=−t−M for t<0, χM(t)=0 for 0≤t<1, and χM(t)=−t−M for t≥1. This sends every out-of-range coordinate to the sentinel −M. Then, in increasing order for k=0,1,…,m−1, apply t↦t+ηδ(t−kδ), with ηδ(s)=−s for 0≤s<δ and 0 otherwise. The kth clamp sends precisely [kδ,(k+1)δ) to kδ and leaves values below or above that interval unchanged; after all gates each coordinate is a grid value or the sentinel. These are finite compositions of the three-piece gates in step 1.3, so the exact modified quantizer maps into Gδ+. For the unpositioned branch, partition the normalized cube into half-open grid cells of side δ. Their preimages under T have side h=(b−a)δ. By [F4], the oscillation of f between two points of K at distance at most dn h tends to zero with δ. For each orbit of distinct-column grid matrices L under column permutations, if the closed preimage cell meets K, choose one representative XL in that intersection and put A(L)=f(XL); transport the choice by permutations and set A(L)=0 on orbits whose cells miss K. This is a finite choice and gives A(LP)=A(L)P. Apply the first assertion of [F3] to this table.

2.2step 1.2F4F5algebra

By [F4], for sufficiently small δ every point of K and the representative in its grid cell have outputs within any prescribed tolerance. The cell diameter in the original coordinates is at most dn(b−a)δ, and K has finite measure because it is compact and bounded. Thus the integrated Lp(K) error of the modified position-tagged lookup can be made arbitrarily small.

3.1step 2.1F3F5F6algebra

The table network agrees with f on every point of K in a distinct-column cell up to the oscillation in step 2.1. The union of cells whose grid matrices have duplicate columns has measure at most (n2) md(n−1)hdn=(n2)(b−a)dnδd, because for each pair of columns, equality leaves only md(n−1) grid matrices. The table is zero on cells not meeting K; cells meeting K but lying partly outside it are contained in the dn h-neighborhood of K. Intersect these neighborhoods with one fixed bounded box containing K. Along any sequence hj↓0, the resulting closed neighborhoods decrease to K and have finite measure; [F5]–[F6] imply that their excess measure over K tends to zero. The table values are bounded because f is continuous on compact K. Outside the normalized cube the sentinel branch of [F3] returns zero, as does f. Therefore the integrated Lp error of the modified lookup tends to zero as δ↓0.

3.2givenF1step 2.1algebra

To control the unbounded input domain in the first assertion, insert an exact sentinel gate before simulating the lookup. For a quantized matrix Z, put sj=∑r=1dZrj and wj=e−λsj∑k=1ne−λsk,sˉ=∑j=1nwjsj. A size-one softmax head with constant query 1, key −λsj, value sj, and output vector 1d sends Z to Z+sˉ1d×n. If all entries of Z are in [0,1], then every sj≥0, so every shifted entry is nonnegative. If any entry is the sentinel −M, then min⁡jsj≤−M+d−1. The entropy identity −∑jwjlog⁡wj=λsˉ+log⁡∑k=1ne−λsk and the bounds −∑jwjlog⁡wj≤log⁡n and ∑je−λsj≥e−λmin⁡jsj imply sˉ≤min⁡jsj+(log⁡n)/λ<−1, by the choice in step 2.1. Since every entry of Z is at most 1, every shifted entry is then negative. Apply coordinatewise ReLU, implemented by the residual update zr↦zr+ReLU⁡(−zr)=ReLU⁡(zr) one feature at a time. It leaves every shifted valid state unchanged and sends every shifted sentinel state to zero. A second size-one softmax head exactly inverts the shift on nonnegative states: the shifted column sums are sj+dsˉ, so their weights remain wj and their weighted mean is (d+1)sˉ; add −(d+1)−1 times this mean to each feature. This restores Z, and sends the zero state to zero. These two attention updates and the coordinatewise clipping are ordinary blocks in T2,1,4.

3.3step 1.2step 1.3step 2.1F3algebrachoose

Fix the mesh, finite table, and modified lookup from steps 1.2 and 2.1. Choose the lookup ramp widths so small that their ramp intervals avoid every scalar gate input on the finitely many exact lookup trajectories. The detector boundaries and pulse boundaries have positive clearance from these inputs, and clipping is the exact map zr↦zr+ReLU⁡(−zr). Replace each hardmax head by scaled softmax, scaling only its scores. In the contextual sweeps a query stays away from its half-grid thresholds; maximizing keys have the same scalar code, which is also their scalar value. Thus small perturbations of tied maximizing keys cannot change the limiting value. In the final head, the only zero-query state is the all-zero matrix, where all values vanish. Positive score gaps to nonmaximizing keys suppress their weights exponentially. These observations give convergence of each head output near each exact trajectory state; the fixed ramped tokenwise maps are continuous. Induction through the finite composition therefore approximates the lookup arbitrarily closely on all required finite grid states.

4.1step 3.3step 3.2F3algebrachoose

In the unpositioned branch, this simulation can and will fix the zero matrix exactly. Every contextual attention update sends zero to zero, for every softmax scale, since its value projection vanishes there. In the lookup construction of [F3], the invalid-code detector equals one at scalar code zero, since the interval of valid codes is strictly positive. Its ramped version also equals one there when its width is sufficiently small. Subtracting the detector's fixed positive constant makes every coordinate negative, and the exact coordinatewise clipping then returns the zero matrix. Every subsequent lookup pulse is zero at scalar code zero, as its positive center is at least the least valid code. Small enough pulse ramp widths preserve this equality. Thus the entire simulated lookup sends zero exactly to zero, including its detector layers; this is stronger than merely approximating zero. The exact filter in step 3.2 followed by this lookup consequently gives zero whenever the quantizer has an exact sentinel coordinate.

5.1step 1.2step 2.1step 2.2step 3.1step 3.2step 3.3step 4.1F1F5algebrachoose∎

Use a separate width ρ<min⁡(1,δ/2) for the quantizer ramps. Away from finitely many scalar boundary strips of width at most ρ, these quantizers give exactly the grids in steps 1.2 and 2.1; the upper-endpoint hyperplanes are null. The unpositioned quantizer has every output entry in [−M,1]: its initial residual sentinel ramp joins output values −M and 0, or 1−ρ and −M, and each later clamp ramp stays between its adjacent grid endpoints. A raw normalized coordinate outside [−ρ,1] is an exact sentinel and stays so through the clamps. By step 4.1, all inputs outside the fixed box [−1,1]d×n therefore have exactly zero output. Within this box, the set where the quantizer differs from its discrete version is contained in finitely many coordinate strips of total measure tending to zero with ρ; previously clamped grid points stay fixed under later clamps. The position-tagged input region is already bounded, and the same strip estimate applies there. There is a common bound on all simulated outputs, independent of ρ and of the attention scales: on any bounded scalar interval a ramped gate lies between values of its two fixed adjacent affine pieces; attention outputs are convex combinations of fixed linear value projections, irrespective of score scale. Residual addition and induction over the fixed finite list of layers give a finite common bound, including the exact filter. Thus each transition-region error integral is bounded by a fixed constant times its strip measure. First choose the mesh so the modified lookup error in steps 2.2 and 3.1 is small; fix its table and coefficients and the resulting common bound; then shrink the quantizer strips and choose lookup simulation accuracy on the finite states as in step 3.3. The finite-grid simulation error is integrated over a fixed finite-volume box, while the unbounded exterior contributes exactly zero by step 4.1. Taking all these contributions sufficiently small, with the affine volume factor (b−a)dn included, makes the total error less than ε in both assertions.

Depends on

Used by

Dependency tree · two levels

54 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.

Sources