Zulip Chat Archive

Stream: general

Topic: rewrite error: "failed"


view this post on Zulip Kenny Lau (May 13 2020 at 20:55):

example (x y z : ) : x * (y + z) = x * y + x * z :=
by rw add_mul

/-
failed
state:
x y z : ℕ
⊢ x * (y + z) = x * y + x * z
-/

example (x y z : ) : x * (y + z) = x * y + x * z :=
by rw nat.pow_two

/-
rewrite tactic failed, did not find instance of the pattern in the target expression
  ?m_1 ^ 2
state:
x y z : ℕ
⊢ x * (y + z) = x * y + x * z
-/

view this post on Zulip Kenny Lau (May 13 2020 at 20:55):

could we modify rw to make the error more precise in the first case?


Last updated: May 10 2021 at 23:11 UTC