lean4-htt/tests/lean/951.lean
2022-01-20 17:16:06 -08:00

17 lines
494 B
Text

inductive ThingA where
| mkA
deriving Ord
instance : LE ThingA where
le a b := (compare a b).isLE
instance (t₁ t₂ : ThingA) : Decidable (t₁ <= t₂) := inferInstance
-- TODO: we may want to suppress the name of nested instances
#check instDecidableLeThingAInstLEThingA
inductive ThingB where
| mkB
deriving Ord
instance : LE ThingB where
le a b := (compare a b).isLE
instance (t₁ t₂ : ThingB) : Decidable (t₁ <= t₂) := inferInstance
#check instDecidableLeThingBInstLEThingB