`calc` is great for explicit rewriting, `conv` is great to say where to rewrite, so it's natural to want `calc` as a `conv` tactic. Zulip disucssion at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/idiom.20for.20using.20calc.20to.20rewrite.20the.20goal/near/424269608 Fixes #3557.
6 lines
155 B
Text
6 lines
155 B
Text
example (P : Nat → Prop) (h : P 4) : P ((1 + 1) + 2) := by
|
|
conv => arg 1; calc
|
|
(1 + 1) + 2
|
|
_ = 2 + 2 := by simp
|
|
_ = 4 := by simp
|
|
exact h
|