lean4-htt/tests/lean/run/mulcomm.lean
Leonardo de Moura a6888f72dd fix: instance + where + implicts issue
The following could not be elaborated.

```lean
instance : MulComm Bool where
  mulComm := fun {a b} =>
    match a, b with
    | true, true   => rfl
    | true, false  => rfl
    | false, true  => rfl
    | false, false => rfl
```
2021-04-24 20:07:35 -07:00

64 lines
1.4 KiB
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 MulComm (α : Type u) [Mul α] : Prop where
mulComm : {a b : α} → a * b = b * a
instance : Mul Bool where
mul := and
instance : MulComm Bool where
mulComm {a b} :=
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl
instance : MulComm Bool where
mulComm := fun {a b} =>
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl
instance : MulComm Bool := {
mulComm := fun {a b} =>
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl
}
instance : MulComm Bool := {
mulComm := @fun a b =>
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl
}
instance : MulComm Bool where
mulComm {a b} := by cases a <;> cases b <;> rfl
instance : MulComm Bool :=
⟨by intro a b; cases a <;> cases b <;> rfl⟩
instance : MulComm Bool :=
⟨fun {a b} => by cases a <;> cases b <;> rfl⟩
instance : MulComm Bool :=
⟨fun {a b} =>
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl⟩
instance : MulComm Bool :=
⟨@fun a b =>
match a, b with
| true, true => rfl
| true, false => rfl
| false, true => rfl
| false, false => rfl⟩