lean4-htt/src
Kim Morrison 958aa713fa
fix: rename ring variable indices in grind cancel_var proofs (#11410)
This PR fixes a kernel type mismatch error in grind's denominator
cleanup feature. When generating proofs involving inverse numerals (like
`2⁻¹`), the proof context is compacted to only include variables
actually used. This involves renaming variable indices - e.g., if
original indices were `{0: r, 1: 2⁻¹}` and only `2⁻¹` is used, it gets
renamed to index 0.

The bug was that polynomials were correctly renamed via `varRename`, but
the variable index `x` stored in `cancelDen` constraints was passed
directly to the proof without renaming, causing a mismatch between the
polynomial's variable references and the theorem's variable argument.

Added `ringVarDecls` to track ring variable indices that need renaming,
similar to how `ringPolyDecls` tracks polynomials. The `mkRingContext`
function now also renames these variable indices.

See zulip discussion at [#nightly-testing > Mathlib status updates @
💬](https://leanprover.zulipchat.com/#narrow/channel/428973-nightly-testing/topic/Mathlib.20status.20updates/near/560575295).

🤖 Prepared with Claude Code

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-28 04:43:46 +00:00
..
bin
cmake
include/lean perf: less allocations when using string patterns (#11255) 2025-11-19 13:06:27 +00:00
Init doc: correct grammar error in array indexing panic message (#11368) 2025-11-26 23:09:38 +00:00
initialize feat: zero cost BaseIO (#10625) 2025-10-22 10:55:12 +02:00
kernel chore: CI: enable leak sanitizer again (#11339) 2025-11-27 18:32:35 +00:00
lake fix: move the monad argument for ForIn, ForIn', and ForM (#10204) 2025-11-25 12:20:37 +00:00
Lean fix: rename ring variable indices in grind cancel_var proofs (#11410) 2025-11-28 04:43:46 +00:00
library chore: CI: enable leak sanitizer again (#11339) 2025-11-27 18:32:35 +00:00
runtime chore: revert "refactor: port shell option processing to Lean" (#11378) 2025-11-26 09:28:48 +00:00
shell chore: tests: use filenames as test names (#11302) 2025-11-21 12:40:58 +00:00
Std chore: CI: enable leak sanitizer again (#11339) 2025-11-27 18:32:35 +00:00
util chore: revert "refactor: port shell option processing to Lean" (#11378) 2025-11-26 09:28:48 +00:00
cadical.mk
CMakeLists.txt chore: begin dev cycle for v4.27.0 (#11229) 2025-11-18 08:12:49 +00:00
config.h.in
githash.h.in
Init.lean chore: more reorganization of strings (#10928) 2025-10-23 11:56:11 +00:00
lakefile.toml.in feat: USE_LAKE_CACHE CMake option (#10708) 2025-10-08 08:56:53 +00:00
lean-toolchain
Lean.lean chore: use 'library suggestions' rather than 'premise selection' (#11029) 2025-10-31 04:07:49 +00:00
lean.mk.in chore: further split libleanshared on Windows to avoid symbol limit (#10136) 2025-08-26 16:01:57 +00:00
Leanc.lean fix: Unicode path support for Lean Windows executables (#10133) 2025-08-27 11:28:55 +00:00
out feat: ac normalization in grind (#10146) 2025-08-27 03:28:30 +00:00
Std.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
stdlib.make.in chore: further split libleanshared on Windows to avoid symbol limit (#10136) 2025-08-26 16:01:57 +00:00
stdlib_flags.h feat: implement grind_annotated command (#11332) 2025-11-25 02:12:35 +00:00
version.h.in