Repository navigation
Conversation
zqy1018
added this pull request to stack #94
October 4, 2026 08:18
* fix: generate `LocalRProp`-like instances for ghost functions * fix: allow generating `wp_local_eq` with picking subtypes
zqy1018
force-pushed
the
fix/replacing-instances
branch
from
October 4, 2026 15:41
def16e7 to
acbc55d
Compare
Contributor
Author
|
Seems that something weird happened with stacked PR. Closing it for now. |
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.
Veil/Util/ReplacingInstances.leanhad four simprocs (Depth0/General× actual/expected type).Depth0differed fromGeneralonly by leaving unapplied instances (∀ xs, Decidable (p xs)) alone, which nothing relies on, andDepth0WithExpectedTypewas unused. This PR reduces them to two and makes their proofs independent of unification.neutralizeDecidableInstreads the proposition off the type of the argument and is meant for tactics.neutralizeDecidableInstWithExpectedTypereads it off the binder type of the surrounding application and is meant for generated artifacts (LocalRProp/LocalTheoryPropcores,wp_local_eq.pred). Both handle fully applied and unapplied instances, so__veil_neutralize_decidable_instloses its!variant.Subsingleton.elimapplied directly to both endpoints, and the surrounding congruence usesmkCongrArg/mkCongrFun. PreviouslymkAppM(includingmkFunExtviaSimp.Result.addLambdas) re-inferred the endpoints by unification. That unification has to unfold a definition, e.g. a ghost, whenever the instance's type matches the binder type only after unfolding it. The simpleprivate theoremneutralize_Decidableis removed.Behavior change: tactics that used the old default (
Depth0) now also neutralize unapplied instances. Unapplied instances typed asDecidableEq α,DecidablePred porDecidableRel r, such as module parameters, are still left alone.