- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in Mathlib
A code of length \(\mathcal{L}\) over an alphabet \(\Sigma \) is a set \(\mathcal{C}\subseteq \Sigma ^{\mathcal{L}}\) of words. The formalization uses \(\mathsf{Set}\, (\mathcal{L}\to \Sigma )\) directly and has no separate declaration for it.
A computable multilinear polynomial in \(n\) variables is a vector of length \(2^n\), holding either its monomial coefficients or its evaluations on \(\{ 0,1\} ^n\), indexed little-endian.
For a smooth domain \(\mathcal{L}\) of size \(2^n\), \(m\in \mathbb {N}\), a weight polynomial \(\hat{w}\in \mathbb {F}[Z,X_1,\ldots ,X_m]\) and \(\sigma \in \mathbb {F}\), the constrained code \(\mathrm{CRS}[\mathbb {F},\mathcal{L},m,\hat{w},\sigma ]\) consists of the codewords \(f\in \mathrm{RS}[\mathbb {F},\mathcal{L},2^m]\) whose multilinear polynomial \(\hat{f}\) satisfies \(\sum _{b\in \{ 0,1\} ^m}\hat{w}(\hat{f}(b),b)=\sigma \).
A matrix \(G\) generates the linear code spanned by its rows (equivalently, the image of \(v\mapsto vG\)); the column variant takes the image of \(v\mapsto Gv\).
To run oracle computations, we need a way to handle (or implement) the oracle queries. A query implementation QueryImpl spec m maps every query \(t\) to a computation in a monad \(m\) returning an answer in spec.Range t. Depending on the monad, this allows various interpretations of the queries.
Using the simulation framework, we can add logging and caching behaviors to oracle queries:
Logging records all queries made during a computation
Caching remembers query responses and reuses them for repeated queries
Logging forwards every query and records it. Caching forwards only cache misses and answers repeated queries from the cache.
The multi-constrained code for weights \(\hat{w}_0,\ldots ,\hat{w}_{t-1}\) and targets \(\sigma _0,\ldots ,\sigma _{t-1}\) consists of the codewords of \(\mathrm{RS}[\mathbb {F},\mathcal{L},2^m]\) that satisfy every one of the \(t\) weight constraints.
For a commutative ring \(R\) and a function \(v:\{ 0,1\} ^{\sigma }\to R\), the multilinear extension of \(v\) is \(\widetilde{v}:=\sum _{x\in \{ 0,1\} ^{\sigma }}\mathsf{eq}(x,X)\cdot v(x)\), where \(\mathsf{eq}(x,X)=\prod _{i}\bigl((1-x_i)(1-X_i)+x_iX_i\bigr)\).
An oracle computation OracleComp spec \(\alpha \) is a program that makes queries to the oracles of spec and returns a value of type \(\alpha \). It is the free monad of the polynomial functor of spec, so every computation either
returns a value without making any queries (
pure), ormakes one query \(t\) and continues with a function of the answer in
spec.Range t(queryBind).
There is no failure constructor. Computations that may fail are written in OptionT (OracleComp spec). Computations whose only oracle is unifSpec are called probabilistic computations, ProbComp.
An oracle specification on an index type \(\iota \) is a map \(\mathsf{spec} : \iota \to \mathsf{Type}\). Each \(t : \iota \) is a possible query, and \(\mathsf{spec}\ t\) is the type of answers to that query. The query type is therefore the index type itself (spec.Domain is \(\iota \)), and the answer type depends on the query (spec.Range t is \(\mathsf{spec}\ t\)). An oracle specification is the same data as a polynomial functor with positions \(\iota \) and directions \(\mathsf{spec}\ t\). The specification only describes interfaces, not how the oracles behave.
A computation denotes a subprobability measure on its outputs, evalDist mx. The missing mass represents failure or nontermination; the output distribution does not add an Option outcome. For oracle computations, the semantics is fixed by choosing a probability measure on the answers to each query. The usual choice is the uniform measure, as for ProbComp. Probabilities of outputs and events are defined from this measure.
Given a query implementation of spec in a monad \(m\), simulateQ runs an oracle computation by substituting the implementation for each query. Taking \(m\) to be a computation with access to other oracles, possibly with state (for example a state monad over OracleComp spec'), simulates one specification by another.
A smooth Reed–Solomon code is a Reed–Solomon code whose evaluation domain is a smooth coset FFT domain: a coset of a multiplicative subgroup of \(\mathbb {F}^\times \) of order \(2^n\).
\(A \to _{\mathsf{o}} B\): oracles that take inputs in \(A\) and answer every query in \(B\).
emptySpec, written \([]_{\mathsf{o}}\): no oracles.coinSpec\(= \mathsf{Unit} \to _{\mathsf{o}} \mathsf{Bool}\): a coin-flipping oracle.unifSpec: indexed by \(n \in \mathbb {N}\), the query \(n\) is answered in \(\mathsf{Fin}\ (n+1) = \{ 0, \ldots , n\} \); with uniform answers it samples uniformly from this set.
Specifications combine by disjoint sum \(\mathsf{spec}_1 + \mathsf{spec}_2\).
In \(S\), with \(\mathrm{mk}\) the quotient map and \(\sigma _{-1} = \texttt{galoisAutₛ}\) of exponent \(2^{\alpha +1}-1\),
Since \(\mathrm{mk}\, X\) is a unit, \(\sigma _{-1}\) carries the ideal \((\mathrm{mk}\, p)\) onto \((\mathrm{mk}\, p^{\mathrm{rev}})\). Proved from Mathlib’s Polynomial.eval₂_reverse_mul_pow at the point \((\mathrm{mk}\, X)^{-1} = (\mathrm{mk}\, X)^{c}\).
A finite nontrivial commutative integral domain is a field. (Mathlib; Finite.isField_of_domain / Fintype.fieldOfDomain.)
Two finite fields of equal cardinality are isomorphic; in particular a finite field of cardinality \(q^{n}\) is isomorphic to \(\texttt{GaloisField } q\ n\). (Mathlib; GaloisField/FiniteField API.)
For \(q \equiv 5 \pmod8\), reversal swaps the two factors: if \(X^{2^\alpha }+1 = p_1 p_2\) with \(p_1, p_2\) irreducible, then \(p_1^{\mathrm{rev}}\) is associated to \(p_2\). This is the step carrying the \(-1 \notin \langle q\rangle \) root-orbit content. The root set of \(p_1\) is a single Frobenius orbit \(=\) a coset of \(\langle q\rangle \); were \(p_1^{\mathrm{rev}} \sim p_1\) it would be closed under \(\zeta \mapsto \zeta ^{-1}\), i.e. \(-1 \in \langle q\rangle \), contradicting Lemma 305; as reversal permutes the two factors of the self-reciprocal \(X^{2^\alpha }+1\), it sends \(p_1\) to \(p_2\).
If \(S \le T\) is a subring of an integral domain \(T\), then \(S\) is an integral domain (it inherits NoZeroDivisors; Mathlib).
Let \(\mathcal{L}\) be a nonempty finite domain embedded in a field \(\mathbb {F}\), let \(d{\gt}0\), and let \(\rho =\min \{ d,|\mathcal{L}|\} /|\mathcal{L}|\) be the rate of \(\mathrm{RS}[\mathbb {F},\mathcal{L},d]\). For every real \(\eta {\gt}0\), the code \(\mathrm{RS}[\mathbb {F},\mathcal{L},d]\) is \(\bigl(1-\sqrt{\rho }-\eta ,\ 1/(2\eta \sqrt{\rho })\bigr)\)-list decodable. The field need not be finite, and the bound does not depend on \(|\mathbb {F}|\).
Let \(R\) be an integral domain, let \(p\in R[X_1,\ldots ,X_n]\) be nonzero, and let \(S_1,\ldots ,S_n\subseteq R\) be finite sets. Then