FormalConjecturesUtil/Linters/AnswerLinterTest.lean

GitHub source file

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, 3 contain sorry, 0 declared as axioms

Tests for the answer linter

This file contains test cases for the AnswerLinter, verifying that it correctly flags theorems with early arguments when answer(sorry) is the left-hand side of an iff, and does not flag theorems without answer(sorry) or without early arguments.

Imports (2)
  1. theorem AnswerLinter.flagged_by_linter An exampe of what we want to lint against sorry line 46 source

    Source documentation

    An exampe of what we want to lint against

    depends on sorry what this means

    Statement uses: True, Nat, Iff, Eq, HAdd.hAdd, OfNat.ofNat

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem flagged_by_linter (h : True) (b : Nat) : answer(sorry) ↔ 1 + 1 = 2 := by
    …
  2. theorem AnswerLinter.not_flagged_no_answer_sorry An non-exampe: we want don't to lint against this case line 51 source

    Source documentation

    An non-exampe: we want don't to lint against this case

    no axioms what this means

    Statement uses: True, Nat, Eq, HAdd.hAdd, OfNat.ofNat

    Proof uses: Eq.refl

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem not_flagged_no_answer_sorry (_ : True) (_ : Nat) : 1 + 1 = 2 := by
    …
  3. theorem AnswerLinter.not_flagged_no_arguments An non-exampe: we want don't to lint against this case sorry line 56 source

    Source documentation

    An non-exampe: we want don't to lint against this case

    depends on sorry what this means

    Statement uses: Iff, True, Eq, Nat, HAdd.hAdd, OfNat.ofNat

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem not_flagged_no_arguments : answer(sorry) ↔ 1 + 1 = 2 := by
    …
  4. theorem AnswerLinter.not_flagged_non_prop_answer An non-exampe: here answer(sorry) is not a Prop, and not the entire left hand side of the iff sorry line 62 source

    Source documentation

    An non-exampe: here answer(sorry) is not a Prop, and not the entire left hand side of the iff.

    depends on sorry what this means

    Statement uses: True, Nat, Iff, Eq, sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous, OfNat.ofNat, HAdd.hAdd

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem not_flagged_non_prop_answer (h : True) (b : Nat) : answer(sorry) = 2 ↔ 1 + 1 = 2 := by
    …