From 2c2fd391de336d5611f1739993c31cfb42e7335e Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 30 Jun 2005 10:34:59 +0000 Subject: [PATCH] ... --- helm/matita/tests/inversion.ma | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/helm/matita/tests/inversion.ma b/helm/matita/tests/inversion.ma index 9c56069b2..8f57534be 100644 --- a/helm/matita/tests/inversion.ma +++ b/helm/matita/tests/inversion.ma @@ -1,5 +1,3 @@ -set "baseuri" "cic:/matita/tests/". - inductive nat : Set \def O : nat | S : nat \to nat. @@ -12,24 +10,37 @@ alias symbol "eq" (instance 0) = "leibnitz's equality". theorem test_inversion: \forall n. le n O \to n=O. intros. + (* inversion begins *) cut O=O. (* goal 2: 0 = 0 *) goal 7. reflexivity. (* goal 1 *) - generalize Hcut. (* non attaccata. Dovrebbe dare 0=0 -> n=0 *) + generalize Hcut. apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H). - intro. reflexivity. + (* first goal (left open) *) + intro. rewrite right H1. + clear Hcut. + (* second goal (closed) *) + goal 14. simplify. intros. discriminate H3. + (* inversion ends *) + 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. + (* inversion begins *) generalize (refl_equal nat O). apply (le_ind ? (\lambda x. O=x \to n=x) ? ? ? H). - intro. reflexivity. + (* first goal (left open) *) + intro. rewrite right H1. + (* second goal (closed) *) + goal 13. simplify. intros. discriminate H3. + (* inversion ends *) + reflexivity. qed. -- 2.39.2