3

In the standart way I have induction for list like this

  • Approval is performed for lst
  • Proving for x::lst

But I want:

  • Approval is performed for lst
  • Proving for lst ++ x::nil

For me, the place of x in the list is important.

I tried to write something like this, but not successful.

he11boy
  • 71
  • 3

1 Answers1

5

In such case, you need to prove your own induction principle. But here you're lucky because what you need is already in the standard library of Coq:

Require Import List.

Check 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
*)
Bob
  • 1,713
  • 10
  • 23