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.
31 lines
1.2 KiB
Text
31 lines
1.2 KiB
Text
inductionErrors.lean:11:12-11:27: error: unsolved goals
|
|
case lower.h
|
|
p d : Nat
|
|
⊢ p ≤ p + Nat.succ d
|
|
inductionErrors.lean:12:12-12:27: error: unsolved goals
|
|
case upper.h
|
|
q d : Nat
|
|
⊢ q + Nat.succ d > q
|
|
inductionErrors.lean:16:19-16:26: error: unknown identifier 'elimEx2'
|
|
inductionErrors.lean:22:2-25:45: error: insufficient number of targets for 'elimEx'
|
|
inductionErrors.lean:28:16-28:23: error: unexpected eliminator resulting type
|
|
Nat
|
|
inductionErrors.lean:35:11-35:15: error: unsolved goals
|
|
x : Nat
|
|
⊢ 0 + 0 = 0
|
|
inductionErrors.lean:36:11-36:15: error: unsolved goals
|
|
x y : Nat
|
|
⊢ 0 + (y + 1) = y + 1
|
|
inductionErrors.lean:40:14-40:18: error: unsolved goals
|
|
case zero
|
|
⊢ 0 + Nat.zero = Nat.zero
|
|
inductionErrors.lean:41:14-41:18: error: unsolved goals
|
|
case succ
|
|
y : Nat
|
|
⊢ 0 + Nat.succ y = Nat.succ y
|
|
inductionErrors.lean:50:2-50:16: error: alternative 'cons' is not needed
|
|
inductionErrors.lean:55:2-55:16: error: alternative 'cons' is not needed
|
|
inductionErrors.lean:60:2-60:40: error: invalid alternative name 'upper2'
|
|
inductionErrors.lean:66:2-66:28: error: invalid occurrence of wildcard alternative, it must be the last alternative
|
|
inductionErrors.lean:74:2-74:34: error: unused alternative
|
|
inductionErrors.lean:80:2-80:53: error: unused alternative
|