feat: add normalize_instance% using core's normalizeInstance#37073
feat: add normalize_instance% using core's normalizeInstance#37073
Conversation
b2d6174 to
9e22b9c
Compare
|
!radar |
…zeInstance` Adds a new `normalize_instance%` term elaborator that delegates instance normalization to Lean core's `normalizeInstance` (from lean4#12897), working at `instances` transparency. This is a step toward eventually replacing `fast_instance%` with core functionality. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ible Replace ~53 `fast_instance%` call sites with `normalize_instance%`, which delegates to Lean core's `normalizeInstance`. This covers equiv/type-alias transfers, surjective constructors, DFunLike leaf instances, quotient instances, and inferInstanceAs% sites. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9e22b9c to
41b9556
Compare
PR summary 1fb91738acImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
!radar |
|
!radar |
|
Benchmark results for 41b9556 against 1fb9173 are in. There are no significant changes. @kim-em
Small changes (1✅, 1🟥)
|
|
I agree it would be nice to have the same backend implementation for both (When we do merge this, the doc-string of |
|
This pull request has conflicts, please merge |
This PR adds a new
normalize_instance%term elaborator that delegates to Lean core'snormalizeInstance(from leanprover/lean4#12897), and replaces ~53fast_instance%call sites where the replacement is safe.normalize_instance%is a thin wrapper (~15 lines) aroundLean.Meta.normalizeInstance. Likefast_instance%, it reduces instances to constructor applications and reuses canonicalsub-instances. Unlike
fast_instance%, it works atinstancestransparency and delegates allnormalization logic to core.
The replaced sites cover:
This PR doesn't attempt to replace all
fast_instance%; it gets more complicated!🤖 Prepared with Claude Code