lean4-htt/src/Init
Joachim Breitner 550fa6994e
feat: induction using <term> (#3188)
right now, the `induction` tactic accepts a custom eliminator using the
`using <ident>` syntax, but is restricted to identifiers. This
limitation becomes annoying when the elminator has explicit parameters
that are not targets, and the user (naturally) wants to be able to write
```
induction a, b, c using foo (x := …)
```

This generalizes the syntax to expressions and changes the code
accordingly.

This can be used to instantiate a multi-motive induction:
```
example (a : A) : True := by
  induction a using A.rec (motive_2 := fun b => True)
  case mkA b IH => exact trivial
  case A => exact trivial
  case mkB b IH => exact trivial
```

For this to work the term elaborator learned the `heedElabAsElim` flag,
`true` by default. But in the default setting, `A.rec (motive_2 := fun b
=> True)`
would fail to elaborate, because there is no expected type. So the
induction
tactic will elaborate in a mode where that attribute is simply ignored.

As a side effect, the “failed to infer implicit target” error message 
is improved and prints the name of the implicit target that could not be
instantiated.
2024-01-25 16:57:41 +00:00
..
Control chore: add semiOutParam annotations 2023-04-10 13:00:04 -07:00
Data feat: cleanups to ACI and Identity classes (#3195) 2024-01-24 21:46:58 +00:00
System feat: synchronous execution of task continuations (#3013) 2024-01-25 13:54:20 +00:00
Classical.lean doc: Bold "Diaconescu's theorem" (#3086) 2023-12-17 19:10:35 +00:00
Coe.lean doc: improve documentation of Init.Coe 2023-06-05 15:52:25 -07:00
Control.lean
Conv.lean chore: update domain 2023-09-20 15:13:27 -07:00
Core.lean feat: synchronous execution of task continuations (#3013) 2024-01-25 13:54:20 +00:00
Data.lean feat: Channel 2022-09-05 08:52:46 -07:00
Dynamic.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Hints.lean
Meta.lean refactor: termination_by changes in stdlib 2024-01-10 17:27:35 +01:00
MetaTypes.lean feat: add option simprocs 2024-01-09 12:57:15 +01:00
Notation.lean feat: allow trailing comma in tuples, lists, and tactics (#2643) 2023-11-17 13:31:41 +01:00
NotationExtra.lean chore: update domain 2023-09-20 15:13:27 -07:00
Prelude.lean doc: fix typos (#3178) 2024-01-14 14:02:51 +00:00
ShareCommon.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
SimpLemmas.lean feat: replace ite and dite shortcircuit theorems with simproc 2024-01-09 12:57:15 +01:00
Simproc.lean chore: missing copyright 2024-01-09 12:57:15 +01:00
SizeOf.lean doc: documentation for Init.SizeOf 2022-08-17 14:48:10 -07:00
SizeOfLemmas.lean fix: protect sizeOf lemmas 2023-07-19 08:50:59 +02:00
System.lean feat: Mutex, Condvar 2022-09-05 08:52:46 -07:00
Tactics.lean feat: induction using <term> (#3188) 2024-01-25 16:57:41 +00:00
Util.lean perf: leak environments not freed before process exit 2023-11-14 17:33:04 +01:00
WF.lean fix: generalize Prod.lexAccessible to match Lean 3 (#2388) 2023-08-09 08:54:53 -07:00
WFTactics.lean refactor: add Init/MetaTypes to workaround bootstrapping issues 2023-10-29 09:38:23 -07:00