X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambda%2Fpreamble.ma;h=c7c736f2ce1d3cad45775d2568fa537914ca2691;hb=f14ac9cceaaa7f1905f0dbc4548d24c4abe940e3;hp=afaacb5f24e2fef8578884f37c7441500d501e65;hpb=f8bc120b39bd74ade4e11d4d3ef4355f66c42495;p=helm.git diff --git a/matita/matita/contribs/lambda/preamble.ma b/matita/matita/contribs/lambda/preamble.ma index afaacb5f2..c7c736f2c 100644 --- a/matita/matita/contribs/lambda/preamble.ma +++ b/matita/matita/contribs/lambda/preamble.ma @@ -12,11 +12,15 @@ (* *) (**************************************************************************) -include "arithmetics/nat.ma". +include "basics/star.ma". +include "basics/lists/lstar.ma". +include "arithmetics/exp.ma". include "xoa_notation.ma". include "xoa.ma". +(* logic *) + (* Note: For some reason this cannot be in the standard library *) interpretation "logical false" 'false = False. @@ -24,6 +28,8 @@ notation "⊥" non associative with precedence 90 for @{'false}. +(* arithmetics *) + lemma lt_refl_false: ∀n. n < n → ⊥. #n #H elim (lt_to_not_eq … H) -H /2 width=1/ qed-. @@ -68,3 +74,30 @@ lemma tri_gt: ∀A,a1,a2,a3,n1,n2. n2 < n1 → tri A n1 n2 a1 a2 a3 = a3. | #n1 #IH #n2 elim n2 -n2 // /3 width=1/ ] qed. + +(* lists *) + +(* Note: notation for nil not involving brackets *) +notation > "◊" + non associative with precedence 90 + for @{'nil}. + +definition map_cons: ∀A. A → list (list A) → list (list A) ≝ λA,a. + map … (cons … a). + +interpretation "map_cons" 'ho_cons a l = (map_cons ? a l). + +notation "hvbox(a ::: break l)" + right associative with precedence 47 + for @{'ho_cons $a $l}. + +(* lstar *) + +(* Note: this cannot be in lib because of the missing xoa quantifier *) +lemma lstar_inv_pos: ∀A,B,R,l,b1,b2. lstar A B R l b1 b2 → 0 < |l| → + ∃∃a,ll,b. a::ll = l & R a b1 b & lstar A B R ll b b2. +#A #B #R #l #b1 #b2 #H @(lstar_ind_l ????????? H) -b1 +[ #H elim (lt_refl_false … H) +| #a #ll #b1 #b #Hb1 #Hb2 #_ #_ /2 width=6/ (**) (* auto fail if we do not remove the inductive premise *) +] +qed-.