Guide
Tactics
The tactics: cas for identities, calculus and limits, cega for numerical bounds, cas_nf for normal forms, and the options that tune them.
The calculator is only half of SymLean. The same calculations that #cas prints also close goals: you state the goal in Mathlib’s terms, and the tactic finds a proof that the kernel checks. If no route works, the goal stays as it was, and the message says what was tried.
Closing goals
casProves the goal by computer algebra whose steps Lean’s kernel checks: identities, derivatives, integrals, limits and bounds.cas usingProves the goal ascasdoes, with your hypotheses as evidence for the conditions that the routes need.cegaProves numerical bounds: inequalities on a box of real variables, closed constants and interval integrals.cega usingProves a goal from a certificate that you built once, by the certificate’s own soundness theorem.
Asking for the call to keep
Rewriting
cas_nfRewrites the real terms of a goal or a hypothesis to a normal form, with a checked proof of each rewrite.
Settings
OptionsThe settings ofcas,cegaand#cas: the budget of a call, what a report shows, and the trace classes.
Here is one of each. cas proves a derivative, and cega proves a numerical bound:
In[1]:=
example (x : ℝ) : deriv (fun x ↦ x ^ 2 * Real.sin x) x = 2 * x * Real.sin x + x ^ 2 * Real.cos x := by cas example : Real.sqrt 2 ≤ 1.415 := by cega
Out[1]=
Lean accepts the proof.
