Man, in the past few days I've been seeing topics about CI runners running out of resources. At the same time I want to ask a question

Is there an induction principle for lists that looks like assume P(l) is true, prove P(l ++ [x]) is true?

Apologies and thanks in advance. I'm not sure whether it's appropriate to ask a beginner question when you are busy maintaining your CI.

Don't worry about CI. Beginner questions are always welcome here!

You can certainly prove such an induction principle.

There is `rev_ind`

```
rev_ind:
forall [A : Type] (P : list A -> Prop),
P nil ->
(forall (x : A) (l : list A), P l -> P (l ++ x :: nil)) ->
forall l : list A, P l
```

Huỳnh Trần Khanh has marked this topic as resolved.

You can see a bunch of list induction principles if you `Require Import List`

and `Search "_ind" list`

.

Last updated: Jan 31 2023 at 14:03 UTC