Skip to content

Conversation

@plp127
Copy link
Collaborator

@plp127 plp127 commented Jan 24, 2026

Mark Shrink and equivShrink as @[no_expose]. This ensures downstream files using the module system can't take advantage of the specific definition of Shrink as an application of Classical.choose.

See also #general > Cardinality model incompatible with Lean compiler @ 💬 on Zulip for an example of bad things that can happen if Shrink is exposed.


Open in Gitpod

@github-actions
Copy link

PR summary cb6b2796fb

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-logic Logic (model theory, etc) label Jan 24, 2026
@[pp_with_univ]
@[pp_with_univ, no_expose]
def Shrink (α : Type v) [Small.{w} α] : Type w :=
Classical.choose (@Small.equiv_small α _)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could also have an opaque shrinkImpl (α : Type v) [Small.{w} α] : { T : Type w // α ≃ T } so that downstream files not using the module system also can't take advantage of the definition of Shrink as a Classical.choose.

Copy link
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there's precedent for opaque defs in Mathlib, but no_expose is an improvement in either case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants