Documentation

CslibFrontier.Logics.RealArithmetic.FormulaEquation

Encoding formula gates by one real equation #

Allocate a truth variable and two witness variables for each token of the total formula view. Local equations constrain an atom's truth value using an inverse or square-root witness. Connectives use their Boolean truth tables evaluated on their child coordinates. Requiring the root to have a specified truth value and combining the constraints by a sum of squares gives one equation. The construction adapts lean-canny's tree-to-equations reduction at 970f28a5ecefc1327402ade16c068aa4b1b2c183 to the frontier indexed token view.

Main results #

@[reducible, inline]

The original coordinates followed by the truth, first witness and second witness blocks. Each auxiliary block has one coordinate per token of the total formula view.

The sum of squares of the requirement that the root has the given truth value and every local gate constraint.

An assignment gives the requested truth value to the total formula view exactly when it extends to an equation zero. The extension keeps the original initial coordinates.

Construct the canonical term word for the formula equation in polynomial time. Each gate contributes the framed words of its local equations twice, with fixed arithmetic tags. The compiler copies the original comparison term words and forms new unary coordinates from the number of decoded gates.