Physlib.Meta.Informal.Post
9 declarations
Checking if a constant is an `InformalDefinition` or `InformalLemma`
#isInformalThe function evaluates a `ConstantInfo` object from the Lean environment. It returns `true` if is a definition whose type is either `InformalDefinition` or `InformalLemma`, and returns `false` otherwise.
Predicate to identify if a `ConstantInfo` is an `InformalLemma`
#isInformalLemmaGiven a Lean declaration metadata object (of type `ConstantInfo`), this function returns `true` if is a definition and its type is `InformalLemma`, and returns `false` otherwise.
Predicate for identifying an `InformalDefinition`
#isInformalDefGiven a `ConstantInfo` object , the function returns `true` if represents an informal definition (specifically, if it is a definition whose type is `InformalDefinition`), and `false` otherwise.
Evaluation of `ConstantInfo` as an `InformalLemma`
#constantInfoToInformalLemmaGiven a Lean declaration metadata object of type `ConstantInfo`, this function evaluates the constant to retrieve its corresponding `InformalLemma` structure. The operation is performed within the `CoreM` monad. It expects to be a definition; if does not represent a definition, the function will trigger a runtime error.
Retrieving an `InformalDefinition` from `ConstantInfo`
#constantInfoToInformalDefinitionGiven a `ConstantInfo` object that represents a declaration in the environment, this function retrieves and returns the corresponding `InformalDefinition` structure. The function assumes that is a definition of type `InformalDefinition`; if does not correspond to an informal definition, the process will terminate with an error.
Retrieve the tag of an informal lemma or definition
#getTagGiven a Lean declaration metadata object of type `ConstantInfo`, this function retrieves the string-based identifier (tag) associated with it, provided that represents either an informal lemma or an informal definition. The function first checks if is an informal lemma; if so, it extracts its tag. If not, it checks if is an informal definition and extracts its tag. If is neither, the function terminates with an error. The operation is executed within the `CoreM` monad and returns a `String`.
Number of informal lemmas in
#noInformalLemmasThe function `Physlib.noInformalLemmas` calculates the total number of informal lemmas present in the library. Operating within the monad, it retrieves all modules imported by , extracts the user-defined constants from each module, and counts those that satisfy the `Informal.isInformalLemma` predicate. The result is returned as a natural number .
Number of informal definitions in
#noInformalDefsThe function `Physlib.noInformalDefs` calculates the total number of informal definitions present in the library. Operating within the monad, it retrieves all modules imported by , extracts the user-defined constants from each module, and counts those that satisfy the `Informal.isInformalDef` predicate. The result is returned as a natural number .
Array of all informal definitions and lemmas in
#AllInformalThe function `Physlib.AllInformal` retrieves an array of `ConstantInfo` objects representing all informal results within the library. Operating within the monad, it identifies all modules imported by , extracts the user-defined constants from these modules, and filters the resulting list to include only those constants categorized as an `InformalDefinition` or `InformalLemma` according to the `isInformal` predicate.
