lean4-htt/stage0/stdlib/Lean
Kyle Miller 45fccc5906
feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629)
Replaces `@[eliminator]` with two attributes `@[induction_eliminator]`
and `@[cases_eliminator]` for defining custom eliminators for the
`induction` and `cases` tactics, respectively.

Adds `Nat.recAux` and `Nat.casesAuxOn`, which are eliminators that are
defeq to `Nat.rec` and `Nat.casesOn`, but these use `0` and `n + 1`
rather than `Nat.zero` and `Nat.succ n`.

For example, using `induction` to prove that the factorial function is
positive now has the following goal states (thanks also to #3616 for the
goal state after unfolding).
```lean
example : 0 < fact x := by
  induction x with
  | zero => decide
  | succ x ih =>
    /-
    x : Nat
    ih : 0 < fact x
    ⊢ 0 < fact (x + 1)
    -/
    unfold fact
    /-
    ...
    ⊢ 0 < (x + 1) * fact x
    -/
    simpa using ih
```

Thanks to @adamtopaz for initial work on splitting the `@[eliminator]`
attribute.
2024-03-09 15:31:51 +00:00
..
Compiler chore: update stage0 2024-03-06 15:29:04 -08:00
Data chore: update stage0 2024-02-28 11:50:07 +00:00
Elab feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629) 2024-03-09 15:31:51 +00:00
Linter chore: update stage0 2024-02-28 11:50:07 +00:00
Meta feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629) 2024-03-09 15:31:51 +00:00
Parser chore: update stage0 2024-03-05 14:42:05 -08:00
ParserCompiler chore: update stage0 2024-02-19 12:37:19 +01:00
PrettyPrinter chore: update stage0 2024-02-28 11:50:07 +00:00
Server chore: update stage0 2024-03-06 15:29:04 -08:00
Util chore: update stage0 2024-02-28 11:50:07 +00:00
Widget feat: apply app unexpanders for all prefixes of an application (#3375) 2024-02-27 07:04:17 +00:00
Attributes.c chore: update stage0 2024-02-28 11:50:07 +00:00
AuxRecursor.c chore: update stage0 2024-02-19 12:37:19 +01:00
Class.c chore: update stage0 2024-03-02 10:07:15 -08:00
Compiler.c chore: update stage0 2024-02-19 12:37:19 +01:00
CoreM.c chore: update stage0 2024-03-05 14:42:05 -08:00
Data.c chore: update stage0 2024-02-19 12:37:19 +01:00
Declaration.c chore: upstream norm_cast tactic (#3322) 2024-02-19 17:49:17 -08:00
DeclarationRange.c chore: update stage0 2024-02-19 12:37:19 +01:00
DocString.c chore: update stage0 2024-02-21 15:19:07 +00:00
Elab.c chore: update stage0 2024-03-01 22:33:14 -08:00
Environment.c chore: update stage0 2024-02-29 17:34:15 +11:00
Eval.c chore: update stage0 2024-02-19 12:37:19 +01:00
Exception.c chore: update stage0 2024-02-19 12:37:19 +01:00
Expr.c chore: update stage0 2024-03-06 15:29:04 -08:00
HeadIndex.c chore: update stage0 2024-02-19 12:37:19 +01:00
Hygiene.c chore: update stage0 2024-02-19 12:37:19 +01:00
ImportingFlag.c chore: update stage0 2024-02-19 12:37:19 +01:00
InternalExceptionId.c chore: update stage0 2024-02-19 12:37:19 +01:00
KeyedDeclsAttribute.c chore: update stage0 2024-02-22 06:23:26 -08:00
LabelAttribute.c chore: update stage0 2024-02-21 15:19:07 +00:00
LazyInitExtension.c chore: update stage0 2024-02-19 12:37:19 +01:00
Level.c chore: update stage0 2024-02-19 12:37:19 +01:00
Linter.c chore: update stage0 2024-02-19 12:37:19 +01:00
LoadDynlib.c chore: update stage0 2024-02-19 12:37:19 +01:00
LocalContext.c chore: update stage0 2024-02-19 12:37:19 +01:00
Log.c chore: update stage0 2024-02-19 12:37:19 +01:00
Message.c chore: update stage0 2024-02-19 12:37:19 +01:00
Meta.c chore: update stage0 2024-03-05 14:42:05 -08:00
MetavarContext.c chore: update stage0 2024-03-02 10:07:15 -08:00
Modifiers.c feat: apply app unexpanders for all prefixes of an application (#3375) 2024-02-27 07:04:17 +00:00
MonadEnv.c chore: update stage0 2024-02-19 12:37:19 +01:00
Parser.c chore: update stage0 2024-02-21 15:19:07 +00:00
ParserCompiler.c chore: update stage0 2024-03-06 15:29:04 -08:00
PrettyPrinter.c chore: update stage0 2024-02-19 12:37:19 +01:00
ProjFns.c chore: upstream norm_cast tactic (#3322) 2024-02-19 17:49:17 -08:00
ReducibilityAttrs.c chore: update stage0 2024-02-19 12:37:19 +01:00
Replay.c chore: upstream norm_cast tactic (#3322) 2024-02-19 17:49:17 -08:00
ResolveName.c chore: update stage0 2024-02-22 06:23:26 -08:00
Runtime.c chore: update stage0 2024-02-19 12:37:19 +01:00
ScopedEnvExtension.c chore: update stage0 2024-02-19 12:37:19 +01:00
Server.c chore: update stage0 2024-02-19 12:37:19 +01:00
Structure.c chore: update stage0 2024-02-19 12:37:19 +01:00
SubExpr.c chore: update stage0 2024-02-19 12:37:19 +01:00
Syntax.c chore: update stage0 2024-02-19 12:37:19 +01:00
ToExpr.c chore: update stage0 2024-02-25 11:44:42 -08:00
Util.c chore: update stage0 2024-02-25 11:44:42 -08:00
Widget.c chore: update stage0 2024-02-19 12:37:19 +01:00