X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Ftests%2Fdiscriminate.ma;h=b1d7b9ca68a74ef5b96959ee19e4ccbe2031cee5;hb=f79567e3b0abcb508c94b66d69d967c4df83082a;hp=f25061245e8ad7da6fc240302b9770997d0b1246;hpb=d723cac1efffbc8ef3ffcbaa96a2c390e2b8780e;p=helm.git diff --git a/matita/tests/discriminate.ma b/matita/tests/discriminate.ma index f25061245..b1d7b9ca6 100644 --- a/matita/tests/discriminate.ma +++ b/matita/tests/discriminate.ma @@ -13,35 +13,27 @@ (**************************************************************************) set "baseuri" "cic:/matita/tests/discriminate". -include "legacy/coq.ma". -alias id "not" = "cic:/Coq/Init/Logic/not.con". -alias num (instance 0) = "natural number". -alias symbol "eq" (instance 0) = "Coq's leibnitz's equality". -alias id "False" = "cic:/Coq/Init/Logic/False.ind#xpointer(1/1)". -alias id "True" = "cic:/Coq/Init/Logic/True.ind#xpointer(1/1)". -alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)". -alias id "bool" = "cic:/Coq/Init/Datatypes/bool.ind#xpointer(1/1)". - -inductive foo: Prop \def I_foo: foo. - -alias num (instance 0) = "binary integer number". + +include "logic/equality.ma". +include "nat/nat.ma". +include "datatypes/constructors.ma". + theorem stupid: - 1 = 0 \to (\forall p:Prop. p \to not p). + (S O) = O \to (\forall p:Prop. p \to Not p). intros. - generalize in match I_foo. - discriminate H. + generalize in match I. + destruct H. qed. inductive bar_list (A:Set): Set \def | bar_nil: bar_list A | bar_cons: A \to bar_list A \to bar_list A. - theorem stupid2: \forall A:Set.\forall x:A.\forall l:bar_list A. bar_nil A = bar_cons A x l \to False. intros. - discriminate H. + destruct H. qed. inductive dt (A:Type): Type \to Type \def @@ -51,7 +43,7 @@ inductive dt (A:Type): Type \to Type \def theorem stupid3: k1 False (False → True) = k2 False False True → False. intros; - discriminate H. + destruct H. qed. inductive dddt (A:Type): Type \to Type \def @@ -60,5 +52,71 @@ inductive dddt (A:Type): Type \to Type \def theorem stupid4: kkk1 False = kkk2 False \to False. intros; - discriminate H. -qed. \ No newline at end of file + destruct H. +qed. + +theorem recursive: S (S (S O)) = S (S O) \to False. + intros; + destruct H. +qed. + +inductive complex (A,B : Type) : B → A → Type ≝ +| C1 : ∀x:nat.∀a:A.∀b:B. complex A B b a +| C2 : ∀a,a1:A.∀b,b1:B.∀x:nat. complex A B b1 a1 → complex A B b a. + + +theorem recursive1: ∀ x,y : nat. + (C1 ? ? O (Some ? x) y) = + (C1 ? ? (S O) (Some ? x) y) → False. +intros; destruct H; +qed. + +theorem recursive2: ∀ x,y,z,t : nat. + (C1 ? ? t (Some ? x) y) = + (C1 ? ? z (Some ? x) y) → t=z. +intros; destruct H;assumption. +qed. + +theorem recursive3: ∀ x,y,z,t : nat. + C2 ? ? (None ?) ? (S O) ? z (C1 ? ? (S O) (Some ? x) y) = + C2 ? ? (None ?) ? (S O) ? t (C1 ? ? (S O) (Some ? x) y) → z=t. +intros; destruct H;assumption. +qed. + +theorem recursive4: ∀ x,y,z,t : nat. + C2 ? ? (None ?) ? (S O) ? z (C1 ? ? (S O) (Some ? z) y) = + C2 ? ? (None ?) ? (S O) ? t (C1 ? ? (S O) (Some ? x) y) → z=t. +intros; + + + + + (λHH : ((C1 (option nat) nat (S O) (Some nat -7) -8) = (C1 (option nat) nat (S O) (Some nat -9) -8)) + eq_elim_r + (complex (option nat) nat -8 (Some nat -7)) + (C1 (option nat) nat (S O) (Some nat -9) -8) + (λc:(complex (option nat) nat -8 (Some nat -7)). + (eq (option nat) + ((λx:(complex (option nat) nat -8 (Some nat -7)). + match x return (λy1:nat.(λy2:(option nat).(λ x:(complex (option nat) nat y1 y2).(option nat)))) with + [ (C1 (y1:nat) (a:(option nat)) (b:nat)) => a + | (C2 (a:(option nat)) (a1:(option nat)) (b:nat) (b1:nat) (y2:nat) (y3:(complex (option nat) nat b1 a1))) ⇒ + (Some nat -7) + ]) c) + (Some nat -9))) + ? + (C1 (option nat) nat (S O) (Some nat -7) -8) + HH) + + + + +destruct H;assumption. +qed. + +theorem recursive2: ∀ x,y : nat. + C2 ? ? (None ?) ? (S O) ? O (C1 ? ? O (Some ? x) y) = + C2 ? ? (None ?) ? (S O) ? O (C1 ? ? (S O) (Some ? x) y) → False. +intros; destruct H; + +