Types that grind
will case-split on.
Instances For
Equations
- Lean.Meta.Grind.instInhabitedCasesTypes = { default := { casesMap := default } }
Instances For
Equations
- Lean.Meta.Grind.instInhabitedCasesEntry = { default := { declName := default, eager := default } }
Returns true
if declName
is the name of inductive type/predicate that
even grind only
case splits on.
Remark: we added support for them to reduce the noise in the tactic generated by
grind?
Equations
- Lean.Meta.Grind.isBuiltinEagerCases declName = Lean.Meta.Grind.builtinEagerCases✝.contains declName
Returns true
if s
contains a declName
.
Equations
- s.contains declName = Lean.PersistentHashMap.contains s.casesMap declName
Removes the given declaration from s
.
Equations
- s.erase declName = { casesMap := Lean.PersistentHashMap.erase s.casesMap declName }
Equations
- s.insert declName eager = { casesMap := Lean.PersistentHashMap.insert s.casesMap declName eager }
Equations
- s.find? declName = Lean.PersistentHashMap.find? s.casesMap declName
Equations
- s.isEagerSplit declName = ((Lean.PersistentHashMap.find? s.casesMap declName).getD false || Lean.Meta.Grind.isBuiltinEagerCases declName)
Equations
- s.isSplit declName = ((Lean.PersistentHashMap.find? s.casesMap declName).isSome || Lean.Meta.Grind.isBuiltinEagerCases declName)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Meta.Grind.getCasesTypes = do let __do_lift ← Lean.getEnv pure (Lean.ScopedEnvExtension.getState Lean.Meta.Grind.casesExt __do_lift)
Returns true
is declName
is a builtin split or has been tagged with [grind]
attribute.
Equations
- Lean.Meta.Grind.isSplit declName = do let __do_lift ← Lean.Meta.Grind.getCasesTypes pure (__do_lift.isSplit declName)
Equations
- Lean.Meta.Grind.isCasesAttrCandidate declName eager = do let __do_lift ← Lean.Meta.Grind.isCasesAttrCandidate? declName eager pure __do_lift.isSome
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
The grind
tactic includes an auxiliary cases
tactic that is not intended for direct use by users.
This method implements it.
This tactic is automatically applied when introducing local declarations with a type tagged with [grind_cases]
.
It is also used for "case-splitting" on terms during the search.
It differs from the user-facing Lean cases
tactic in the following ways:
It avoids unnecessary
revert
andintro
operations.It does not introduce new local declarations for each minor premise. Instead, the
grind
tactic preprocessor is responsible for introducing them.If the major premise type is an indexed family, auxiliary declarations and (heterogeneous) equalities are introduced. However, these equalities are not resolved using
unifyEqs
. Instead, thegrind
tactic employs union-find and congruence closure to process these auxiliary equalities. This approach avoids applying substitution to propositions that have already been internalized bygrind
.
Equations
- One or more equations did not get rendered due to their size.