| 1 |
Unset Structural Injection. |
| 2 |
|
| 3 |
Inductive nCk : nat -> nat -> Type := |
| 4 |
|zz : nCk 0 0 |
| 5 |
| incl { m n : nat } : nCk m n -> nCk (S m) (S n) |
| 6 |
| excl { m n : nat } : nCk m n -> nCk (S m) n. |
| 7 |
|
| 8 |
Definition nCkComp { l m n : nat } : |
| 9 |
nCk l m -> nCk m n -> nCk l n. |
| 10 |
Proof. |
| 11 |
intro. |
| 12 |
revert n. |
| 13 |
induction H. |
| 14 |
auto. |
| 15 |
(* ( incl w ) o zz -> contradiction *) |
| 16 |
intros. |
| 17 |
remember (S n) as sn. |
| 18 |
destruct H0. |
| 19 |
discriminate Heqsn. |
| 20 |
apply incl. |
| 21 |
apply IHnCk. |
| 22 |
injection Heqsn. |
| 23 |
intro. |
| 24 |
rewrite <- H1. |
| 25 |
auto. |
| 26 |
apply excl. |
| 27 |
apply IHnCk. |
| 28 |
injection Heqsn. |
| 29 |
intro. rewrite <- H1. |
| 30 |
auto. |
| 31 |
intros. |
| 32 |
apply excl. |
| 33 |
apply IHnCk. |
| 34 |
auto. |
| 35 |
Defined. |
| 36 |
|
| 37 |
Lemma nCkEq { k l m n : nat } ( cs : nCk k l ) (ct : nCk l m) (cr : nCk m n ): |
| 38 |
nCkComp cs (nCkComp ct cr) = nCkComp (nCkComp cs ct) cr. |
| 39 |
Proof. |
| 40 |
revert m n ct cr. |
| 41 |
induction cs. |
| 42 |
intros. simpl. auto. |
| 43 |
intros. |
| 44 |
destruct n. |
| 45 |
destruct m0. |
| 46 |
destruct n0. |
| 47 |
destruct cr. |
| 48 |
(* Anomaly: Evar ?nnn was not declared. Please report. *) |
| 49 |
Abort. |