@[reducible, inline]
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
- mvarId.cleanup toPreserve indirectProps = Lean.Meta.cleanupCore mvarId toPreserve indirectProps