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 toTruewhensorryhas typeProp. - postpone : AnswerSetting
Default mode for
answer(foo): just postpones elaboration. - withAuxiliary : AnswerSetting
Elaborate
answer(foo)by creating an auxiliary definition with valuefoo.
Instances For
Equations
Equations
Equations
Instances For
Equations
- Google.instBEqAnswerSetting.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
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.
Equations
- Google.mkAnswerAnnotation e = Lean.mkAnnotation `answer e
Instances For
Collect all subexpressions carrying the answer annotation,
returning the inner (unwrapped) expressions.
Equations
Instances For
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
- Google.mkCanonicalSorryAnnotation expectedType = do let sorryExpr ← liftM (Lean.Meta.mkSorry expectedType false) pure (Google.mkAnswerAnnotation sorryExpr)
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
- ctx : Lean.Elab.ContextInfo
- term : Lean.Elab.TermInfo
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