lean4-htt/tests
Leonardo de Moura ae5fe802ce
feat: stepwise proof terms for the commutative ring procedure in grind (#8189)
This PR implements **stepwise proof terms** in the commutative ring
procedure used by `grind`. These terms serve as an alternative
representation to the traditional Nullstellensatz certificates, aiming
to address the **exponential worst-case complexity** often associated
with certificate construction.

While various compression techniques for Nullstellensatz certificates
exist, they are not implemented in our procedure. Moreover, many of
these techniques rely on additional properties not available in
arbitrary commutative rings. In contrast, the stepwise proof terms
encode the **actual derivation** used during simplification, offering
significantly better scalability in practice.
Here is a motivating example:
```lean
example {α} [CommRing α] [IsCharP α 0] (d t c : α) (d_inv PSO3_inv : α)
  (Δ40 : d^2 * (d + t - d * t - 2) * (d + t + d * t) = 0)
  (Δ41 : -d^4 * (d + t - d * t - 2) *
         (2 * d + 2 * d * t - 4 * d * t^2 + 2 * d * t^4 + 2 * d^2 * t^4 - c * (d + t + d * t)) = 0)
  (_ : d * d_inv = 1)
  (_ : (d + t - d * t - 2) * PSO3_inv = 1) :
  t^2 = t + 1 := by grind +ring
```
In this case, the Nullstellensatz certificate generated by our procedure
contains **over 20,000 terms**, which overwhelms the Lean kernel during
verification. @kim-em also computed certificates using Mathematica with
various variable orderings, producing results between **500 and 2,000
terms**: still quite large.

By switching to stepwise derivations:
- `grind` completes the goal in **under 10 ms**
- The Lean kernel checks the resulting proof term in **under 1 second**

This change dramatically improves both the performance and robustness of
`grind` for nontrivial algebraic goals.
2025-04-30 18:45:29 +00:00
..
bench chore: robustify Nix shell (#8141) 2025-04-28 15:08:32 +00:00
compiler feat: wait on dedicated tasks after main is finished (#7958) 2025-04-14 11:53:54 +00:00
elabissues
ir
lean feat: stepwise proof terms for the commutative ring procedure in grind (#8189) 2025-04-30 18:45:29 +00:00
pkg feat: private import and import all (#8159) 2025-04-30 10:06:54 +00:00
playground chore: adjust BEq classes (#7855) 2025-04-16 13:24:23 +00:00
plugin
simpperf
.gitignore
common.sh chore: normalize URLs to the language reference in test results (#7782) 2025-04-02 06:17:31 +00:00
lean-toolchain