fix: share synthesized instances in `grind`'s term store This PR fixes a slowdown in `grind` in the presence of the persistent type class resolution cache: a cached instance, reopened from an abstracted schema, is not maximally shared, so `grind` re-walked it on every `shareCommon` of a term containing it. `Sym.synthInstance?` now runs the synthesized instance through `Sym.shareCommon`, interning it into the local term store once, as `grind` already does for every other term it internalizes. Later `shareCommon` calls then find it shared by pointer. On `Mathlib.Logic.Equiv.Prod` this cuts elaboration from 93.7G to 43.1G instructions (the cost without the cache), with the alpha-hash-consing (`Sym.AlphaShareCommon`) share of runtime dropping from 28% back to near zero. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.