Library CoLoR.Util.Logic.DepChoicePrf

CoLoR, a Coq library on rewriting and termination. See the COPYRIGHTS and LICENSE files.
  • Frederic Blanqui, 2007-08-08
proof of dependent choice in classical logic + axiom of choice

Set Implicit Arguments.

Require Import ClassicalChoice.
Require Import RelUtil.
Require Import LogicUtil.

Section S.

Variables (A : Type) (a : A) (R : relation A) (h : left_total R).

Definition next_elt x := proj1_sig (h x).

Inductive G : nat A Prop :=
| G0 : G 0 a
| GS : i x, G i x G (S i) (next_elt x).

Lemma G_is_classic_left_total : classic_left_total G.

intro. elim x. a. exact G0.
intros. destruct H. (next_elt x0). exact (GS H).

Lemma G_is_functional : functional G.

unfold functional. induction x; intros; inversion H; inversion H0.
subst y. subst z. refl. rewrite (IHx _ _ H2 H5). refl.

Lemma choice_imply_dep_choice : f, IS R f.

destruct (choice G G_is_classic_left_total) as [f H]. f.
assert ( i x, G i x x = f i). intros. ded (H i).
exact (G_is_functional H0 H1).
assert (f 0 = a). ded (H 0). inversion H1. refl.
assert ( i, f (S i) = next_elt (f i)). induction i.
ded (H 1). inversion H2. inversion H5. rewrite H1. subst x. refl.
ded (H (S (S i))). inversion H2. ded (H0 _ _ H5). subst x. refl.
intro. rewrite H2. exact (proj2_sig (h (f i))).

End S.