Documentation

FormalConjectures.Util.Answer

The answer( ) elaborator #

This file provides syntax for marking up answers in a problem statement.

Note: certain problems also providing an answer, and can be formalised using answer(sorry) as a placeholder. While providing a proof simply requires finding any way to replace := sorry, providing an answer is not just finding any way to replace answer(sorry): it requires evaluation of mathematical meaning, which is a job for human mathematicians, not Lean alone.

A type that captures the current setting for the answer() elaborator.

  • alwaysTrue : AnswerSetting

    Default mode: answer(sorry) defaults to True when sorry has type Prop.

  • postpone : AnswerSetting

    Default mode for answer(foo): just postpones elaboration.

  • withAuxiliary : AnswerSetting

    Elaborate answer(foo) by creating an auxiliary definition with value foo.

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

    Find the first subexpression carrying the answer annotation, returning the inner (unwrapped) expression if found.

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

      Collect all subexpressions carrying the answer annotation, returning the inner (unwrapped) expressions.

      Equations
      Instances For
        def Google.elabTermAndAnnotate (stx : Lean.TSyntax `term) (expectedType? : Option Lean.Expr) (postpone : Bool := false) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Construct a canonical sorryAx application with a stable, module-independent tag. Unlike Lean's built-in sorry macro, this does not embed the current module name via hygiene, so the resulting expression is identical regardless of whether the file is compiled as Challenge or Solution.

          Equations
          Instances For

            Indicates where the answer is in a problem statement.

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

              An answer: a term, and the context in which it was elaborated

              Instances For

                Print an answer

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

                  Find answers by inspecting an InfoTree

                  Equations
                  Instances For