Implementation of the change at h
tactic #
Function to help do the revert/intro pattern, running some code inside a context
where certain variables have been reverted before re-introing them.
It will push FVarId
alias information into info trees for you according to a simple protocol.
fvarIds
is an array offvarIds
to revert. These are passed toLean.MVarId.revert
withpreserveOrder := true
, hence the function raises an error if they cannot be reverted in the provided order.k
is given the goal with all the variables reverted and the array of revertedFVarId
s, with the requestedFVarId
s at the beginning. It must return a tuple of a value, an array describing whichFVarIds
to link, and a mutatedMVarId
.
The a : Array (Option FVarId)
array returned by k
is interpreted in the following way.
The function will intro a.size
variables, and then for each non-none
entry we
create an FVar alias between it and the corresponding intro
ed variable.
For example, having k
return fvars.map .some
causes all reverted variables to be
intro
ed and linked.
Returns the value returned by k
along with the resulting goal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Replace the type of the free variable fvarId
with typeNew
.
If checkDefEq = true
then throws an error if typeNew
is not definitionally
equal to the type of fvarId
. Otherwise this function assumes typeNew
and the type
of fvarId
are definitionally equal.
This function is the same as Lean.MVarId.changeLocalDecl
but makes sure to push substitution
information into the infotree.
Equations
- One or more equations did not get rendered due to their size.