Skip to content

Remove custom SizeOf instances.#424

Open
abdoo8080 wants to merge 1 commit intostrata-org:mainfrom
abdoo8080:sizeOf
Open

Remove custom SizeOf instances.#424
abdoo8080 wants to merge 1 commit intostrata-org:mainfrom
abdoo8080:sizeOf

Conversation

@abdoo8080
Copy link
Contributor

Issue #, if available:

Description of changes:

This PR removes several custom SizeOf instances. The default instances provided by Lean interact much better with the built‑in termination checker, and the custom ones were interfering with automation.

Previously, a custom SizeOf String instance had been introduced to avoid non‑computability issues with the default instance. That workaround is not needed: the definition that depended on it now calls String.length directly, so the custom instance (which can break downstream code) is commented out.

Note: Many uses of @SizeOf.sizeOf α in the codebase are not guarded by an explicit [SizeOf α] argument, which causes Lean to fall back to the default instance and return 0 unexpectedly. Adding the missing type‑class arguments exposes further issues, since some types lack computable SizeOf instances. Long‑term, it may be cleaner to introduce a dedicated type-class and migrate the relevant code to use it consistently, rather than relying on Lean's automatically generated SizeOf instances.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@abdoo8080 abdoo8080 requested a review from a team as a code owner February 13, 2026 20:44
@shigoel shigoel enabled auto-merge February 13, 2026 21:03
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