lean2/tests/lean/add_assoc.lean
Leonardo de Moura 7f53cb9601 feat(frontends/lean/parser): add_rewrite take the 'using' command into account
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-28 01:15:28 -08:00

17 lines
No EOL
407 B
Text

import tactic
using Nat
rewrite_set basic
add_rewrite add_zerol add_succl eq_id : basic
theorem add_assoc (a b c : Nat) : a + (b + c) = (a + b) + c
:= induction_on a
(have 0 + (b + c) = (0 + b) + c : by simp basic)
(λ (n : Nat) (iH : n + (b + c) = (n + b) + c),
have (n + 1) + (b + c) = ((n + 1) + b) + c : by simp basic)
check add_zerol
check add_succl
check @eq_id
print environment 1