]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/list/list.ma
coercion command now requires an uri
[helm.git] / helm / matita / library / list / list.ma
index d5664f4166c783914af3be60f1d60bc25a008a79..ffa2c8ef9ac106c007f701cef1cf21b589f51a19 100644 (file)
@@ -16,6 +16,10 @@ set "baseuri" "cic:/matita/list/".
 include "logic/equality.ma".
 include "higher_order_defs/functions.ma".
 
+inductive list (A:Set) : Set :=
+  | nil: list A
+  | cons: A -> list A -> list A.
+
 notation "hvbox(hd break :: tl)"
   right associative with precedence 46
   for @{'cons $hd $tl}.
@@ -28,10 +32,6 @@ notation "hvbox(l1 break @ l2)"
   right associative with precedence 47
   for @{'append $l1 $l2 }.
 
-inductive list (A:Set) : Set :=
-  | nil: list A
-  | cons: A -> list A -> list A.
-
 interpretation "nil" 'nil = (cic:/matita/list/list.ind#xpointer(1/1/1) _).
 interpretation "cons" 'cons hd tl =
   (cic:/matita/list/list.ind#xpointer(1/1/2) _ hd tl).
@@ -41,8 +41,9 @@ interpretation "cons" 'cons hd tl =
 theorem nil_cons:
   \forall A:Set.\forall l:list A.\forall a:A.
     a::l <> [].
-  intros.
-  unfold; intros.
+  intros;
+  unfold Not;
+  intros;
   discriminate H.
 qed.
 
@@ -64,28 +65,31 @@ definition tail := \lambda A:Set. \lambda l: list A.
 interpretation "append" 'append l1 l2 = (cic:/matita/list/append.con _ l1 l2).
 
 theorem append_nil: \forall A:Set.\forall l:list A.l @ [] = l.
-  intros.
-  elim l.
-  reflexivity.
-  simplify.
-  rewrite > H.
-  reflexivity.
+  intros;
+  elim l;
+  [ reflexivity;
+  | simplify;
+    rewrite > H;
+    reflexivity;
+  ]
 qed.
 
 theorem associative_append: \forall A:Set.associative (list A) (append A).
-  intros; unfold; intros.
-  elim x.
-  simplify; reflexivity.
-  simplify.
-  rewrite > H.
-  reflexivity.
+  intros; unfold; intros;
+  elim x;
+  [ simplify;
+    reflexivity;
+  | simplify;
+    rewrite > H;
+    reflexivity;
+  ]
 qed.
 
 theorem cons_append_commute:
   \forall A:Set.\forall l1,l2:list A.\forall a:A.
     a :: (l1 @ l2) = (a :: l1) @ l2.
-  intros.
-  reflexivity.
+  intros;
+  reflexivity;
 qed.
 
 (*