Skip to content

Test: reject declarations naming the kernel's _nested aux types - #105

Merged
nomeata merged 2 commits into
masterfrom
joachim/test-nested-aux-name
Jul 31, 2026
Merged

nomeata merged 2 commits into
masterfrom
joachim/test-nested-aux-name

Conversation

@nomeata

@nomeata nomeata commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Scaled-down regression test for the kernel bug fixed in
leanprover/lean4#14616. A declaration that names one of the kernel's
_nested auxiliary types must be rejected by a correct kernel (the fix
adds a reserved-prefix check in add_inductive, covering both Expr.const
names and Expr.proj structure names).

This is deliberately NOT a proof of False. The bug's axiom-free False
relies on transient in-kernel state (the equiv_manager defeq cache) that
is not reconstructed on a fresh replay of an export, so it cannot be
captured as an export-based arena test: the same buggy official kernel
that accepts the exploit in-memory rejects the exported form. Instead,
this mirrors the upstream test tests/elab/kernelNestedAuxName.lean.

tests/nested-aux-name.{lean,yaml} export a well-typed inductive KNAux
whose constructor field names the ordinary Prop-valued def
_nested.KNHost_1. Because KNAux is well-typed, an unguarded kernel
accepts it; a guarded kernel rejects it for the reserved _nested prefix.

Verified: official (v4.32.1, guard unreleased) accepts the exported
KNAux -- reported incorrect, as expected; flips to correct once the fix
ships. Uses metaprogramming (skipKernelTC), so a standalone test.

Co-Authored-By: Claude Fable 5 [email protected]
Claude-Session: https://claude.ai/code/session_01N8V39PLAKbpoG7ctgCFhbp

nomeata and others added 2 commits July 31, 2026 18:50
Scaled-down regression test for the kernel bug fixed in
leanprover/lean4#14616. A declaration that names one of the kernel's
_nested auxiliary types must be rejected by a correct kernel (the fix
adds a reserved-prefix check in add_inductive, covering both Expr.const
names and Expr.proj structure names).

This is deliberately NOT a proof of False. The bug's axiom-free False
relies on transient in-kernel state (the equiv_manager defeq cache) that
is not reconstructed on a fresh replay of an export, so it cannot be
captured as an export-based arena test: the same buggy official kernel
that accepts the exploit in-memory rejects the exported form. Instead,
this mirrors the upstream test tests/elab/kernelNestedAuxName.lean.

tests/nested-aux-name.{lean,yaml} export a well-typed inductive KNAux
whose constructor field names the ordinary Prop-valued def
_nested.KNHost_1. Because KNAux is well-typed, an unguarded kernel
accepts it; a guarded kernel rejects it for the reserved _nested prefix.

Verified: official (v4.32.1, guard unreleased) accepts the exported
KNAux -- reported incorrect, as expected; flips to correct once the fix
ships. Uses metaprogramming (skipKernelTC), so a standalone test.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N8V39PLAKbpoG7ctgCFhbp
@nomeata
nomeata merged commit ef877c4 into master Jul 31, 2026
20 checks passed
@nomeata
nomeata deleted the joachim/test-nested-aux-name branch July 31, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant