lean4-htt/tests/lean/isDefEqOffsetBug.lean
Leonardo de Moura 7627458aac chore: fix tests
We are not using the `!` suffix anymore for keywords.
2021-03-12 15:10:50 -08:00

27 lines
677 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.

class Zero (α : Type u) where
zero : α
export Zero (zero)
instance [Zero α] : OfNat α (nat_lit 0) where
ofNat := zero
class AddGroup (α : Type u) extends Add α, Zero α, Neg α where
addAssoc : {a b c : α} → a + b + c = a + (b + c)
zeroAdd : {a : α} → 0 + a = a
addZero : {a : α} → a + 0 = a
negAdd : {a : α} → -a + a = 0
open AddGroup
theorem negZero [AddGroup α] : -(0 : α) = 0 := by
rw [←addZero (a := -(0 : α)), negAdd]
theorem subZero [AddGroup α] {a : α} : a + -(0 : α) = a := by
rw [← addZero (a := a)]
rw addAssoc
rw negZero
rw addZero
theorem shouldFail [AddGroup α] : ((0 : α) + 0) = 0 :=
rfl -- Error