Lean4
/-- `nlinarithExtras` is the preprocessor corresponding to the `nlinarith` tactic.
* For every term `t` such that `t^2` or `t*t` appears in the input, adds a proof of `t^2 ≥ 0`
or `t*t ≥ 0`.
* For every pair of comparisons `t1 R1 0` and `t2 R2 0`, adds a proof of `t1*t2 R 0`.
This preprocessor is typically run last, after all inputs have been canonized.
-/
def nlinarithExtras : GlobalPreprocessor
where
description := "nonlinear arithmetic extras"
transform
ls := do
let new_es ← nlinarithGetSquareProofs ls
let products ← nlinarithGetProductsProofs (new_es ++ ls)
return (new_es ++ ls ++ products)