Physlib

Physlib.Meta.Informal.Post

9 declarations

definition

Checking if a constant is an `InformalDefinition` or `InformalLemma`

#isInformal

The function evaluates a `ConstantInfo` object cc from the Lean environment. It returns `true` if cc is a definition whose type is either `InformalDefinition` or `InformalLemma`, and returns `false` otherwise.

definition

Predicate to identify if a `ConstantInfo` is an `InformalLemma`

#isInformalLemma

Given a Lean declaration metadata object cc (of type `ConstantInfo`), this function returns `true` if cc is a definition and its type is `InformalLemma`, and returns `false` otherwise.

definition

Predicate for identifying an `InformalDefinition`

#isInformalDef

Given a `ConstantInfo` object cc, the function returns `true` if cc represents an informal definition (specifically, if it is a definition whose type is `InformalDefinition`), and `false` otherwise.

definition

Evaluation of `ConstantInfo` as an `InformalLemma`

#constantInfoToInformalLemma

Given a Lean declaration metadata object cc of type `ConstantInfo`, this function evaluates the constant to retrieve its corresponding `InformalLemma` structure. The operation is performed within the `CoreM` monad. It expects cc to be a definition; if cc does not represent a definition, the function will trigger a runtime error.

definition

Retrieving an `InformalDefinition` from `ConstantInfo`

#constantInfoToInformalDefinition

Given a `ConstantInfo` object cc that represents a declaration in the environment, this function retrieves and returns the corresponding `InformalDefinition` structure. The function assumes that cc is a definition of type `InformalDefinition`; if cc does not correspond to an informal definition, the process will terminate with an error.

definition

Retrieve the tag of an informal lemma or definition

#getTag

Given a Lean declaration metadata object cc of type `ConstantInfo`, this function retrieves the string-based identifier (tag) associated with it, provided that cc represents either an informal lemma or an informal definition. The function first checks if cc is an informal lemma; if so, it extracts its tag. If not, it checks if cc is an informal definition and extracts its tag. If cc is neither, the function terminates with an error. The operation is executed within the `CoreM` monad and returns a `String`.

definition

Number of informal lemmas in Physlib\texttt{Physlib}

#noInformalLemmas

The function `Physlib.noInformalLemmas` calculates the total number of informal lemmas present in the Physlib\texttt{Physlib} library. Operating within the CoreM\text{CoreM} monad, it retrieves all modules imported by Physlib\texttt{Physlib}, 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 nNn \in \mathbb{N}.

definition

Number of informal definitions in Physlib\texttt{Physlib}

#noInformalDefs

The function `Physlib.noInformalDefs` calculates the total number of informal definitions present in the Physlib\texttt{Physlib} library. Operating within the CoreM\text{CoreM} monad, it retrieves all modules imported by Physlib\texttt{Physlib}, 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 nNn \in \mathbb{N}.

definition

Array of all informal definitions and lemmas in Physlib\texttt{Physlib}

#AllInformal

The function `Physlib.AllInformal` retrieves an array of `ConstantInfo` objects representing all informal results within the Physlib\texttt{Physlib} library. Operating within the CoreM\text{CoreM} monad, it identifies all modules imported by Physlib\texttt{Physlib}, 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.