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 research formally solved using <kind> at "link"]
: a formally solved research problem.`<kind>` must be one of:formal_conjectures: solved in this repository (e.g. filling thesorryin the current file).lean4: solved in Lean 4 (e.g. Mathlib, or some other repo) as an equivalent statement.other_system: solved in another formal system (Roqc, Isabelle, Lean3, HOL, etc.).
@[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.
The type of formal proof that exists for a problem. This is meant to be used
for the research formally solved category.
- formalConjecturesProof : FormalProofKind
The problem exactly as stated in formal-conjectures has a formal proof. The link points to a commit that fills the
sorryrelative 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
Equations
- ProblemAttributes.instBEqFormalProofKind.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- ProblemAttributes.instHashableFormalProofKind.hash ProblemAttributes.FormalProofKind.formalConjecturesProof = 0
- ProblemAttributes.instHashableFormalProofKind.hash ProblemAttributes.FormalProofKind.lean4 = 1
- ProblemAttributes.instHashableFormalProofKind.hash ProblemAttributes.FormalProofKind.otherSystem = 2
Instances For
Equations
- ProblemAttributes.instToExprFormalProofKind.toExpr ProblemAttributes.FormalProofKind.formalConjecturesProof = Lean.Expr.const `ProblemAttributes.FormalProofKind.formalConjecturesProof []
- ProblemAttributes.instToExprFormalProofKind.toExpr ProblemAttributes.FormalProofKind.lean4 = Lean.Expr.const `ProblemAttributes.FormalProofKind.lean4 []
- ProblemAttributes.instToExprFormalProofKind.toExpr ProblemAttributes.FormalProofKind.otherSystem = Lean.Expr.const `ProblemAttributes.FormalProofKind.otherSystem []
Instances For
Equations
- ProblemAttributes.instToExprFormalProofKind = { toExpr := ProblemAttributes.instToExprFormalProofKind.toExpr, toTypeExpr := Lean.Expr.const `ProblemAttributes.FormalProofKind [] }
- 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.
- formallySolvedAt : FormalProofKind → String → ProblemStatus
Indicates that a mathematical problem is formally solved in this repository, with a link to the formal proof.
Instances For
Equations
- ProblemAttributes.instBEqProblemStatus.beq ProblemAttributes.ProblemStatus.open ProblemAttributes.ProblemStatus.open = true
- ProblemAttributes.instBEqProblemStatus.beq ProblemAttributes.ProblemStatus.solved ProblemAttributes.ProblemStatus.solved = true
- ProblemAttributes.instBEqProblemStatus.beq (ProblemAttributes.ProblemStatus.formallySolvedAt a a_1) (ProblemAttributes.ProblemStatus.formallySolvedAt b b_1) = (a == b && a_1 == b_1)
- ProblemAttributes.instBEqProblemStatus.beq x✝¹ x✝ = false
Instances For
Equations
- ProblemAttributes.instHashableProblemStatus.hash ProblemAttributes.ProblemStatus.open = 0
- ProblemAttributes.instHashableProblemStatus.hash ProblemAttributes.ProblemStatus.solved = 1
- ProblemAttributes.instHashableProblemStatus.hash (ProblemAttributes.ProblemStatus.formallySolvedAt a a_1) = mixHash (mixHash 2 (hash a)) (hash a_1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- ProblemAttributes.instToExprProblemStatus.toExpr ProblemAttributes.ProblemStatus.open = Lean.Expr.const `ProblemAttributes.ProblemStatus.open []
- ProblemAttributes.instToExprProblemStatus.toExpr ProblemAttributes.ProblemStatus.solved = Lean.Expr.const `ProblemAttributes.ProblemStatus.solved []
Instances For
Equations
- ProblemAttributes.instToExprProblemStatus = { toExpr := ProblemAttributes.instToExprProblemStatus.toExpr, toTypeExpr := Lean.Expr.const `ProblemAttributes.ProblemStatus [] }
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
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 : 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
- ProblemAttributes.instBEqCategory.beq ProblemAttributes.Category.highSchool ProblemAttributes.Category.highSchool = true
- ProblemAttributes.instBEqCategory.beq ProblemAttributes.Category.undergraduate ProblemAttributes.Category.undergraduate = true
- ProblemAttributes.instBEqCategory.beq ProblemAttributes.Category.graduate ProblemAttributes.Category.graduate = true
- ProblemAttributes.instBEqCategory.beq (ProblemAttributes.Category.research a) (ProblemAttributes.Category.research b) = (a == b)
- ProblemAttributes.instBEqCategory.beq ProblemAttributes.Category.test ProblemAttributes.Category.test = true
- ProblemAttributes.instBEqCategory.beq ProblemAttributes.Category.API ProblemAttributes.Category.API = true
- ProblemAttributes.instBEqCategory.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- ProblemAttributes.instHashableCategory.hash ProblemAttributes.Category.highSchool = 0
- ProblemAttributes.instHashableCategory.hash ProblemAttributes.Category.undergraduate = 1
- ProblemAttributes.instHashableCategory.hash ProblemAttributes.Category.graduate = 2
- ProblemAttributes.instHashableCategory.hash (ProblemAttributes.Category.research a) = mixHash 3 (hash a)
- ProblemAttributes.instHashableCategory.hash ProblemAttributes.Category.test = 4
- ProblemAttributes.instHashableCategory.hash ProblemAttributes.Category.API = 5
Instances For
Equations
- ProblemAttributes.instToExprCategory = { toExpr := ProblemAttributes.instToExprCategory.toExpr, toTypeExpr := Lean.Expr.const `ProblemAttributes.Category [] }
Equations
- ProblemAttributes.instToExprCategory.toExpr ProblemAttributes.Category.highSchool = Lean.Expr.const `ProblemAttributes.Category.highSchool []
- ProblemAttributes.instToExprCategory.toExpr ProblemAttributes.Category.undergraduate = Lean.Expr.const `ProblemAttributes.Category.undergraduate []
- ProblemAttributes.instToExprCategory.toExpr ProblemAttributes.Category.graduate = Lean.Expr.const `ProblemAttributes.Category.graduate []
- ProblemAttributes.instToExprCategory.toExpr (ProblemAttributes.Category.research a) = (Lean.Expr.const `ProblemAttributes.Category.research []).app (Lean.toExpr a)
- ProblemAttributes.instToExprCategory.toExpr ProblemAttributes.Category.test = Lean.Expr.const `ProblemAttributes.Category.test []
- ProblemAttributes.instToExprCategory.toExpr ProblemAttributes.Category.API = Lean.Expr.const `ProblemAttributes.Category.API []
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- ProblemAttributes.instToExprCategoryTag = { toExpr := ProblemAttributes.instToExprCategoryTag.toExpr, toTypeExpr := Lean.Expr.const `ProblemAttributes.CategoryTag [] }
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.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProblemAttributes.instToExprSubjectTag = { toExpr := ProblemAttributes.instToExprSubjectTag.toExpr, toTypeExpr := Lean.Expr.const `ProblemAttributes.SubjectTag [] }
Defines the tagExt extension for adding a HashSet of Tags
to the environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
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
- 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
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
Equations
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