@[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 
toPreservearray, or - It occurs in the target type, or
 - There is a relevant variable 
ythat depends onx, or - If 
indirectPropsis true, the type ofxis 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