Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do induction on the end of a list in Coq

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.

like image 840
he11boy Avatar asked Dec 08 '25 01:12

he11boy


1 Answers

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
*)
like image 156
Bob Avatar answered Dec 11 '25 23:12

Bob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!