@[inline]
def
Lean.MVarId.cleanup
(mvarId : MVarId)
(toPreserve : Array FVarId := #[])
(indirectProps : 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. - If 
indirectPropsis true,xis a local declartation and its value mentions 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