lean4-htt/src/Lean/Parser
Kyle Miller 20eea7372f
feat: make delta deriving more robust and handle binders (#9800)
This PR improves the delta deriving handler, giving it the ability to
process definitions with binders, as well as the ability to recursively
unfold definitions. Furthermore, delta deriving now tries all explicit
non-out-param arguments to a class, and it can handle "mixin" instance
arguments. The `deriving` syntax has been changed to accept general
terms, which makes it possible to derive specific instances with for
example `deriving OfNat _ 1` or `deriving Module R`. The class is
allowed to be a pi type, to add additional hypotheses; here is a Mathlib
example:
```lean
def Sym (α : Type*) (n : ℕ) :=
  { s : Multiset α // Multiset.card s = n }
deriving [DecidableEq α] → DecidableEq _
```
This underscore stands for where `Sym α n` may be inserted, which is
necessary when `→` is used. The `deriving instance` command can refer to
scoped variables when delta deriving as well. Breaking change: the
derived instance's name uses the `instance` command's name generator,
and the new instance is added to the current namespace.

This closes
[mathlib4#380](https://github.com/leanprover-community/mathlib4/issues/380).
2025-08-10 21:21:54 +00:00
..
Tactic refactor: update and consolidate attribute-related error messages (#9495) 2025-07-26 02:03:18 +00:00
Term refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Attr.lean chore: remove syntax for extern arity specifications (#9556) 2025-07-26 00:44:36 +00:00
Basic.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Command.lean feat: make delta deriving more robust and handle binders (#9800) 2025-08-10 21:21:54 +00:00
Do.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Extension.lean perf: shorten rebuild critical path by 19% (#9626) 2025-08-01 11:18:21 +00:00
Extra.lean refactor: remove some unnecessary meta imports (#9542) 2025-07-25 15:14:02 +00:00
Level.lean refactor: remove some unnecessary meta imports (#9542) 2025-07-25 15:14:02 +00:00
Module.lean refactor: move import validation to parser & Lake (#9716) 2025-08-05 22:36:54 +00:00
StrInterpolation.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Syntax.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Tactic.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Term.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00
Types.lean refactor: module-ize Lean (#9330) 2025-07-25 12:02:51 +00:00