Skip to content

tests: add orphan-rec and orphan-ctor - #158

Merged
nomeata merged 1 commit into
masterfrom
joachim/orphan-rec-ctor
Aug 25, 2026
Merged

tests: add orphan-rec and orphan-ctor#158
nomeata merged 1 commit into
masterfrom
joachim/orphan-rec-ctor

Conversation

@nomeata

@nomeata nomeata commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Two hand-written exports in which a bogus declaration escapes checking by
not being attached to any inductive declaration, rather than by
disagreeing with one:

  • orphan-rec: a second recursor rogue : False in False's inductive
    block whose all field is empty, so a checker that requires the
    recursors naming an inductive type to be exactly the derived ones never
    looks at it. This is the sibling of extra-rec that defeats the obvious
    fix for it; nanoda accepted it until ammkrn/nanoda_lib@8a327a1.

  • orphan-ctor: a constructor rogue : False in False's inductive block
    (which keeps ctors: []) whose induct field names a declaration that
    does not exist in the export.

Both are written by hand because lean4export cannot produce them: it
collects an inductive block's recursors from the all fields of the
recursors and its constructors from the inductive's ctors field, so
either orphan is silently dropped.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SbJDfxpQcw7Zh4LF9YZzNP

Two hand-written exports in which a bogus declaration escapes checking by
not being attached to any inductive declaration, rather than by
disagreeing with one:

* orphan-rec: a second recursor `rogue : False` in `False`'s inductive
  block whose `all` field is empty, so a checker that requires the
  recursors naming an inductive type to be exactly the derived ones never
  looks at it.  This is the sibling of extra-rec that defeats the obvious
  fix for it; nanoda accepted it until ammkrn/nanoda_lib@8a327a1.

* orphan-ctor: a constructor `rogue : False` in `False`'s inductive block
  (which keeps `ctors: []`) whose `induct` field names a declaration that
  does not exist in the export.

Both are written by hand because lean4export cannot produce them: it
collects an inductive block's recursors from the `all` fields of the
recursors and its constructors from the inductive's `ctors` field, so
either orphan is silently dropped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SbJDfxpQcw7Zh4LF9YZzNP
@nomeata
nomeata enabled auto-merge (squash) August 25, 2026 05:38
@nomeata
nomeata merged commit 0a8540e into master Aug 25, 2026
24 checks passed
@nomeata
nomeata deleted the joachim/orphan-rec-ctor branch August 25, 2026 05:52
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