lean2/tests/lean/hott/delta_issue2.hlean
2016-02-22 11:15:38 -08:00

18 lines
720 B
Text
Raw Permalink 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
infixr + := sum
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)