(****************************************************************************) (* The Calculus of Inductive Constructions *) (* *) (* Projet Coq *) (* *) (* INRIA LRI-CNRS ENS-CNRS *) (* Rocquencourt Orsay Lyon *) (* *) (* Coq V6.2 *) (* May 1st 1998 *) (* *) (****************************************************************************) (* Wf.v *) (****************************************************************************) (* This module proves the validity of - well-founded recursion (also called course of values) - well-founded induction from a well-founded ordering on a given set *) Require Export Logic. (* Well-founded induction principle on Prop *) Chapter WfT_Well_founded. Variable A : Type. Variable R : A -> A -> Prop. (* The accessibility predicate is defined to be non-informative *) Inductive WfT_Acc : A -> Prop := WfT_Acc_intro : (x:A)((y:A)(R y x)->(WfT_Acc y))->(WfT_Acc x). Lemma WfT_Acc_inv : (x:A)(WfT_Acc x) -> (y:A)(R y x) -> (WfT_Acc y). Destruct 1; Trivial. Defined. (* the informative elimination : let Acc_rec F = let rec wf x = F x wf in wf *) Section WfT_AccRec. Variable P : A -> Type. Variable F : (x:A)((y:A)(R y x)->(WfT_Acc y))->((y:A)(R y x)->(P y))->(P x). Fixpoint WfT_Acc_rec [x:A;a:(WfT_Acc x)] : (P x) := (F x (WfT_Acc_inv x a) ([y:A][h:(R y x)](WfT_Acc_rec y (WfT_Acc_inv x a y h)))). End WfT_AccRec. (* A relation is well-founded if every element is accessible *) Definition WfT_well_founded := (a:A)(WfT_Acc a). (* well-founded induction *) Theorem WfT_well_founded_induction : WfT_well_founded -> (P:A->Type)((x:A)((y:A)(R y x)->(P y))->(P x))->(a:A)(P a). Intros; Apply (WfT_Acc_rec P); Auto. Save. End WfT_Well_founded. (* Well-founded induction principle on Prop *) Section WfT_inductor. Variable A:Type. Variable R:A->A->Prop. Theorem WfT_well_founded_ind : (WfT_well_founded A R) -> (P:A->Prop)((x:A)((y:A)(R y x)->(P y))->(P x))->(a:A)(P a). Proof. Intros; Apply (WfT_Acc_ind A R P); Auto. Qed. End WfT_inductor. (* $Id: WfT.v,v 1.2 1998/08/20 20:16:07 stehr Exp $ *)