Repository navigation
fix: add expected type hints to Sym rules modified by preprocessing - #16140
Open
kmehltretter82 wants to merge 3 commits into
Open
kmehltretter82 wants to merge 3 commits into
kmehltretter82 wants to merge 3 commits into
Conversation
…ssing When Sym.preprocessType modifies a theorem statement (e.g., unfolding Unit to PUnit in match equation theorems, unfolding reducible definitions, or beta/eta reduction), wrap the theorem proof in mkExpectedPropHint with the preprocessed type before instantiating its parameters. This ensures the kernel checks definitional equality between the original and preprocessed types once on the polymorphic theorem rather than re-evaluating match discriminants at each instantiated rewrite step.
…rocessing Similarly wrap BackwardRule proofs in mkExpectedTypeHint when Sym.preprocessType modifies the rule statement or when the rule expression contains free variables whose local declarations may have been preprocessed in place.
Wrapping a data rule in an expected type hint puts `id` into the value assigned to the goal. Later goals then contain `id f x` instead of `f x`, so structural matching in `apply` and `Sym.simp` fails. Hint only rules whose type is a proposition. Document why the hint exists and remove the redundant `Theorem.declName` alias. Make the regression test fail with a kernel timeout rather than running out of memory.
kmehltretter82
force-pushed
the
fix-sym-thm-expected-prop-hint
branch
from
November 7, 2026 17:05
da7ee0a to
4b24d09
Compare
Author
|
changelog-tactics |
This branch has not been deployed
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.
This PR adds an expected type hint to the proofs of
Symrewrite and backward rules whose statement is changed bySym.preprocessType, so that the kernel checks the change once on the rule rather than at each instantiation, where it can re-evaluatematchdiscriminants.Local hypotheses always get the hint, because
Sym.preprocessMVarrewrites their types in the local context while the kernel still sees the original binder types. Backward rules for data stay unhinted, since their values occur in later goals, whereidwould block structural matching.Closes #15759
Prepared with AI assistance.