I am having some difficulty understanding the simpa
tactic in the example below (and in general).
The documentation says that
simpa [rules, ⋯] using e will simplify the goal and the type of e using rules, then try to close the goal using e.
Simplifying the type of e makes it more likely to match the goal (which has also been simplified). This construction also tends to be more robust under changes to the simp lemma set.
My understanding is that it is a variant of the simp
tactic, but I can't see precisely what was added (w.r.t. simp
). In the example:
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
noncomputable section
open Real
/-- The sin function has derivative 1 at 0. -/
example : HasDerivAt sin 1 0 := by
simpa using hasDerivAt_sin 0
-- simp [hasDerivAt_sin 0]; exact hasDerivAt_sin 0
end
The simpa
line works. But if I break it into a simp
and something else, it fails (at the simp
step).
My questions are:
How can one simulate simpa
with simp
and more basic tactics?
Why is it useful as advertised in the documentation?