Skip to content

fix: generate SizeOf spec theorems for inductives with private constructors#13374

Merged
nomeata merged 1 commit intomasterfrom
joachim/issue13373
Apr 12, 2026
Merged

fix: generate SizeOf spec theorems for inductives with private constructors#13374
nomeata merged 1 commit intomasterfrom
joachim/issue13373

Conversation

@nomeata
Copy link
Copy Markdown
Collaborator

@nomeata nomeata commented Apr 12, 2026

This PR fixes SizeOf instance generation for public inductive types that have
private constructors. The spec theorem proof construction needs to unfold
_sizeOf helper functions which may not be exposed in the public view, so
we use withoutExporting for the proof construction and type check.

Closes #13373

…tructors

This PR fixes `SizeOf` instance generation for public inductive types that have
private constructors. The spec theorem proof construction needs to unfold
`_sizeOf` helper functions which may not be exposed in the public view, so
we use `withoutExporting` for the proof construction and type check.

Closes #13373

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nomeata nomeata added the changelog-language Language features and metaprograms label Apr 12, 2026
@nomeata nomeata marked this pull request as ready for review April 12, 2026 12:00
@nomeata nomeata added this pull request to the merge queue Apr 12, 2026
Merged via the queue into master with commit 86579c8 Apr 12, 2026
24 checks passed
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 12, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-11 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-12 12:28:09)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 12, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 12, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 12, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Apr 12, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

volodeyka pushed a commit that referenced this pull request Apr 16, 2026
…tructors (#13374)

This PR fixes `SizeOf` instance generation for public inductive types
that have
private constructors. The spec theorem proof construction needs to
unfold
`_sizeOf` helper functions which may not be exposed in the public view,
so
we use `withoutExporting` for the proof construction and type check.

Closes #13373

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't derive SizeOf for public inductive with private constructor

2 participants