(** Checks that all nats before n are P *)

Fixpoint allbefore (P : nat -> Prop) (n : nat) {struct n} : Prop :=
  match n with
  | O => True
  | S x => allbefore P x /\ P x
  end.(** Checks that some nat before n is P *)

Fixpoint exbefore (P : nat -> Prop) (n : nat) {struct n} : Prop :=
  match n with
  | O => False
  | S x => exbefore P x \/ P x
  end.

Theorem alldec : forall (P : nat -> Prop) (N : nat), (forall n : nat, P n \/ ~ P n) -> (forall x : nat, x < N -> P x) \/ ~ (forall x : nat, x < N -> P x).