Problem Formalisation Attributes #
The Category Attribute: #
Overview #
Provides information of the type of a statement. This can be:
- A mathematical problem (high school/undergraduate/graduate/research level). If this is a research problem then the user is also required to specify whether the problem has already been solved.
- An API statement
- A "test" statement
Values #
The values of this attribute are
@[category high_school]
: a high school level math problem.@[category undergraduate]
: an undergraduate level math problem.@[category graduate]
: a graduate level math problem.@[category research open]
: an open reseach level math problem.@[category research solved]
: a solved reseach level math problem. The criterion for being solved is that there exists an informal solution that is widely accepted by experts in the area. In particular, this does not require a formal solution to exist.@[category test]
: a statement that serves as a sanity check (e.g. for a new definition).@[category API]
: a statement that constructs basic theory around a new definition
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 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.
- 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
Equations
- ProblemAttributes.instToExprProblemStatus = { toExpr := ProblemAttributes.toExprProblemStatus✝, toTypeExpr := Lean.Expr.const `ProblemAttributes.ProblemStatus [] }
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 : ProblemStatus → Category
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
Equations
Equations
Equations
- ProblemAttributes.instToExprCategory = { toExpr := ProblemAttributes.toExprCategory✝, toTypeExpr := Lean.Expr.const `ProblemAttributes.Category [] }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProblemAttributes.instInhabitedCategoryTag = { default := { declName := default, category := default, informal := default } }
Equations
Equations
- ProblemAttributes.instToExprCategoryTag = { toExpr := ProblemAttributes.toExprCategoryTag✝, toTypeExpr := Lean.Expr.const `ProblemAttributes.CategoryTag [] }
Defines the categoryExt
extension for adding a HashSet
of Tag
s
to the environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProblemAttributes.instInhabitedSubjectTag = { default := { declName := default, subjects := default, informal := default } }
Equations
Equations
Equations
- ProblemAttributes.instToExprSubjectTag = { toExpr := ProblemAttributes.toExprSubjectTag✝, toTypeExpr := Lean.Expr.const `ProblemAttributes.SubjectTag [] }
Defines the tagExt
extension for adding a HashSet
of Tag
s
to the environment.
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
- ProblemAttributes.subjectList = Lean.ParserDescr.nodeWithAntiquot "subjectList" `ProblemAttributes.subjectList (Lean.ParserDescr.unary `many (Lean.ParserDescr.const `num))
Instances For
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
Equations
- ProblemAttributes.getTags = do let __do_lift ← Lean.getEnv pure (ProblemAttributes.categoryExt.getState __do_lift).toArray
Instances For
Equations
- ProblemAttributes.getStatementTags = do let __do_lift ← ProblemAttributes.getTags pure (ProblemAttributes.splitByFun✝ ProblemAttributes.CategoryTag.category __do_lift)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProblemAttributes.getSubjectTags = do let __do_lift ← Lean.getEnv pure (ProblemAttributes.subjectExt.getState __do_lift).toArray