HepLean Documentation

Lean.LabelAttribute

"Label" attributes #

Allow creating attributes using register_label_attr, and retrieving the array of Names of declarations which have been tagged with such an attribute.

These differ slightly from the built-in "tag attributes" which can be initialized with the syntax:

initialize someName : TagAttribute ← registerTagAttribute `tagName "description"

in that a "tag attribute" can only be put on a declaration at the moment it is declared, and can not be modified by scoping commands.

The "label attributes" constructed here support adding (or locally removing) the attribute either at the moment of declaration, or later.

@[reducible, inline]

An environment extension that just tracks an array of names.

Equations
Instances For
    @[reducible, inline]

    The collection of all current LabelExtensions, indexed by name.

    Equations
    Instances For

      Helper function for registerLabelAttr.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Lean.mkLabelAttr (attrName : Lake.Name) (attrDescr : String) (ext : Lean.LabelExtension) (ref : autoParam Lake.Name _auto✝) :

        Helper function for registerLabelAttr.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Construct a new "label attribute", which does nothing except keep track of the names of the declarations with that attribute.

          Users will generally use the register_label_attr macro defined below.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Initialize a new "label" attribute. Declarations tagged with the attribute can be retrieved using Lean.labelled.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              When attrName is an attribute created using register_labelled_attr, return the names of all declarations labelled using that attribute.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For