X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fground_2%2Flib%2Frelations.ma;h=86be386408dbf8856a3c91e8a9956f7311bbee75;hb=24ba1bb3f67505d3e384747ff90d26d3996bd3f5;hp=3f5c3b409f4b4babdf50a69f9fe3fe98fd8312a1;hpb=a961853f4bb6f26c4cc8ca9babad0de0e6c6d1ff;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma b/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma index 3f5c3b409..86be38640 100644 --- a/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma +++ b/matita/matita/contribs/lambdadelta/ground_2/lib/relations.ma @@ -17,14 +17,32 @@ include "ground_2/xoa/xoa_props.ma". (* GENERIC RELATIONS ********************************************************) -(* PROPERTIES OF RELATIONS **************************************************) +(* Inclusion ****************************************************************) -definition relation5 : Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] +definition subR2 (S1) (S2): relation (relation2 S1 S2) ≝ + λR1,R2. (∀a1,a2. R1 a1 a2 → R2 a1 a2). + +interpretation "2-relation inclusion" + 'subseteq R1 R2 = (subR2 ?? R1 R2). + +definition subR3 (S1) (S2) (S3): relation (relation3 S1 S2 S3) ≝ + λR1,R2. (∀a1,a2,a3. R1 a1 a2 a3 → R2 a1 a2 a3). + +interpretation "3-relation inclusion" + 'subseteq R1 R2 = (subR3 ??? R1 R2). + +(* Properties of relations **************************************************) + +definition relation5: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] ≝ λA,B,C,D,E.A→B→C→D→E→Prop. -definition relation6 : Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] +definition relation6: Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] → Type[0] ≝ λA,B,C,D,E,F.A→B→C→D→E→F→Prop. +(**) (* we dont use "∀a. reflexive … (R a)" since auto seems to dislike repeatd δ-expansion *) +definition c_reflexive (A) (B): predicate (relation3 A B B) ≝ + λR. ∀a,b. R a b b. + definition Decidable: Prop → Prop ≝ λR. R ∨ (R → ⊥). definition Transitive: ∀A. ∀R: relation A. Prop ≝ λA,R. @@ -47,9 +65,9 @@ definition transitive2: ∀A. ∀R1,R2: relation A. Prop ≝ λA,R1,R2. ∀a1,a0. R1 a1 a0 → ∀a2. R2 a0 a2 → ∃∃a. R2 a1 a & R1 a a2. -definition bi_confluent: ∀A,B. ∀R: bi_relation A B. Prop ≝ λA,B,R. - ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. R a0 b0 a2 b2 → - ∃∃a,b. R a1 b1 a b & R a2 b2 a b. +definition bi_confluent: ∀A,B. ∀R: bi_relation A B. Prop ≝ λA,B,R. + ∀a0,a1,b0,b1. R a0 b0 a1 b1 → ∀a2,b2. R a0 b0 a2 b2 → + ∃∃a,b. R a1 b1 a b & R a2 b2 a b. definition lsub_trans: ∀A,B. relation2 (A→relation B) (relation A) ≝ λA,B,R1,R2. ∀L2,T1,T2. R1 L2 T1 T2 → ∀L1. R2 L1 L2 → R1 L1 T1 T2. @@ -94,3 +112,12 @@ lemma NF_to_SN_sn: ∀A,R,S,a. NF_sn A R S a → SN_sn A R S a. @SN_sn_intro #a1 #HRa12 #HSa12 elim HSa12 -HSa12 /2 width=1 by/ qed. + +(* Relations on unboxed triples *********************************************) + +definition tri_RC: ∀A,B,C. tri_relation A B C → tri_relation A B C ≝ + λA,B,C,R,a1,b1,c1,a2,b2,c2. R … a1 b1 c1 a2 b2 c2 ∨ + ∧∧ a1 = a2 & b1 = b2 & c1 = c2. + +lemma tri_RC_reflexive: ∀A,B,C,R. tri_reflexive A B C (tri_RC … R). +/3 width=1 by and3_intro, or_intror/ qed.