]> matita.cs.unibo.it Git - helm.git/blob - matita/tests/inversion2.ma
tagged 0.5.0-rc1
[helm.git] / matita / tests / inversion2.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15
16 include "coq.ma".
17
18 inductive nat : Set \def
19    O : nat
20  | S : nat \to nat.
21
22
23 inductive le (n:nat) : nat \to Prop \def
24    leO : le n n
25  | leS : \forall m. le n m \to le n (S m).
26  
27 theorem le_inv2:
28  \forall n,m.
29   \forall P: nat -> nat -> Prop.
30    ? -> ? -> le n m -> P n m.
31 [7:
32   intros;
33   inversion H;
34   [ apply x
35   | simplify;
36     apply x1
37   ]
38 | skip
39 | skip
40 | skip
41 | skip
42 | skip
43 | skip
44 ]
45 qed.
46
47 inductive ledx : nat \to nat \to Prop \def
48    ledxO : \forall n. ledx n n
49  | ledxS : \forall m.\forall n. ledx n m \to ledx n (S m).
50
51
52 alias symbol "eq" (instance 0) = "Coq's leibnitz's equality".
53
54 theorem test_inversion: \forall n. le n O \to n=O.
55  intros.
56  inversion H.
57  (* cut n=n \to O=O \to n=O.
58   apply Hcut; reflexivity. *)
59   (* elim H. BUG DI UNSHARING *)
60   (*apply (ledx_ind (\lambda x.\lambda y.  n=x \to O=y \to x=y) ? ? ? ? H).*)
61     simplify. intros. reflexivity.    
62     simplify. intros. destruct H3.
63 qed.