Fix issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/'rewrite'.20failed.20but.20it.20should.20work/near/274870747
12 lines
441 B
Text
12 lines
441 B
Text
class Foo (α : Type) where
|
||
decEq : DecidableEq α
|
||
|
||
instance instDecidableEq {α} [Foo α] : DecidableEq α := Foo.decEq
|
||
instance instFooNat : Foo Nat := ⟨by infer_instance⟩
|
||
|
||
def kron (i j : α) [DecidableEq α] : Nat := if (i=j) then 1 else 0
|
||
|
||
theorem kron_right_mul (α : Type) [foo : Foo α] (i j : α) (x : Nat) : x * kron i j = kron i j * x := sorry
|
||
|
||
example {i j : Nat} : i * kron i j = kron i j * i := by
|
||
rw [kron_right_mul]
|