summaryrefslogtreecommitdiff
path: root/contrib/subtac/FixSub.v
blob: bbf722dbb2a4fc8dff781c9599e4177e01bbf524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Require Import Wf.

Section Well_founded.
Variable A : Set.
Variable R : A -> A -> Prop.
Hypothesis Rwf : well_founded R.

Section FixPoint.

Variable P : A -> Set.

Variable F_sub : forall x:A, (forall y: { y : A | R y x }, P (proj1_sig y)) -> P x.
 
Fixpoint Fix_F_sub (x : A) (r : Acc R x) {struct r} : P x :=
   F_sub x (fun y: { y : A | R y x}  => Fix_F_sub (proj1_sig y) 
   (Acc_inv r (proj1_sig y) (proj2_sig y))).

Definition Fix_sub (x : A) := Fix_F_sub x (Rwf x).

End FixPoint.

End Well_founded.