Documentation

Lean.Elab.DocString.Builtin

The code represents a global constant.

  • name : Name

    The constant's name.

Instances For

    The code represents a local variable.

    • name : Name

      The local variable's name.

    • fvarId : FVarId

      The local variable's ID.

    • The local variable's context.

    • type : Expr

      The local variable's type.

    Instances For

      The code represents a tactic.

      • name : Name

        The name of the tactic's syntax kind.

      Instances For

        The code represents a conv tactic.

        • name : Name

          The name of the tactic's syntax kind.

        Instances For

          The code represents an attribute application @[...].

          Instances For

            The code represents a single attribute.

            Instances For

              The code represents an option.

              • name : Name

                The option's name.

              • declName : Name

                The option's declaration name.

              Instances For

                The code represents a syntax category name.

                • name : Name

                  The syntax category.

                Instances For

                  The code represents syntax in a given category.

                  Instances For

                    The code represents a module name.

                    • module : Name

                      The module.

                    Instances For

                      Checks that a name exists when it is expected to.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Lean.Doc.name (full : Option Ident := none) (scope : DocScope := DocScope.local) (xs : TSyntaxArray `inline) :

                        Displays a name, without attempting to elaborate implicit arguments.

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

                          Displays a name, without attempting to elaborate implicit arguments.

                          Equations
                          Instances For
                            def Lean.Doc.module (checked : flag true) (xs : TSyntaxArray `inline) :

                            Displays a name, without attempting to elaborate implicit arguments.

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

                              Displays a name, without attempting to elaborate implicit arguments.

                              Equations
                              Instances For
                                def Lean.Doc.tactic (checked : flag true) (xs : TSyntaxArray `inline) :

                                A reference to a tactic.

                                In {tactic}`T`, T can be any of the following:

                                • The name of a tactic syntax kind (e.g. Lean.Parser.Tactic.induction)
                                • The first token of a tactic (e.g. induction)
                                • Valid tactic syntax, potentially including antiquotations (e.g. intro $x*)
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  A reference to a tactic.

                                  In {tactic}`T`, T can be any of the following:

                                  • The name of a tactic syntax kind (e.g. Lean.Parser.Tactic.induction)
                                  • The first token of a tactic (e.g. induction)
                                  • Valid tactic syntax, potentially including antiquotations (e.g. intro $x*)
                                  Equations
                                  Instances For

                                    A reference to a conv tactic.

                                    In {conv}`T`, T can be any of the following:

                                    • The name of a conv tactic syntax kind (e.g. Lean.Parser.Tactic.Conv.lhs)
                                    • Valid conv tactic syntax, potentially including antiquotations (e.g. lhs)
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      A reference to a conv tactic.

                                      In {conv}`T`, T can be any of the following:

                                      • The name of a conv tactic syntax kind (e.g. Lean.Parser.Tactic.Conv.lhs)
                                      • Valid conv tactic syntax, potentially including antiquotations (e.g. lhs)
                                      Equations
                                      Instances For

                                        A reference to an attribute or attribute-application syntax.

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

                                          A reference to an attribute or attribute-application syntax.

                                          Equations
                                          Instances For

                                            A reference to a syntax category.

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

                                              A reference to a syntax category.

                                              Equations
                                              Instances For
                                                def Lean.Doc.syntax (cat : Ident) (xs : TSyntaxArray `inline) :

                                                A description of syntax in the provided category.

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

                                                  A description of syntax in the provided category.

                                                  Equations
                                                  Instances For
                                                    def Lean.Doc.given (type : Option StrLit := none) (typeIsMeta : flag false) («show» : flag true) (xs : TSyntaxArray `inline) :

                                                    A metavariable to be discussed in the remainder of the docstring.

                                                    There are four syntaxes that can be used:

                                                    • {given}`x` establishes x's type as a metavariable.
                                                    • {given (type := "A")}`x` uses A as the type for metavariable x, but does not show that to readers.
                                                    • {given}`x : A` uses A as the type for metavariable x.
                                                    • {given}`x = e` establishes x as an alias for the term e

                                                    Additionally, the contents of the code literal can be repeated, with comma separators.

                                                    If the show flag is false (default true), then the metavariable is not shown in the docstring.

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

                                                      A metavariable to be discussed in the remainder of the docstring.

                                                      There are four syntaxes that can be used:

                                                      • {given}`x` establishes x's type as a metavariable.
                                                      • {given (type := "A")}`x` uses A as the type for metavariable x, but does not show that to readers.
                                                      • {given}`x : A` uses A as the type for metavariable x.
                                                      • {given}`x = e` establishes x as an alias for the term e

                                                      Additionally, the contents of the code literal can be repeated, with comma separators.

                                                      If the show flag is false (default true), then the metavariable is not shown in the docstring.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        def Lean.Doc.lean (name : Option Ident := none) (error warning «show» : flag false) (code : StrLit) :

                                                        Elaborates a sequence of Lean commands as examples.

                                                        To make examples self-contained, elaboration ignores the surrouncing section scopes. Modifications to the environment are preserved during a single documentation comment, and discarded afterwards.

                                                        The named argument name allows a name to be assigned to the code block; any messages created by elaboration are saved under this name.

                                                        The flags error and warning indicate that an error or warning is expected in the code.

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

                                                          Elaborates a sequence of Lean commands as examples.

                                                          To make examples self-contained, elaboration ignores the surrouncing section scopes. Modifications to the environment are preserved during a single documentation comment, and discarded afterwards.

                                                          The named argument name allows a name to be assigned to the code block; any messages created by elaboration are saved under this name.

                                                          The flags error and warning indicate that an error or warning is expected in the code.

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

                                                            Displays output from a named Lean code block.

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

                                                              Displays output from a named Lean code block.

                                                              Equations
                                                              Instances For

                                                                Indicates that a code element is intended as just a literal string, with no further meaning.

                                                                This is equivalent to a bare code element, except suggestions will not be provided for it.

                                                                Equations
                                                                Instances For

                                                                  Indicates that a code element is intended as just a literal string, with no further meaning.

                                                                  This is equivalent to a bare code element, except suggestions will not be provided for it.

                                                                  Equations
                                                                  Instances For

                                                                    Semantic highlighting included on syntax from elaborated terms in documentation.

                                                                    • const (name : Name) (signature : Format) : DocHighlight

                                                                      The text represents the indicated constant.

                                                                    • var (userName : Name) (fvarId : FVarId) (type : Format) : DocHighlight

                                                                      The text represents the indicated local variable.

                                                                      The fvarId is not connected to a local context, but it can be useful for tracking bindings across elaborated fragments of syntax.

                                                                    • field (name : Name) (signature : Format) : DocHighlight

                                                                      The text represents the name of a field. name and signature refer to the projection function.

                                                                    • option (name declName : Name) : DocHighlight

                                                                      The text represents the name of a compiler option.

                                                                    • keyword : DocHighlight

                                                                      The text is an atom, such as if or def.

                                                                    • literal (kind : SyntaxNodeKind) (type? : Option Format) : DocHighlight

                                                                      The text is an atom that represents a literal, such as a string literal.

                                                                      isLitKind returns true for kind.

                                                                    Instances For

                                                                      A code snippet contained within a docstring. Code snippets consist of a series of strings, which are optionally associated with highlighting information.

                                                                      Instances For

                                                                        Adds the provided string str, with optional highlighting hl?, to the end of the code.

                                                                        Equations
                                                                        Instances For
                                                                          Equations
                                                                          Equations

                                                                          The code represents an elaborated Lean term.

                                                                          • term : DocCode

                                                                            The highlighted code to be displayed.

                                                                          Instances For

                                                                            The code represents syntax to set an option.

                                                                            Instances For

                                                                              Treats the provided term as Lean syntax in the documentation's scope.

                                                                              Instances For

                                                                                Treats the provided term as Lean syntax in the documentation's scope.

                                                                                Equations
                                                                                Instances For

                                                                                  Treats the provided term as Lean syntax in the documentation's scope.

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

                                                                                    Treats the provided term as Lean syntax in the documentation's scope.

                                                                                    Equations
                                                                                    Instances For

                                                                                      A reference to an option.

                                                                                      In {option}`O`, O can be either:

                                                                                      • The name of an option (e.g. pp.all)
                                                                                      • Syntax to set an option to a particular value (e.g. set_option pp.all true)
                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For

                                                                                        A reference to an option.

                                                                                        In {option}`O`, O can be either:

                                                                                        • The name of an option (e.g. pp.all)
                                                                                        • Syntax to set an option to a particular value (e.g. set_option pp.all true)
                                                                                        Equations
                                                                                        Instances For

                                                                                          Asserts that an equality holds.

                                                                                          This doesn't use the equality type because it is needed in the prelude, before the = notation is introduced.

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

                                                                                            Asserts that an equality holds.

                                                                                            This doesn't use the equality type because it is needed in the prelude, before the = notation is introduced.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Asserts that an equality holds.

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

                                                                                                Asserts that an equality holds.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Lean.Doc.open (n : Ident) («scoped» : flag false) (only : many Ident) :

                                                                                                  Opens a namespace in the remainder of the documentation comment.

                                                                                                  The +scoped flag causes scoped instances and attributes to be activated, but no identifiers are brought into scope. The named argument only, which can be repeated, specifies a subset of names to bring into scope from the namespace.

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

                                                                                                    Opens a namespace in the remainder of the documentation comment.

                                                                                                    The +scoped flag causes scoped instances and attributes to be activated, but no identifiers are brought into scope. The named argument only, which can be repeated, specifies a subset of names to bring into scope from the namespace.

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

                                                                                                      Sets the specified option to the specified value for the remainder of the comment.

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

                                                                                                        Sets the specified option to the specified value for the remainder of the comment.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          def Lean.Doc.manual (domain : Ident) (name : String) (content : TSyntaxArray `inline) :

                                                                                                          Constructs a link to the Lean langauge reference. Two positional arguments are expected:

                                                                                                          • domain should be one of the valid domains, such as section.
                                                                                                          • name should be the content's canonical name in the domain.
                                                                                                          Equations
                                                                                                          • One or more equations did not get rendered due to their size.
                                                                                                          Instances For

                                                                                                            Constructs a link to the Lean langauge reference. Two positional arguments are expected:

                                                                                                            • domain should be one of the valid domains, such as section.
                                                                                                            • name should be the content's canonical name in the domain.
                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              Suggests the name and given roles, if applicable.

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

                                                                                                                Suggests given for the syntaxes not covered by suggestName.

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

                                                                                                                  Suggests the lean role, if applicable.

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

                                                                                                                    Suggests the leanTerm code block, if applicable.

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

                                                                                                                      Suggests the lean code block, if applicable.

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

                                                                                                                        Suggests the tactic role, if applicable.

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

                                                                                                                          Suggests the attr role, if applicable.

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

                                                                                                                            Suggests the option role, if applicable.

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

                                                                                                                              Suggests the syntaxCat role, if applicable.

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

                                                                                                                                Suggests the syntax role, if applicable.

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

                                                                                                                                  Suggests the module role, if applicable.

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