Repository navigation
restateOne: bind the declaration's universe parameters - #17
Merged
Merged
Conversation
The first real declaration ever put through restate came back not_checkable | elaboration threw: unknown universe level `u_2` A universe-polymorphic statement mentions its level parameters by name, and `elabTerm` resolves those against `Term.Context.levelNames` -- which is EMPTY for a string parsed out of a review. So every polymorphic statement was unverifiable, and the failure presented as a tooling error on a statement that had not changed: the review silently could not be carried forward. Bind `ci.levelParams` around the elaboration. From the DECLARATION, never from the statement: a statement inventing a level name the declaration does not have is a different statement, and `isDefEq` is not the place to find that out. The `Type v` case in the tests pins that direction. WHY NOTHING CAUGHT IT `restateSubject` is `∀ (n : Nat), n + 0 = n`. It has no universes at all, so the fixture exercising this path since #188 never asked whether a level parameter resolves. Every assertion passed, on a question that was never put. `restateSubjectPoly` is now the subject that asks it. AND WHY MY OWN VERIFICATION MISSED IT The rendering backfilled into derived-alg-geo-lean's review was checked by elaborating universe u_1 u_2 u_3 example : <the statement> := @...stabilityDistanceTopologyCompatible which declares the universes. `restateOne` does not. That round-trip was described as "the same question restate asks" and it was not the same question -- it was the same question with the hard part already answered. Verified through the producer, not just the checker: a polymorphic statement returns `restated`, and one naming a level the declaration lacks still returns `not_checkable`. 613 passed, 1 skipped; lake build clean at 26 jobs. Refs chris-dare-dev/derived-alg-geo-lean#646
chris-dare-dev
force-pushed
the
agent/restate-universe-polymorphic
branch
from
August 19, 2026 18:41
839c409 to
f6f5694
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first real declaration ever put through restate came back:
A universe-polymorphic statement mentions its level parameters by name, and
elabTermresolves those againstTerm.Context.levelNames— empty for a string parsed out of a review. So every polymorphic statement was unverifiable, and the failure presented as a tooling error on a statement that had not changed: the review silently could not be carried forward, which is the precise outcome restate exists to prevent.The fix
Bind
ci.levelParamsaround the elaboration — from the declaration, never from the statement. A statement inventing a level name the declaration does not have is a different statement, andisDefEqis not the place to discover that. TheType vcase pins that direction.Why nothing caught it
restateSubjectis∀ (n : Nat), n + 0 = n. No universes at all. The fixture exercising this path since #188 never asked whether a level parameter resolves, so every assertion passed on a question that was never put.restateSubjectPolynow asks it.And why my own verification missed it
The rendering backfilled into derived-alg-geo-lean's review was checked by elaborating
which declares the universes.
restateOnedoes not. I described that round-trip as "the same question restate asks". It wasn't — it was the same question with the hard part already answered.Verified through the producer, not just the checker
613 passed, 1 skipped;
lake buildclean at 26 jobs.