fix: mark auxiliary definitions from `normalizeInstance` as `meta` (#13043) This PR fixes a bug where `inferInstanceAs` and the default `deriving` handler, when used inside a `meta section`, would create auxiliary definitions (via `normalizeInstance`) that were not marked as `meta`. This caused the compiler to reject the parent `meta` definition with: ``` Invalid `meta` definition `instEmptyCollectionNamePrefixRel`, `instEmptyCollectionNamePrefixRel._aux_1` not marked `meta` ``` The fix adds an `isMeta` parameter to `normalizeInstance` that is propagated from the elaboration context (`isMarkedMeta` for `inferInstanceAs`, `Scope.isMeta` for the deriving handler), and marks each auxiliary definition created by `mkAuxDefinition` as `meta` when appropriate. Found while adapting Mathlib to https://github.com/leanprover/lean4/pull/12897. 🤖 Prepared with Claude Code Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.