Documentation

Lean.Meta.Tactic.Grind.Cases

Types that grind will case-split on.

Instances For
    Instances For

      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
        Instances For

          Returns true if s contains a declName.

          Equations
            Instances For

              Removes the given declaration from s.

              Equations
                Instances For
                  Equations
                    Instances For
                      Equations
                        Instances For
                          Equations
                            Instances For
                              Equations
                                Instances For

                                  Returns true is declName is a builtin split or has been tagged with [grind] attribute.

                                  Equations
                                    Instances For
                                      Equations
                                        Instances For
                                          Equations
                                            Instances For
                                              Equations
                                                Instances For
                                                  Equations
                                                    Instances For
                                                      def Lean.Meta.Grind.addCasesAttr (declName : Name) (eager : Bool) (attrKind : AttributeKind) :
                                                      Equations
                                                        Instances For
                                                          Equations
                                                            Instances For
                                                              Equations
                                                                Instances For
                                                                  Equations
                                                                    Instances For

                                                                      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 and intro 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, the grind tactic employs union-find and congruence closure to process these auxiliary equalities. This approach avoids applying substitution to propositions that have already been internalized by grind.

                                                                      Equations
                                                                        Instances For
                                                                          def Lean.Meta.Grind.cases.throwInductiveExpected (mvarId : MVarId) (e : Expr) {α : Type} (type : Expr) :
                                                                          Equations
                                                                            Instances For