lean4-htt/src/Lean/Meta/Tactic
Leonardo de Moura 70df9742f4
fix: kernel error in grind order module for Nat casts to non-Int types (#13453)
This PR fixes a kernel error in `grind` when propagating a `Nat`
equality to an order structure whose carrier type is not `Int` (e.g.
`Rat`). The auxiliary `Lean.Grind.Order.of_nat_eq` lemma was specialized
to `Int`, so the kernel rejected the application when the cast
destination differed.

We add a polymorphic `of_natCast_eq` lemma over `{α : Type u} [NatCast
α]` and cache the cast destination type in `TermMapEntry`.
`processNewEq` now uses the original `of_nat_eq` when the destination is
`Int` (the common case) and the new lemma otherwise. The symmetric
`nat_eq` propagation (deriving `Nat` equality from a derived cast
equality) is now guarded to fire only when the destination is `Int`,
since the `nat_eq` lemma is still specialized to `Int`.

Closes #13265.
2026-04-17 23:51:21 +00:00
..
AC chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Cbv feat: add linter.redundantVisibility for redundant private/public modifiers (#13132) 2026-04-13 08:34:20 +00:00
Grind fix: kernel error in grind order module for Nat casts to non-Int types (#13453) 2026-04-17 23:51:21 +00:00
Simp chore: enable warning.simp.varHead (#13403) 2026-04-16 16:11:09 +00:00
Try chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
AC.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Acyclic.lean
Apply.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Assert.lean
Assumption.lean
AuxLemma.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Backtrack.lean feat: add structured TraceResult to TraceData (#12698) 2026-03-10 02:42:57 +00:00
Cases.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
CasesOnStuckLHS.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Cbv.lean feat: add tracing to cbv (#12896) 2026-03-13 12:05:49 +00:00
Cleanup.lean feat: add linter.redundantVisibility for redundant private/public modifiers (#13132) 2026-04-13 08:34:20 +00:00
Clear.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Congr.lean chore: revert "feat: abstract metavariables when generalizing match motives (#8099)" (#11941) 2026-01-09 08:24:03 +00:00
Constructor.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Contradiction.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Delta.lean feat: theorems are opaque (#12973) 2026-03-23 13:57:07 +00:00
ElimInfo.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
ExposeNames.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Ext.lean feat: add insertPattern for discrimination tree insertion in Sym (#11884) 2026-01-03 19:27:43 +00:00
FunInd.lean feat: theorems are opaque (#12973) 2026-03-23 13:57:07 +00:00
FunIndCollect.lean
FunIndInfo.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
FVarSubst.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Generalize.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Grind.lean refactor: replace grind canonicalizer with type-directed normalizer (#13166) 2026-03-28 02:43:22 +00:00
IndependentOf.lean
Induction.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Injection.lean feat: heterogeneous noConfusion (#11474) 2025-12-02 15:19:47 +00:00
Intro.lean perf: when matching on values, avoid generating hyps when not needed (#11508) 2025-12-05 16:29:20 +00:00
Lets.lean
LibrarySearch.lean feat: add structured TraceResult to TraceData (#12698) 2026-03-10 02:42:57 +00:00
NormCast.lean perf: more environment blocking avoidance (#11616) 2025-12-12 13:44:58 +00:00
Refl.lean chore: revert "feat: abstract metavariables when generalizing match motives (#8099)" (#11941) 2026-01-09 08:24:03 +00:00
Rename.lean
Repeat.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Replace.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Revert.lean
Rewrite.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Rewrites.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Rfl.lean feat: add insertPattern for discrimination tree insertion in Sym (#11884) 2026-01-03 19:27:43 +00:00
Simp.lean
SolveByElim.lean feat: add structured TraceResult to TraceData (#12698) 2026-03-10 02:42:57 +00:00
Split.lean chore: fix spelling (#11531) 2025-12-06 13:54:27 +00:00
SplitIf.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Subst.lean perf: add introSubstEq shortcut (#12190) 2026-01-28 12:33:14 +00:00
Symm.lean feat: add insertPattern for discrimination tree insertion in Sym (#11884) 2026-01-03 19:27:43 +00:00
Try.lean
TryThis.lean feat: stricter meta check for temporary programs in native_decide etc (#13005) 2026-03-20 15:51:18 +00:00
Unfold.lean refactor: DiscrTree (#11875) 2026-01-02 19:53:45 +00:00
UnifyEq.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
Util.lean fix: fix a collection of docstring errors (#12959) 2026-03-19 06:42:11 +00:00