]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/tests/discriminate.ma
added some lines to compile for debugging
[helm.git] / matita / tests / discriminate.ma
index d8e4bf2e25a84951c358c1437551c0d5a971d105..b1d7b9ca68a74ef5b96959ee19e4ccbe2031cee5 100644 (file)
 (**************************************************************************)
 
 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".
 
-inductive foo: Prop \def I_foo: foo.
+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.
 
-alias id "False" = "cic:/Coq/Init/Logic/False.ind#xpointer(1/1)".
 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
+ | k1: \forall T:Type. dt A T
+ | k2: \forall T:Type. \forall T':Type. dt A (T \to T').
+theorem stupid3:
+ k1 False (False → True) = k2 False False True → False.
+ intros;
+ destruct H.
+qed.
+
+inductive dddt (A:Type): Type \to Type \def
+ | kkk1: dddt A nat
+ | kkk2: dddt A nat.
+theorem stupid4: kkk1 False = kkk2 False \to False.
+ intros;
+ 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;
+
+