leanprover-community / mathlib4

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

delta-derive handler #380

Open gebner opened 1 year ago

gebner commented 1 year 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 12 months ago

from #5020:

See discussion on zulip: 1.