@[inline, reducible]
abbrev
Lean.MVarId.cleanup
(mvarId : Lean.MVarId)
(toPreserve : optParam (Array Lean.FVarId) #[])
(indirectProps : optParam Bool true)
:
Auxiliary tactic for cleaning the local context. It removes local declarations (aka hypotheses) that are not relevant.
We say a variable x
is "relevant" if
- It occurs in the
toPreserve
array, or - It occurs in the target type, or
- There is a relevant variable
y
that depends onx
, or - If
indirectProps
is true, the type ofx
is a proposition and it depends on a relevant variabley
.
By default, toPreserve := #[]
and indirectProps := true
. These settings are used in the mathlib tactic extract_goal
to give the user more control over which variables to include.
Equations
- Lean.MVarId.cleanup mvarId toPreserve indirectProps = Lean.Meta.cleanupCore mvarId toPreserve indirectProps
Instances For
@[inline, reducible, deprecated Lean.MVarId.cleanup]
Equations
- Lean.Meta.cleanup mvarId = Lean.MVarId.cleanup mvarId #[] true