| 1 |
Inductive even (x : bool) : nat -> Type := |
| 2 |
| evenO : even x 0 |
| 3 |
| evenS : forall n, odd x n -> even x (S n) |
| 4 |
with odd (x : bool) : nat -> Type := |
| 5 |
| oddS : forall n, even x n -> odd x (S n). |
| 6 |
|
| 7 |
Scheme even_ind_prop := Induction for even Sort Prop |
| 8 |
with odd_ind_prop := Induction for odd Sort Prop. |
| 9 |
|
| 10 |
Combined Scheme even_cprop from even_ind_prop, odd_ind_prop. |
| 11 |
|
| 12 |
Check even_cprop : |
| 13 |
forall (x : bool) (P : forall n : nat, even x n -> Prop) |
| 14 |
(P0 : forall n : nat, odd x n -> Prop), |
| 15 |
P 0 (evenO x) -> |
| 16 |
(forall (n : nat) (o : odd x n), P0 n o -> P (S n) (evenS x n o)) -> |
| 17 |
(forall (n : nat) (e : even x n), P n e -> P0 (S n) (oddS x n e)) -> |
| 18 |
(forall (n : nat) (e : even x n), P n e) /\ |
| 19 |
(forall (n : nat) (o : odd x n), P0 n o). |
| 20 |
|
| 21 |
Scheme even_ind_type := Induction for even Sort Type |
| 22 |
with odd_ind_type := Induction for odd Sort Type. |
| 23 |
|
| 24 |
(* This didn't work in v8.7 *) |
| 25 |
|
| 26 |
Combined Scheme even_ctype from even_ind_type, odd_ind_type. |
| 27 |
|
| 28 |
Check even_ctype : |
| 29 |
forall (x : bool) (P : forall n : nat, even x n -> Prop) |
| 30 |
(P0 : forall n : nat, odd x n -> Prop), |
| 31 |
P 0 (evenO x) -> |
| 32 |
(forall (n : nat) (o : odd x n), P0 n o -> P (S n) (evenS x n o)) -> |
| 33 |
(forall (n : nat) (e : even x n), P n e -> P0 (S n) (oddS x n e)) -> |
| 34 |
(forall (n : nat) (e : even x n), P n e) * |
| 35 |
(forall (n : nat) (o : odd x n), P0 n o). |