Documentation

Lean.Meta.Tactic.Grind.Arith.Cutsat.Proof

State for the cutsat proof construction monad.

The final proof may reference only a small subset of the cutsat variables. Thus, we normalize the variables and remove any that are unused from the context. The variable order must be preserved, as the cutsat auxiliary theorems assume the polynomials are ordered.

Another complication is that cutsat may reorder variables during the search, possibly several times. Each reordering starts a new epoch (see State.varsHistory), and a .reorder c justification is the delimiter into the previous epoch: c and its dependencies use the variable order of the epoch before the reordering. Every epoch has its own declarations and variable contexts.

While constructing a proof, we use auxiliary free variables for variables, polynomials, expressions, and the variable contexts. Cutsat also uses the ring solver to normalize nonlinear polynomials. After construction, variables are renamed, and variables, polynomials, and expressions are replaced with their (ground) values.

Constraints stored in the goal of an enclosing case split are hoisted: they are proved once in that goal, and shared by all branches of the case split (see hoisting). A proof built in the goal of the case split at depth d uses the variable contexts of depth d, which only contain the variables of that goal. All proofs share one renaming: the cutsat and CommRing variables are numbered in creation order, so the variables of an enclosing goal are renamed to a prefix of the renamed variables. A cutsat variable context is declared in the outermost enclosing case split where its variables exist, and a CommRing variable context in the case split at its depth. A variable context is shared by all proofs that use an equal context (see Grind.hoistDecl).

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      A cutsat proof may depend on decision variables. We collect them and perform non chronological backtracking.