Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
Author: Cristina Cornes.
From: Constructing Recursion Operators in Type Theory
L. Paulson JSC (1986) 2, 325-355
Require Import Eqdep. #[universes(template)] Inductive WO (A : Type) (B : A -> Type) : Type := sup : forall (a:A) (f:B a -> WO A B), WO A B. Section WellOrdering. Variable A : Type. Variable B : A -> Type. Notation WO := (WO A B). Inductive le_WO : WO -> WO -> Prop := le_sup : forall (a:A) (f:B a -> WO) (v:B a), le_WO (f v) (sup _ _ a f).A:TypeB:A -> Typewell_founded le_WOA:TypeB:A -> Typewell_founded le_WOA:TypeB:A -> Typea:WOAcc le_WO aA:TypeB:A -> Typea:WOforall y : WO, le_WO y a -> Acc le_WO yA:TypeB:A -> Typea:WOforall (a0 : A) (f : B a0 -> WO), (forall (b : B a0) (y : WO), le_WO y (f b) -> Acc le_WO y) -> forall y : WO, le_WO y (sup A B a0 f) -> Acc le_WO yA:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y0 : WO), le_WO y0 (f b) -> Acc le_WO y0y:WOH0:le_WO y (sup A B a0 f)Acc le_WO yA:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y0 : WO), le_WO y0 (f b) -> Acc le_WO y0y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fAcc le_WO (f1 v0)A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y0 : WO), le_WO y0 (f b) -> Acc le_WO y0y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fforall y0 : WO, le_WO y0 (f1 v0) -> Acc le_WO y0A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y0 : WO), le_WO y0 (f b) -> Acc le_WO y0y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fforall (v1 : B a1) (f2 : B a1 -> WO), f2 v1 = y -> existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 f -> forall y0 : WO, le_WO y0 (f1 v0) -> Acc le_WO y0A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y0 : WO), le_WO y0 (f b) -> Acc le_WO y0y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fforall (v1 : B a0) (f2 : B a0 -> WO), f2 v1 = y -> existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 f -> forall y0 : WO, le_WO y0 (f1 v0) -> Acc le_WO y0A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)Acc le_WO y0A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)le_WO y0 (f v0)A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)f = f1 -> le_WO y0 (f v0)A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)f = f1intros E; rewrite E; auto.A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)f = f1 -> le_WO y0 (f v0)A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)f = f1apply (inj_pair2 A (fun a0:A => B a0 -> WO) a0 f1 f H5). Qed. End WellOrdering. Section Characterisation_wf_relations.A:TypeB:A -> Typea:WOa0:Af:B a0 -> WOH:forall (b : B a0) (y1 : WO), le_WO y1 (f b) -> Acc le_WO y1y:WOH0:le_WO y (sup A B a0 f)a1:Af0:B a1 -> WOv:B a1H1:f0 v = yH3:a1 = a0f1:B a0 -> WOv0:B a0H4:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fv1:B a0f2:B a0 -> WOH2:f2 v1 = yH5:existT (fun a2 : A => B a2 -> WO) a0 f1 = existT (fun a2 : A => B a2 -> WO) a0 fy0:WOH6:le_WO y0 (f1 v0)f1 = f
Wellfounded relations are the inverse image of wellordering types
(* in course of development *) Variable A : Type. Variable leA : A -> A -> Prop. Definition B (a:A) := {x : A | leA x a}.A:TypeleA:A -> A -> Propwell_founded leA -> A -> WO A BA:TypeleA:A -> A -> Propwell_founded leA -> A -> WO A BA:TypeleA:A -> A -> PropH:well_founded leAX:AWO A BA:TypeleA:A -> A -> PropH:well_founded leAX:Aforall x : A, (forall y : A, leA y x -> WO A B) -> WO A BA:TypeleA:A -> A -> PropH:well_founded leAX, x:AH1:forall y : A, leA y x -> WO A BWO A BA:TypeleA:A -> A -> PropH:well_founded leAX, x:AH1:forall y : A, leA y x -> WO A BB x -> WO A BA:TypeleA:A -> A -> PropH:well_founded leAX, x:AH1:forall y : A, leA y x -> WO A B{x0 : A | leA x0 x} -> WO A Bapply (H1 x0); auto. Qed. End Characterisation_wf_relations.A:TypeleA:A -> A -> PropH:well_founded leAX, x:AH1:forall y : A, leA y x -> WO A Bx0:Al:leA x0 xWO A B