X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Ftests%2Finversion.ma;h=f717cd1df7f17969a0ca6169cc21833e711f4754;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=9c56069b234bc1aa063c2c04b560bf45aecde005;hpb=17a25a7a5b9cb2ba69fe9fdf1989bba5b212cadc;p=helm.git diff --git a/helm/matita/tests/inversion.ma b/helm/matita/tests/inversion.ma index 9c56069b2..f717cd1df 100644 --- a/helm/matita/tests/inversion.ma +++ b/helm/matita/tests/inversion.ma @@ -1,4 +1,19 @@ -set "baseuri" "cic:/matita/tests/". +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +set "baseuri" "cic:/matita/tests/inversion/". +include "coq.ma". inductive nat : Set \def O : nat @@ -8,28 +23,31 @@ inductive le (n:nat) : nat \to Prop \def leO : le n n | leS : \forall m. le n m \to le n (S m). -alias symbol "eq" (instance 0) = "leibnitz's equality". +alias symbol "eq" (instance 0) = "Coq's leibnitz's equality". theorem test_inversion: \forall n. le n O \to n=O. intros. - cut O=O. - (* goal 2: 0 = 0 *) - goal 7. reflexivity. - (* goal 1 *) - generalize Hcut. (* non attaccata. Dovrebbe dare 0=0 -> n=0 *) - apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H). - intro. reflexivity. - simplify. intros. - discriminate H3. + (* inversion begins *) + cut (O=O); + [ 2: reflexivity; + | generalize in match Hcut. + apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H); + [ intro. rewrite < H1. clear Hcut. + | simplify. intros. discriminate H3. + ] + reflexivity. + ] qed. (* Piu' semplice e non lascia l'ipotesi inutile Hcut *) alias id "refl_equal" = "cic:/Coq/Init/Logic/eq.ind#xpointer(1/1/1)". theorem test_inversion2: \forall n. le n O \to n=O. intros. - generalize (refl_equal nat O). - apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H). - intro. reflexivity. - simplify. intros. - discriminate H3. + (* inversion begins *) + generalize in match (refl_equal nat O). + apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H); + [ intro. rewrite < H1. + | simplify. intros. discriminate H3. + ] + reflexivity. qed.