A quantifier-free matrix is a Boolean function of its atoms #
The machine evaluates the matrix of its step formula atom by atom: a
subroutine per atom, each ending in a state that records whether that atom holds,
the accumulating assignment kept in the coordinates of the state – one
coordinate per atom, holding one of the two designated elements the tracks of
DescriptiveComplexity.Problems.Wide.DrawTracks carry. When every atom has been
evaluated, one transition reads off the answer.
For that to be correct the matrix must be a function of its atoms' truths, and this file says so:
DescriptiveComplexity.Draw.qfValue– the value of a formula given a truth value for each atom;DescriptiveComplexity.Draw.realize_qfValue– on a quantifier-free formula it is the realization;DescriptiveComplexity.Draw.qfAtoms– the atoms, finitely many;DescriptiveComplexity.Draw.qfValue_congr– only those matter, so a machine that has evaluated them has evaluated the matrix.
The last two are what make the phase count linear in the number of atoms rather
than exponential in it: the machine visits qfAtoms once and the final transition
is a disjunction over the assignments that satisfy qfValue, a finite list a
defining formula can write out.
The recursion is total, the correctness is not. IsQF is a Prop, so a
definition cannot recurse on it; qfValue and qfAtoms are therefore defined on
every bounded formula, sending a quantifier node to False and to [], and
correctness is proved by induction on FirstOrder.Language.BoundedFormula.IsQF,
where no such node is reachable. This is the shape of
DescriptiveComplexity.ExpExpansion.translQF in Exponential/Matrix.lean, and it
is the standard way to recurse on a syntactic class carved out by a Prop.
Discarding the quantifier node is also why the list stays at one depth: a
quantifier-free formula never changes it.
The atoms of a formula, left to right. Total on every bounded formula: a quantifier node contributes none, which is what keeps the list at one depth.
Equations
- DescriptiveComplexity.Draw.qfAtoms FirstOrder.Language.BoundedFormula.falsum = []
- DescriptiveComplexity.Draw.qfAtoms (FirstOrder.Language.BoundedFormula.equal t₁ t₂) = [FirstOrder.Language.BoundedFormula.equal t₁ t₂]
- DescriptiveComplexity.Draw.qfAtoms (FirstOrder.Language.BoundedFormula.rel r ts) = [FirstOrder.Language.BoundedFormula.rel r ts]
- DescriptiveComplexity.Draw.qfAtoms (φ.imp ψ) = DescriptiveComplexity.Draw.qfAtoms φ ++ DescriptiveComplexity.Draw.qfAtoms ψ
- DescriptiveComplexity.Draw.qfAtoms f.all = []
Instances For
Dependency graph
The value of a formula given a truth value for each atom: the Boolean function a machine computes once its subroutines have evaluated the atoms. Total, for the reason in the module docstring.
Equations
- DescriptiveComplexity.Draw.qfValue FirstOrder.Language.BoundedFormula.falsum x✝ = False
- DescriptiveComplexity.Draw.qfValue (FirstOrder.Language.BoundedFormula.equal t₁ t₂) x✝ = x✝ (FirstOrder.Language.BoundedFormula.equal t₁ t₂)
- DescriptiveComplexity.Draw.qfValue (FirstOrder.Language.BoundedFormula.rel r ts) x✝ = x✝ (FirstOrder.Language.BoundedFormula.rel r ts)
- DescriptiveComplexity.Draw.qfValue (φ.imp ψ) x✝ = (DescriptiveComplexity.Draw.qfValue φ x✝ → DescriptiveComplexity.Draw.qfValue ψ x✝)
- DescriptiveComplexity.Draw.qfValue f.all x✝ = False
Instances For
Dependency graph
Only the atoms matter. Two assignments agreeing on the atoms of a formula
give it the same value – so a machine that has evaluated qfAtoms has evaluated
the matrix, and the finitely many assignments to those atoms are what the final
transition is a disjunction over.
Dependency graph
A quantifier-free formula is the Boolean function of its atoms. Its
realization is DescriptiveComplexity.Draw.qfValue at the assignment that reads
each atom off the structure – which is exactly what the machine's subroutines
compute, one atom at a time.