Rational hitting lists: affine realizations #
Every rational formula f has a linear realization: a square matrix Formula.pencil f of affine
forms in the variables, indexed by a finite type Formula.Index f with f.nodeCount + 1
elements, together with a rational row and column. Wherever f is defined, the evaluated pencil
is invertible and the row, inverse and column multiply to the value of f. Conversely, f is
defined with an invertible value exactly when the pencils of its inverse nodes and of its
augmented root are invertible (Formula.certificates_iff); no rational cancellation is performed.
Main definitions #
Cslib.Circuits.Rational.Affine.Form,Cslib.Circuits.Rational.Affine.constant,Cslib.Circuits.Rational.Affine.varForm,Cslib.Circuits.Rational.Affine.eval,Cslib.Circuits.Rational.Affine.constMatrix,Cslib.Circuits.Rational.Affine.coeff,Cslib.Circuits.Rational.Affine.homogeneous: affine forms, constant matrices, homogeneous coefficients and evaluation.Cslib.Circuits.Rational.Formula.Index,Cslib.Circuits.Rational.Formula.pencil,Cslib.Circuits.Rational.Formula.row,Cslib.Circuits.Rational.Formula.col,Cslib.Circuits.Rational.Formula.realized,Cslib.Circuits.Rational.Formula.rowR,Cslib.Circuits.Rational.Formula.colR,Cslib.Circuits.Rational.Formula.scalar: the realization and its evaluated matrices.Cslib.Circuits.Rational.Formula.inverseNodes,Cslib.Circuits.Rational.Formula.certificates: the inverse occurrences of a formula, and these together with the augmented root.
Main results #
Cslib.Circuits.Rational.Formula.card_index: the realization hasf.nodeCount + 1rows.Cslib.Circuits.Rational.Formula.Eval.realization: exact realization of defined formulas.Cslib.Circuits.Rational.Formula.certificates_iff: invertible certificate pencils are equivalent to a defined invertible value.Cslib.Circuits.Rational.Formula.certificate_bounds: the number and sizes of the certificates.
References #
A constant coefficient and one rational coefficient per variable.
Instances For
The affine form with the given constant and zero variable coefficients.
Instances For
The affine coordinate form for one variable.
Instances For
The realization is defined by recursion on the native constructors input and gate, so that
its index type reduces to sums of the index types of the arguments args j. The proofs below
therefore also proceed by induction on the native constructors.
The finite row and column index type of the formula's linear realization.
Instances For
The index type of a realization has decidable equality.
The realization of a formula has one more row than the formula has nodes.
The affine matrix pencil built recursively from a rational formula.
Instances For
Exact affine realization of every defined formula: the evaluated pencil is invertible, and the row, its inverse and the column multiply to the value.
A variable leaf has no inverse nodes.
A constant leaf has no inverse nodes.
The inverse nodes of add f g are those of f followed by those of g.
The inverse nodes of mul f g are those of f followed by those of g.
The inverse nodes of inv f are inv f followed by those of f.
If the realized pencil of every inverse node of f is a unit, then f evaluates to some
value at X.
Every inverse node of f has at most f.nodeCount nodes.
A formula with at most s nodes has at most s + 1 certificates, each of dimension at most
2 * s + 1.
If Z 0 is a unit z and the homogenized pencil is a unit, then the normalized affine pencil
at i ↦ z⁻¹ * Z i.succ is a unit.
Reindexing a pencil's coefficients does not alter its matrix evaluation.
Homogeneous affine coefficients give exactly the ordinary Kronecker pencil.