leanprover-community / mathlib4

The math library of Lean 4
https://leanprover-community.github.io/mathlib4_docs
Apache License 2.0
1.58k stars 344 forks source link

delta-derive handler #380

Open gebner opened 2 years ago

gebner commented 2 years ago

https://leanprover-community.github.io/mathlib_docs/tactic/delta_instance.html#tactic.delta_instance_handler In lean3 there was a default derive handler which would run delta on the goal. That is, it would pull the instance through the type synonym. We don't have this at present in lean4, so it is necessary to construct the instance by hand.

Examples:

deriving instance LargeCategory, ConcreteCategory for HeytAlgCat

turns into

deriving instance LargeCategory for HeytAlgCat

instance : ConcreteCategory HeytAlgCat := by
  dsimp [HeytAlgCat]
  infer_instance
Komyyy commented 1 year ago

from #5020:

See discussion on zulip: 1.