FormalConjecturesUtil/Linters/CategoryAnswerLinter.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
4 declarations, 1 contain sorry, 0 declared as axioms
The Category Answer Linter
The CategoryAnswerLinter ensures that declarations tagged @[category research solved]
do not leave answer(sorry) in their statement: once a problem is solved, the answer should
be filled in explicitly, e.g. answer(True).
The check is syntactic. Under the default google.answer setting, answer(sorry) at Prop
elaborates to a bare True carrying no annotation, so the placeholder is no longer visible
in the elaborated term.
A statement that deliberately keeps answer(sorry) (for instance because the problem is
independent of ZFC, or because the answer is a constant that is not known explicitly) can opt
out with set_option linter.style.category_answer false in.
Imports (3)
Imported by 2 files
- def
CategoryAnswerLinter.containsSorryWhetherstxcontains asorryanywhere sorry line 49 sourceSource documentation
Whether
stxcontains asorryanywhere.no axioms what this means
Statement uses:
Lean.Syntax,BoolProof uses:
Inhabited.default1 instances, coercions and auxiliary constants left out.
partial def containsSorry (stx : Syntax) : Bool := …
- def
CategoryAnswerLinter.answerSorriesTheanswer(..)nodes instxwhose answer is still asorryline 53 sourceSource documentation
The
answer(..)nodes instxwhose answer is still asorry.no axioms what this means
Statement uses:
Lean.Syntax,ArrayProof uses:
Inhabited.default1 instances, coercions and auxiliary constants left out.
partial def answerSorries (stx : Syntax) : Array Syntax := …
- def
CategoryAnswerLinter.categoryNeedsAnswerWhether the given category isresearch solvedline 58 sourceSource documentation
Whether the given category is
research solved.standard axioms: propext what this means
Statement uses: ProblemAttributes.Category,
BoolProof uses:
BEq.beq,ProblemAttributes.Category.research,ProblemAttributes.ProblemStatus.solved1 instances, coercions and auxiliary constants left out.
def categoryNeedsAnswer (cat : ProblemAttributes.Category) : Bool := …
Mentions: ProblemAttributes.Category
- def
CategoryAnswerLinter.categoryAnswerLinterThe linter checking that solved statements do not useanswer(sorry)line 62 sourceSource documentation
The linter checking that solved statements do not use
answer(sorry).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Lean.Elab.Command.LinterProof uses:
Lean.Elab.Command.Linter.mk,Lean.withSetOptionIn,Lean.Syntax,ite,Lean.Elab.Command.CommandElabM,Unit,Eq,Bool,Lean.Syntax.isOfKind,Lean.Name.mkStr4,Bool.true,Lean.Syntax.getArg,OfNat.ofNat,Nat,cond,Bool.or,Bool.false,Lean.TSyntax,List.cons,Lean.SyntaxNodeKindand 36 more16 instances, coercions and auxiliary constants left out.
def categoryAnswerLinter : Linter where …