blob: 81e9e7303a9a0559b79b2c62708c4d0de82c7fc1 [file] [edit]
class HasMulComm (α : Type u) [Mul α] : Prop where
mulComm : {a b : α} → a * b = b * a
class A (α : Type u) where
[Mul : Mul α]
set_option warn.classDefReducibility false in
attribute [instance] A.mk A.Mul
class B (α : Type u) where
[Mul : Mul α]
[HasMulComm : HasMulComm α]
set_option warn.classDefReducibility false in
attribute [instance] B.mk B.Mul B.HasMulComm
example [A α] [HasMulComm α] : B α := inferInstance
section
variable [A α] [HasMulComm α]
example : B α := by exact inferInstance
example : B α := inferInstance
end