test: add Expr.eq_of_toPoly_eq

This commit is contained in:
Leonardo de Moura 2022-04-20 23:04:29 -07:00
parent 6bdeb6c9cb
commit d8ad343885

View file

@ -216,3 +216,8 @@ theorem Expr.toPoly_denote (ctx : Context α) (e : Expr) : e.toPoly.denote ctx =
| add a b => simp! [Poly.add_denote, *]
| mul a b => simp! [Poly.mul_denote, *]
| sub a b => simp! [Poly.add_denote, *, sub_def, Poly.neg_denote, mul_one, mul_comm]
theorem Expr.eq_of_toPoly_eq (ctx : Context α) (a b : Expr) (h : a.toPoly == b.toPoly) : a.denote ctx = b.denote ctx := by
have h := congrArg (Poly.denote ctx) (eq_of_beq h)
simp [toPoly_denote] at h
assumption