lean2/tests/lean/hott/delta_issue2.hlean
Leonardo de Moura 66a722ff5a feat(library/unifier): remove "eager delta hack", use is_def_eq when delta-constraint does not have metavariables anymore
The "eager-delta hack" was added to minimize problems in the interaction
between coercions and delta-constraints.
2016-01-03 12:39:32 -08:00

17 lines
704 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open nat eq
theorem add_assoc₁ : Π (a b c : ), (a + b) + c = a + (b + c)
| a b 0 := eq.refl (nat.rec a (λ x, succ) b)
| a b (succ n) :=
calc (a + b) + (succ n) = succ ((a + b) + n) : rfl
... = succ (a + (b + n)) : ap succ (add_assoc₁ a b n)
... = a + (succ (b + n)) : rfl
... = a + (b + (succ n)) : rfl
theorem add_assoc₂ : Π (a b c : ), (a + b) + c = a + (b + c)
| a b 0 := eq.refl (nat.rec a (λ x, succ) b)
| a b (succ n) := ap succ (add_assoc₂ a b n)
theorem add_assoc₃ : Π (a b c : ), (a + b) + c = a + (b + c)
| a b nat.zero := eq.refl (nat.add a b)
| a b (succ n) := ap succ (add_assoc₃ a b n)