Skip to content

Always provide primitive eta when check_eliminations is disabled#21952

Open
ebmoon wants to merge 4 commits intorocq-prover:masterfrom
theorem-labs:disable-check-eliminations
Open

Always provide primitive eta when check_eliminations is disabled#21952
ebmoon wants to merge 4 commits intorocq-prover:masterfrom
theorem-labs:disable-check-eliminations

Conversation

@ebmoon
Copy link
Copy Markdown

@ebmoon ebmoon commented Apr 23, 2026

Summary

When Unset Elimination Checking is active, records with irrelevant (SProp) fields in relevant sorts (Prop, Type, Set) are now given primitive eta, bypassing the usual elimination restriction checks.

This is motivated by the Lean-to-Rocq import pipeline, where Lean structures unconditionally have eta regardless of field relevance. Without this change, imported records with irrelevant fields lose eta, causing definitional equalities that hold in Lean to fail in Rocq.

Related issue: rocq-community/rocq-lean-import#63

  • Added / updated test-suite.

ebmoon and others added 2 commits April 23, 2026 21:02
…nations is disabled

When check_eliminations is false, primitive records with no relevant
arguments now get AlwaysEta instead of NoEta. This allows definitional
eta expansion for such records without unconditionally changing the
default behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add bypass_check(eliminations) attribute for inductive declarations
- Add Set/Unset Elimination Checking vernacular option
- Add set_check_eliminations in safe_typing and Global
- Add test suite covering eta behavior with and without the flag,
  including a Rocq translation of the Lean Inhabited' example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ebmoon ebmoon requested review from a team as code owners April 23, 2026 21:49
@ebmoon ebmoon marked this pull request as draft April 23, 2026 21:50
@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Apr 23, 2026
@SkySkimmer
Copy link
Copy Markdown
Contributor

Note that it's possible that lean still accepts some definitional equalities that rocq doesn't even with this patch, because the rocq conversion checker is not expected to be particularly complete when check_eliminations is off.

@ebmoon ebmoon marked this pull request as ready for review April 23, 2026 21:53
@JasonGross
Copy link
Copy Markdown
Member

JasonGross commented Apr 23, 2026

@coqbot run full ci

Comment thread vernac/vernacentries.ml Outdated
@JasonGross JasonGross added the request: full CI Use this label when you want your next push to trigger a full CI. label Apr 23, 2026
…bute only

The check_eliminations flag is not meant to be exposed as a global
Set/Unset option. It should only be used per-definition via the
#[bypass_check(eliminations)] attribute (e.g. by the Lean importer plugin).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coqbot-app coqbot-app Bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Apr 23, 2026
Comment thread vernac/attributes.ml Outdated
@yannl35133
Copy link
Copy Markdown
Contributor

How important is eta for such structures? In any case, Lean will be able to combine eta and irrelevance in a way Rocq won't (and there's also eta for unit that won't happen in Rocq).
Unset elimination constraints is not meant to be a long-supported setting, seeing as it breaks Rocq invariants (although this may be at a similar scale to Lean itself, if it only breaks conversion transitivity).

@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Apr 23, 2026
@SkySkimmer SkySkimmer self-assigned this Apr 28, 2026
@SkySkimmer SkySkimmer added the needs: squashing Some commits should be squashed together. label Apr 28, 2026
@SkySkimmer SkySkimmer added this to the 9.3+rc1 milestone Apr 28, 2026
@SkySkimmer SkySkimmer added the kind: internal API, ML documentation... label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: internal API, ML documentation... needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. needs: squashing Some commits should be squashed together.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants