lean4-htt/src/Lean/Elab/PreDefinition
Joachim Breitner 3d1d8fc1de
feat: unfolding functional induction principles (#8088)
This PR adds the “unfolding” variant of the functional induction and
functional cases principles, under the name `foo.induct_unfolding` resp.
`foo.fun_cases_unfolding`. These theorems combine induction over the
structure of a recursive function with the unfolding of that function,
and should be more reliable, easier to use and more efficient than just
case-splitting and then rewriting with equational theorems.

For example  instead of
```
ackermann.induct
  (motive : Nat → Nat → Prop)
  (case1 : ∀ (m : Nat), motive 0 m)
  (case2 : ∀ (n : Nat), motive n 1 → motive (Nat.succ n) 0)
  (case3 : ∀ (n m : Nat), motive (n + 1) m → motive n (ackermann (n + 1) m) → motive (Nat.succ n) (Nat.succ m))
  (x x : Nat) : motive x x
```
one gets
```
ackermann.fun_cases_unfolding
  (motive : Nat → Nat → Nat → Prop)
  (case1 : ∀ (m : Nat), motive 0 m (m + 1))
  (case2 : ∀ (n : Nat), motive n.succ 0 (ackermann n 1))
  (case3 : ∀ (n m : Nat), motive n.succ m.succ (ackermann n (ackermann (n + 1) m)))
  (x✝ x✝¹ : Nat) : motive x✝ x✝¹ (ackermann x✝ x✝¹)
```
2025-04-29 16:43:06 +00:00
..
Nonrec feat: Environment.realizeConst (#7076) 2025-02-26 19:32:21 +00:00
PartialFixpoint refactor: WF: add eq_def theorem for ._unary (#8063) 2025-04-24 09:59:08 +00:00
Structural feat: unfolding functional induction principles (#8088) 2025-04-29 16:43:06 +00:00
WF fix: FunInd with nested well-founded recurison and late fixed parameters (#8094) 2025-04-25 09:20:27 +00:00
Basic.lean refactor: use mkAuxLemma in mkAuxTheorem (#7762) 2025-03-31 22:50:30 +00:00
Eqns.lean feat: unfolding functional induction principles (#8088) 2025-04-29 16:43:06 +00:00
EqUnfold.lean feat: use realizeConst for all equation and unfold theorems (#7348) 2025-03-05 14:56:50 +00:00
FixedParams.lean chore: fix spelling mistakes (#7328) 2025-04-07 01:15:48 +00:00
Main.lean feat: elaborate theorem bodies in parallel (#7084) 2025-03-14 07:50:42 +00:00
MkInhabitant.lean refactor: make mkInhabitantFor error message configurable (#6356) 2024-12-10 14:32:19 +00:00
Mutual.lean feat: unfolding functional induction principles (#8088) 2025-04-29 16:43:06 +00:00
PartialFixpoint.lean feat: partial_fixpoint: partial functions with equations (#6355) 2025-01-21 09:54:30 +00:00
Structural.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
TerminationHint.lean refactor: TerminationArgument → TerminationMeasure (#6727) 2025-01-23 10:41:38 +00:00
TerminationMeasure.lean fix: strip optional parameters when elaborating the termination hints (#7335) 2025-03-05 18:15:49 +00:00
WF.lean refactor: WF: create unfold theorems eagerly (#6898) 2025-02-03 09:05:22 +00:00