(* End prelude *)

Inductive ev : nat -> Prop :=
| ev_0 : ev 0
| ev_SS : forall n : nat, ev n -> ev (S (S n)).(* End prelude *)

Inductive ev : nat -> Prop :=
| ev_0 : ev 0
| ev_SS : forall n : nat, ev n -> ev (S (S n)).(* End prelude *)

Inductive ev : nat -> Prop :=
| ev_0 : ev 0
| ev_SS : forall n : nat, ev n -> ev (S (S n)).(* Future work: Before relevant software foundations testing book,
   this needs to be automated... *)
Instance dec_ev (n : nat) : Dec (ev n) :=
  {| dec := let fix aux n := 
                let n' := n in
                let Heq := erefl n' : n' = n in
                match n as n'' return (n' = n'' -> _) with
                | O => fun H => left _ 
                | S O => fun H => right _ 
                | S (S n) => fun H => _ (aux n) 
                end Heq in 
  aux n |}.

(* Specifications: *)
Theorem ev_plus4 : forall n, ev n -> ev (4 + n).
Theorem ev_double : forall n, ev (double n).
Theorem ev_minus2 : forall n, ev n -> ev (Peano.pred (Peano.pred n)).
Theorem ev_minus2' : forall n, ev n -> ev (Peano.pred (Peano.pred n)).
Theorem evSS_ev : forall n, ev (S (S n)) -> ev n.