Post-processing terms #
The arithmetic a counting reduction may apply to the answer of its one oracle
call (DescriptiveComplexity.Counting.Reduction). Two layers, kept apart so
that every number written stays of polynomially many bits:
DescriptiveComplexity.PolyTerm: numerals, definable cardinalities – the number of tagged tuples of the instance satisfying first-order formulas over the ordered expansion – sums and products. Its values are polynomial in the size of the instance.DescriptiveComplexity.PostTerm: the oracle's answer, a polynomial term, a power of two whose exponent is a polynomial term, sums, products, truncated differences, quotients and remainders.
So a post-processing term is a fixed arithmetic expression over the oracle's answer and first-order definable counts: it can be evaluated in polynomial time, and it does no counting of its own beyond tuples of the instance.
Both layers are pulled back along a relativized interpretation
(DescriptiveComplexity.PolyTerm.pull, DescriptiveComplexity.PostTerm.pull):
a definable cardinality of the interpreted structure is a definable
cardinality of the instance. A cardinality is stored as the universe of a
relativized interpretation into the empty vocabulary, so the pullback is the
composition of relativized interpretations and needs nothing new. With
substitution for the oracle's answer (DescriptiveComplexity.PostTerm.subst),
this is what makes one-call reductions compose.
Polynomial terms #
Terms denoting numbers polynomial in the size of the instance: numerals, definable cardinalities, sums and products.
- num
{L : FirstOrder.Language}
(k : ℕ)
: PolyTerm L
A numeral.
- card
{L : FirstOrder.Language}
{Tag : Type}
[Finite Tag]
{dim : ℕ}
(J : RelFOInterpretation (L.sum FirstOrder.Language.order) FirstOrder.Language.empty Tag dim)
: PolyTerm L
The number of tagged tuples satisfying their tag's domain formula, i.e., the size of the universe of a relativized interpretation.
- add
{L : FirstOrder.Language}
(p q : PolyTerm L)
: PolyTerm L
A sum.
- mul
{L : FirstOrder.Language}
(p q : PolyTerm L)
: PolyTerm L
A product.
Instances For
Dependency graph
The value of a polynomial term at an ordered structure.
Equations
- DescriptiveComplexity.PolyTerm.eval A (DescriptiveComplexity.PolyTerm.num k) = k
- DescriptiveComplexity.PolyTerm.eval A (DescriptiveComplexity.PolyTerm.card J) = Nat.card (J.MapRel A)
- DescriptiveComplexity.PolyTerm.eval A (p.add q) = DescriptiveComplexity.PolyTerm.eval A p + DescriptiveComplexity.PolyTerm.eval A q
- DescriptiveComplexity.PolyTerm.eval A (p.mul q) = DescriptiveComplexity.PolyTerm.eval A p * DescriptiveComplexity.PolyTerm.eval A q
Instances For
Dependency graph
The relativized interpretation into the empty vocabulary whose universe is the set of tuples satisfying a formula.
Equations
- DescriptiveComplexity.PolyTerm.cardInterp φ = { relFormula := fun {n : ℕ} (R : FirstOrder.Language.empty.Relations n) => isEmptyElim R, domFormula := fun (x : Unit) => φ }
Instances For
Dependency graph
The number of k-tuples satisfying a first-order formula over the ordered
expansion.
Equations
Instances For
Dependency graph
The number of elements satisfying a first-order formula over the ordered expansion, as a cardinality of a set of elements.
Dependency graph
The number of elements of the instance.
Instances For
Dependency graph
Dependency graph
The pullback of a polynomial term along a relativized interpretation: a definable cardinality of the interpreted structure, ordered lexicographically, is the size of the universe of a composite interpretation.
Equations
- DescriptiveComplexity.PolyTerm.pull I (DescriptiveComplexity.PolyTerm.num k) = DescriptiveComplexity.PolyTerm.num k
- DescriptiveComplexity.PolyTerm.pull I (DescriptiveComplexity.PolyTerm.card J) = DescriptiveComplexity.PolyTerm.card (J.compRel I.ordExtendRel)
- DescriptiveComplexity.PolyTerm.pull I (p.add q) = (DescriptiveComplexity.PolyTerm.pull I p).add (DescriptiveComplexity.PolyTerm.pull I q)
- DescriptiveComplexity.PolyTerm.pull I (p.mul q) = (DescriptiveComplexity.PolyTerm.pull I p).mul (DescriptiveComplexity.PolyTerm.pull I q)
Instances For
Dependency graph
A pulled-back polynomial term has, at the instance, the value of the original term at the interpreted structure.
Dependency graph
Post-processing terms #
The arithmetic applied to the answer of an oracle call: polynomial terms,
powers of two with a polynomial exponent, and the operations +, *,
truncated -, / and % of the natural numbers.
- oracle
{L : FirstOrder.Language}
: PostTerm L
The answer of the oracle.
- poly
{L : FirstOrder.Language}
(p : PolyTerm L)
: PostTerm L
A polynomial term.
- pow2
{L : FirstOrder.Language}
(p : PolyTerm L)
: PostTerm L
Two to the power of a polynomial term.
- add
{L : FirstOrder.Language}
(s t : PostTerm L)
: PostTerm L
A sum.
- mul
{L : FirstOrder.Language}
(s t : PostTerm L)
: PostTerm L
A product.
- sub
{L : FirstOrder.Language}
(s t : PostTerm L)
: PostTerm L
A truncated difference.
- div
{L : FirstOrder.Language}
(s t : PostTerm L)
: PostTerm L
A quotient.
- mod
{L : FirstOrder.Language}
(s t : PostTerm L)
: PostTerm L
A remainder.
Instances For
Dependency graph
The value of a post-processing term at an ordered structure, given the
answer c of the oracle.
Equations
- DescriptiveComplexity.PostTerm.eval A c DescriptiveComplexity.PostTerm.oracle = c
- DescriptiveComplexity.PostTerm.eval A c (DescriptiveComplexity.PostTerm.poly p) = DescriptiveComplexity.PolyTerm.eval A p
- DescriptiveComplexity.PostTerm.eval A c (DescriptiveComplexity.PostTerm.pow2 p) = 2 ^ DescriptiveComplexity.PolyTerm.eval A p
- DescriptiveComplexity.PostTerm.eval A c (s.add t) = DescriptiveComplexity.PostTerm.eval A c s + DescriptiveComplexity.PostTerm.eval A c t
- DescriptiveComplexity.PostTerm.eval A c (s.mul t) = DescriptiveComplexity.PostTerm.eval A c s * DescriptiveComplexity.PostTerm.eval A c t
- DescriptiveComplexity.PostTerm.eval A c (s.sub t) = DescriptiveComplexity.PostTerm.eval A c s - DescriptiveComplexity.PostTerm.eval A c t
- DescriptiveComplexity.PostTerm.eval A c (s.div t) = DescriptiveComplexity.PostTerm.eval A c s / DescriptiveComplexity.PostTerm.eval A c t
- DescriptiveComplexity.PostTerm.eval A c (s.mod t) = DescriptiveComplexity.PostTerm.eval A c s % DescriptiveComplexity.PostTerm.eval A c t
Instances For
Dependency graph
Substitution of a term for the answer of the oracle.
Equations
- DescriptiveComplexity.PostTerm.oracle.subst x✝ = x✝
- (DescriptiveComplexity.PostTerm.poly p).subst x✝ = DescriptiveComplexity.PostTerm.poly p
- (DescriptiveComplexity.PostTerm.pow2 p).subst x✝ = DescriptiveComplexity.PostTerm.pow2 p
- (s.add t).subst x✝ = (s.subst x✝).add (t.subst x✝)
- (s.mul t).subst x✝ = (s.subst x✝).mul (t.subst x✝)
- (s.sub t).subst x✝ = (s.subst x✝).sub (t.subst x✝)
- (s.div t).subst x✝ = (s.subst x✝).div (t.subst x✝)
- (s.mod t).subst x✝ = (s.subst x✝).mod (t.subst x✝)
Instances For
Dependency graph
Dependency graph
The pullback of a post-processing term along a relativized interpretation, its polynomial terms being pulled back.
Equations
- DescriptiveComplexity.PostTerm.pull I DescriptiveComplexity.PostTerm.oracle = DescriptiveComplexity.PostTerm.oracle
- DescriptiveComplexity.PostTerm.pull I (DescriptiveComplexity.PostTerm.poly p) = DescriptiveComplexity.PostTerm.poly (DescriptiveComplexity.PolyTerm.pull I p)
- DescriptiveComplexity.PostTerm.pull I (DescriptiveComplexity.PostTerm.pow2 p) = DescriptiveComplexity.PostTerm.pow2 (DescriptiveComplexity.PolyTerm.pull I p)
- DescriptiveComplexity.PostTerm.pull I (s.add t) = (DescriptiveComplexity.PostTerm.pull I s).add (DescriptiveComplexity.PostTerm.pull I t)
- DescriptiveComplexity.PostTerm.pull I (s.mul t) = (DescriptiveComplexity.PostTerm.pull I s).mul (DescriptiveComplexity.PostTerm.pull I t)
- DescriptiveComplexity.PostTerm.pull I (s.sub t) = (DescriptiveComplexity.PostTerm.pull I s).sub (DescriptiveComplexity.PostTerm.pull I t)
- DescriptiveComplexity.PostTerm.pull I (s.div t) = (DescriptiveComplexity.PostTerm.pull I s).div (DescriptiveComplexity.PostTerm.pull I t)
- DescriptiveComplexity.PostTerm.pull I (s.mod t) = (DescriptiveComplexity.PostTerm.pull I s).mod (DescriptiveComplexity.PostTerm.pull I t)