X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Flist%2Flist.ma;h=9ecfd50e3ff41bf5cf89e6604ea2ca4986cf7e48;hb=576a1f3f67dc0207a664a127fe482facbfa2a826;hp=ffa2c8ef9ac106c007f701cef1cf21b589f51a19;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/matita/library/list/list.ma b/helm/software/matita/library/list/list.ma index ffa2c8ef9..9ecfd50e3 100644 --- a/helm/software/matita/library/list/list.ma +++ b/helm/software/matita/library/list/list.ma @@ -44,7 +44,7 @@ theorem nil_cons: intros; unfold Not; intros; - discriminate H. + destruct H. qed. let rec id_list A (l: list A) on l := @@ -92,6 +92,29 @@ theorem cons_append_commute: reflexivity; qed. +inductive permutation (A:Set) : list A -> list A -> Prop \def + | refl : \forall l:list A. permutation ? l l + | swap : \forall l:list A. \forall x,y:A. + permutation ? (x :: y :: l) (y :: x :: l) + | trans : \forall l1,l2,l3:list A. + permutation ? l1 l2 -> permut1 ? l2 l3 -> permutation ? l1 l3 +with permut1 : list A -> list A -> Prop \def + | step : \forall l1,l2:list A. \forall x,y:A. + permut1 ? (l1 @ (x :: y :: l2)) (l1 @ (y :: x :: l2)). + +include "nat/nat.ma". + +definition x1 \def S O. +definition x2 \def S x1. +definition x3 \def S x2. + +theorem tmp : permutation nat (x1 :: x2 :: x3 :: []) (x1 :: x3 :: x2 :: []). + apply (trans ? (x1 :: x2 :: x3 :: []) (x1 :: x2 :: x3 :: []) ?). + apply refl. + apply (step ? (x1::[]) [] x2 x3). + qed. + + (* theorem nil_append_nil_both: \forall A:Set.\forall l1,l2:list A.