Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] dependent induction

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] dependent induction


chronological Thread 
  • From: Adam Chlipala <adam AT chlipala.net>
  • To: Ondrej Rypacek <oxr AT Cs.Nott.AC.UK>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] dependent induction
  • Date: Tue, 06 Apr 2010 12:31:12 -0400

Ondrej Rypacek wrote:
is it possible to prove the following in Coq?

Inductive X : nat -> Set := XZero : X 0.

Lemma Xinv: forall (x:X 0), x = XZero.

Ironically, the subject of your message answers the question (sort of). :)

Require Import Program.

Lemma Xinv: forall (x:X 0), x = XZero.
  dependent induction x; reflexivity.
Qed.

In fact, no inductive hypothesis is needed here, so you could use [dependent destruction] instead.

These tactics will sometimes appeal to axioms. Your example has an easy axiom-free proof, though.

Definition Xinv' : forall (x:X 0), x = XZero :=
  fun x => match x as x in X n return match n return X n -> Prop with
                                        | O => fun x => x = XZero
                                        | _ => fun _ => True
                                      end x with
             | XZero => refl_equal _
           end.




Archive powered by MhonArc 2.6.16.

Top of Page