Documentation

FormalConjectures.Util.Attributes.Basic

Problem Formalisation Attributes #

The Category Attribute: #

Overview #

Provides information of the type of a statement. This can be:

Values #

The values of this attribute are

The Formal Proof Attribute: #

Overview #

Provides information about the existence of a formal proof for a statement. This is independent of the category attribute and can be used with any category.

Values #

Usage examples #

The tag should be used as follows:

@[category high_school]
theorem imo_2024_p6
    (IsAquaesulian : (ℚ → ℚ) → Prop)
    (IsAquaesulian_def : ∀ f, IsAquaesulian f ↔
      ∀ x y, f (x + f y) = f x + y ∨ f (f x + y) = x + f y) :
    IsLeast {(c : ℤ) | ∀ f, IsAquaesulian f → {(f r + f (-r)) | (r : ℚ)}.Finite ∧
      {(f r + f (-r)) | (r : ℚ)}.ncard ≤ c} 2 := by
  sorry

@[category research open]
theorem an_open_problem : Transcendental ℝ (π + rexp 1) := by
  sorry

@[category research solved, formal_proof using lean4 at "https://example.com/proof"]
theorem a_solved_problem_with_formal_proof : ... := by
  sorry

@[category test]
theorem a_test_to_sanity_check_some_definition : ¬ FermatLastTheoremWith 1 := by
  sorry

The Problem Subject Attribute #

Provides information about the subject of a mathematical problem, via a numeral corresponding to the AMS subject classification of the problem. This can be used as follows:

@[AMS 11] -- 11 correponds to Number Theory in the AMS classification
theorem FLT : FermatLastTheorem := by
  sorry

The complete list of subjects can be found here: https://mathscinet.ams.org/mathscinet/msc/pdfs/classifications2020.pdf

In order to access the list from within a Lean file, use the #AMS command.

Note: the current implementation of the attribute includes all the main categories in the AMS classification for completeness. Some are not relevant to this repository.

The type of formal proof that exists for a problem.

  • formalConjecturesProof : FormalProofKind

    The problem exactly as stated in formal-conjectures has a formal proof. The link points to a commit that fills the sorry relative to the current commit (i.e., the commit where this category is added, or the commit with the latest fix for this statement).

  • lean4 : FormalProofKind

    The problem is solved in Lean 4 (e.g. in Mathlib or some other repository), perhaps as an equivalent statement.

  • otherSystem : FormalProofKind

    The problem is formally solved in a different system (Roqc, Isabelle, Lean 3, HOL, etc.).

Instances For
    • open : ProblemStatus

      Indicates that a mathematical problem is still open.

    • solved : ProblemStatus

      Indicates that a mathematical problem is already solved, i.e., there is a published (informal) proof that is widely accepted by experts.

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def ProblemAttributes.formalProofKind.toName (stx : Lean.TSyntax `ProblemAttributes.formalProofKind) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def ProblemAttributes.problemStatus.toName (stx : Lean.TSyntax `ProblemAttributes.problemStatus) :

            Convert from a syntax node to a name.

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

              A type to capture the various types of statements that appear in our Lean files.

              • highSchool : Category

                A high school level math problem.

              • undergraduate : Category

                An undegraduate level math problem.

              • graduate : Category

                A graduate level math problem.

              • research : ProblemStatusCategory

                A reseach level math problem. This can be open, or already solved

              • test : Category

                A test statement that serves as a sanity check (e.g. for a new definition)

              • API : Category

                An "API" statement, i.e. a statement that constructs basic theory around a new definition

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

                    The name of the declaration with the given tag.

                  • category : Category

                    The status of the problem.

                  • informal : String

                    The (optional) comment that comes with the given declaration.

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

                          Defines the categoryExt extension for adding a HashSet of Tags to the environment.

                          def ProblemAttributes.addCategoryEntry {m : TypeType} [Lean.MonadEnv m] (declName : Lean.Name) (cat : Category) (comment : String) :
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            A tag recording the existence and location of a formal proof for a declaration.

                            • declName : Lean.Name

                              The name of the declaration with the given tag.

                            • proofKind : FormalProofKind

                              The kind of formal proof.

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

                                        The name of the declaration with the given tag.

                                      • subjects : List AMS

                                        The subject(s) of the problem.

                                      • informal : String

                                        The (optional) comment that comes with the given declaration.

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

                                              Defines the tagExt extension for adding a HashSet of Tags to the environment.

                                              def ProblemAttributes.addSubjectEntry {m : TypeType} [Lean.MonadEnv m] (name : Lean.Name) (subjects : List AMS) (informal : String) :
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def ProblemAttributes.Syntax.toCategory (stx : Lean.TSyntax `ProblemAttributes.CategorySyntax) :

                                                Convert from a syntax node to a term of type Category and annotate the syntax with the corresponding name's docstring.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      def ProblemAttributes.Syntax.toSubjects (stx : Lean.TSyntax `ProblemAttributes.subjectList) :

                                                      Converts a syntax node to an array of AMS subjects.

                                                      This also annotates the every natural number litteral encountered, with the description of the corresponding AMS subject (i.e. hovering over the number in VS Code will show the subject.)

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def ProblemAttributes.splitByFun {α β : Type} (f : αβ) [BEq β] [Hashable β] (arr : Array α) :

                                                          Split an array into preimages of a function.

                                                          splitByFun f arr is the hashmap such that the value for key b : β is the array of a : α in arr that get mapped to b by f

                                                          Equations
                                                          Instances For
                                                            def ProblemAttributes.splitByFun.addPreimage {α β : Type} (f : αβ) [BEq β] [Hashable β] (a : α) (m : Std.HashMap β (Array α)) :
                                                            Equations
                                                            Instances For
                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Get the formal proof tag for a given declaration, if any.

                                                                Equations
                                                                Instances For