definition false_f \def \lambda (X:Type). \lambda (_:X). False.
record Class: Type \def {
- class: Type;
+ class:> Type;
cin : class \to Prop;
cle1 : class \to class \to Prop
}.
-coercion class.
-
inductive ceq (C:Class) (c1:C): C \to Prop \def
| ceq_refl: cin ? c1 \to ceq ? c1 c1
| ceq_sing_r: \forall c2,c3.
\lambda (D:Domain). \lambda U.
mk_Domain (mk_Class D (sin D U) (cle1 D)).
-coercion domain_of_subset.
+coercion cic:/matita/PREDICATIVE-TOPOLOGY/subset_defs/domain_of_subset.con.
(* the full subset of a domain *)
coercion stop.
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}.
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).
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.
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.
(*
definition nat2int \def \lambda x. positive x.
-coercion pos2nat.
+coercion cic:/matita/tests/coercions/pos2nat.con.
-coercion nat2int.
+coercion cic:/matita/tests/coercions/nat2int.con.
definition fst \def \lambda x,y:int.x.
\def
\lambda f:int \to int. \lambda x : pos .f (nat2int (pos2nat x)).
-
\ No newline at end of file
+