Documentation

Lean.Meta.Tactic.Grind.Theorems

A collection of theorems. We use it to implement E-matching and injectivity theorems used by grind.

  • decl (declName : Name) : Origin

    A global declaration in the environment.

  • fvar (fvarId : FVarId) : Origin

    A local hypothesis.

  • stx (id : Name) (ref : Syntax) : Origin

    A proof term provided directly to a call to grind where ref is the provided grind argument. The id is a unique identifier for the call.

  • local (id : Name) : Origin

    It is local, but we don't have a local hypothesis for it.

Instances For
    Equations
      Instances For

        A unique identifier corresponding to the origin.

        Equations
          Instances For
            Equations
              Instances For
                Equations
                  Instances For
                    Instances
                      def Lean.Meta.Grind.Theorems.insert {α : Type} [TheoremLike α] (s : Theorems α) (thm : α) :

                      Inserts a thm with symbols [s_1, ..., s_n] to s. We add s_1 -> { thm with symbols := [s_2, ..., s_n] }. When grind internalizes a term containing symbol s, we process all theorems thm associated with key s. If their thm.symbols is empty, we say they are activated. Otherwise, we reinsert into map.

                      Equations
                        Instances For

                          Returns true if s contains a theorem with the given origin.

                          Equations
                            Instances For
                              def Lean.Meta.Grind.Theorems.erase {α : Type} (s : Theorems α) (origin : Origin) :

                              Marks the theorem with the given origin as erased

                              Equations
                                Instances For

                                  Returns true if the theorem has been marked as erased.

                                  Equations
                                    Instances For
                                      @[inline]

                                      Retrieves theorems from s associated with the given symbol. See Theorems.insert. The theorems are removed from s.

                                      Equations
                                        Instances For
                                          def Lean.Meta.Grind.Theorems.find {α : Type} (s : Theorems α) (origin : Origin) :
                                          List α

                                          Returns theorems associated with the given origin.

                                          Equations
                                            Instances For
                                              Equations
                                                Instances For
                                                  def Lean.Meta.Grind.Theorems.eraseDecl {α : Type} (s : Theorems α) (declName : Name) :
                                                  Equations
                                                    Instances For
                                                      Equations
                                                        Instances For
                                                          Equations
                                                            Instances For
                                                              Equations
                                                                Instances For
                                                                  @[reducible, inline]

                                                                  A TheoremsArray α is a collection of Theorems α. The array is scanned linear during theorem activation. This avoids the need for efficiently merging the Theorems α data structure.

                                                                  Equations
                                                                    Instances For
                                                                      @[specialize #[]]
                                                                      Equations
                                                                        Instances For
                                                                          Equations
                                                                            Instances For
                                                                              Equations
                                                                                Instances For
                                                                                  Equations
                                                                                    Instances For