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 and , and fix . For a matrix , let , and for measurable maps on define
using -dimensional Lebesgue measure. Let be the finite compositions of the two-head, head-size-one Yun blocks with tokenwise ReLU feedforward width four and no layer normalization. If is continuous, has compact support, and satisfies for every permutation matrix , then for every there is with .
For every compact and every continuous , with no permutation condition, there are a trainable positional matrix and such that
Statement references
Facts & Assumptions
Given: Countable Choice, fixed , the target maps in the Statement, and .
Each block in 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).
The column-token Yun block and every unpositioned composition of it are permutation equivariant (Position-free unmasked self-attention is permutation equivariant).
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).
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).
Under Countable Choice, Lebesgue measure is a complete countably additive measure extending box volume, and compact subsets of Euclidean space are measurable (Assuming countable choice, is a sigma-algebra containing every elementary set and is a complete measure extending elementary volume, A box in with parameters is Lebesgue measurable of measure , whichever of its faces are included, Assuming countable choice, every Borel subset of is Lebesgue measurable).
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
First consider the compactly supported equivariant map. If , the zero Transformer suffices. Otherwise its support is a nonempty compact permutation-invariant set. Compactness bounds all scalar entries of matrices in ; choose real with every entry in . Since a nonzero continuous function is nonzero on an open set, has positive measure and the bounds can be chosen with . The common affine map sends into and commutes with column permutations. A residual width-four ReLU sublayer implements on every feature by two hidden units handle one feature and finitely many layers handle all features. Thus can be inserted in the Yun architecture.
Now consider continuous on compact without symmetry. If has zero Lebesgue measure, the integral is zero for any network. Otherwise let be the minimum and maximum of its scalar entries; again . Put and choose The first residual width-four sublayers scale by , producing entries . For any mesh used below, put for and otherwise. For each feature row, apply the residual updates in increasing order for . The th update sends exactly to and leaves values outside that interval unchanged; hence every column- value in is mapped to one of . 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 from [F3], where position offsets make every column distinct. For each grid cell meeting , choose a representative and set ; set arbitrary values, for example zero, on cells disjoint from . The position-tagged assertion of [F3] realizes this finite table exactly.
It remains to replace the modified gates and uniform hardmax in [F3] by the standard ReLU and softmax of . Consider any scalar gate that is affine on the three intervals cut by , with formulas , , and , and with at least one . Fix . Replace the parts on and by linear ramps joining the left, middle, and right affine pieces, and leave unchanged elsewhere. The resulting continuous piecewise-affine map has knots , , , and successive slopes , , , , . Put . It is a constant plus four ReLUs: use at knots not in and at knots in , choosing any applicable case if , if , or if ; add the constant that matches the left affine piece. In each case the left-tail slope is and the right-tail slope is , while the slope jump at each knot is , 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 for and for is exactly . 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 , softmax of converges as to equal weights on its maximizing coordinates and zero elsewhere; hence it converges to the uniform hardmax used in [F3].
Choose with integer large enough that , the duplicate-cell bound below is small, and for a fixed . In the modified unpositioned construction, first apply to each feature row the residual gate , where for , for , and for . This sends every out-of-range coordinate to the sentinel . Then, in increasing order for , apply , with for and otherwise. The th clamp sends precisely to 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 . For the unpositioned branch, partition the normalized cube into half-open grid cells of side . Their preimages under have side . By [F4], the oscillation of between two points of at distance at most tends to zero with . For each orbit of distinct-column grid matrices under column permutations, if the closed preimage cell meets , choose one representative in that intersection and put ; transport the choice by permutations and set on orbits whose cells miss . This is a finite choice and gives . Apply the first assertion of [F3] to this table.
By [F4], for sufficiently small every point of and the representative in its grid cell have outputs within any prescribed tolerance. The cell diameter in the original coordinates is at most , and has finite measure because it is compact and bounded. Thus the integrated error of the modified position-tagged lookup can be made arbitrarily small.
The table network agrees with on every point of 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 because for each pair of columns, equality leaves only grid matrices. The table is zero on cells not meeting ; cells meeting but lying partly outside it are contained in the -neighborhood of . Intersect these neighborhoods with one fixed bounded box containing . Along any sequence , the resulting closed neighborhoods decrease to and have finite measure; [F5]–[F6] imply that their excess measure over tends to zero. The table values are bounded because is continuous on compact . Outside the normalized cube the sentinel branch of [F3] returns zero, as does . Therefore the integrated error of the modified lookup tends to zero as .
To control the unbounded input domain in the first assertion, insert an exact sentinel gate before simulating the lookup. For a quantized matrix , put and A size-one softmax head with constant query , key , value , and output vector sends to . If all entries of are in , then every , so every shifted entry is nonnegative. If any entry is the sentinel , then . The entropy identity and the bounds and imply , by the choice in step 2.1. Since every entry of is at most , every shifted entry is then negative. Apply coordinatewise ReLU, implemented by the residual update 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 , so their weights remain and their weighted mean is ; add times this mean to each feature. This restores , and sends the zero state to zero. These two attention updates and the coordinatewise clipping are ordinary blocks in .
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 . 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.
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.
Use a separate width 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 : its initial residual sentinel ramp joins output values and , or and , and each later clamp ramp stays between its adjacent grid endpoints. A raw normalized coordinate outside is an exact sentinel and stays so through the clamps. By step 4.1, all inputs outside the fixed box 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 included, makes the total error less than in both assertions.
Depends on
- Transformer encoder, decoder, and fixed-width expressivity blocks
- Two-head fixed-width Transformers implement finite-grid lookups
- Position-free unmasked self-attention is permutation equivariant
- The Axiom of Countable Choice ($\mathrm{AC}_\omega$)
- Assuming countable choice, $\mathcal{L}(\mathbb{R}^n)$ is a sigma-algebra containing every elementary set and $\lambda_n$ is a complete measure extending elementary volume
- A box in $\mathbb{R}^n$ with parameters $a_i\le b_i$ is Lebesgue measurable of measure $\prod_{i<n}(b_i-a_i)$, whichever of its faces are included
- Assuming countable choice, every Borel subset of $\mathbb{R}^n$ is Lebesgue measurable
- Heine-Cantor: a continuous map from a compact metric space to any metric space is uniformly continuous
- Continuity from above when one set has finite measure
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
- Yun et al., Are Transformers Universal Approximators of Sequence-to-Sequence Functions?, Theorems 2–3 and Appendices B–C (standard reference, not scraped)
- Tokio Kajitsuka and Issei Sato, Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?, Proposition 1 and Appendix A.5 (standard reference, not scraped)