]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sand.ma
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / rtmap_sand.ma
index 5f707a57108e0977b31e20eea65d9efec3dbe870..2a2058c5942ad6573a5d240992280918fc05b781 100644 (file)
@@ -16,10 +16,10 @@ include "ground_2/notation/relations/rintersection_3.ma".
 include "ground_2/relocation/rtmap_sle.ma".
 
 coinductive sand: relation3 rtmap rtmap rtmap ≝
-| sand_pp: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â\86\91f1 = g1 â\86\92 â\86\91f2 = g2 â\86\92 â\86\91f = g → sand g1 g2 g
-| sand_np: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â«¯f1 = g1 â\86\92 â\86\91f2 = g2 â\86\92 â\86\91f = g → sand g1 g2 g
-| sand_pn: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â\86\91f1 = g1 â\86\92 â«¯f2 = g2 â\86\92 â\86\91f = g → sand g1 g2 g
-| sand_nn: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â«¯f1 = g1 â\86\92 â«¯f2 = g2 â\86\92 â«¯f = g → sand g1 g2 g
+| sand_pp: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â«¯f1 = g1 â\86\92 â«¯f2 = g2 â\86\92 â«¯f = g → sand g1 g2 g
+| sand_np: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â\86\91f1 = g1 â\86\92 â«¯f2 = g2 â\86\92 â«¯f = g → sand g1 g2 g
+| sand_pn: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â«¯f1 = g1 â\86\92 â\86\91f2 = g2 â\86\92 â«¯f = g → sand g1 g2 g
+| sand_nn: â\88\80f1,f2,f,g1,g2,g. sand f1 f2 f â\86\92 â\86\91f1 = g1 â\86\92 â\86\91f2 = g2 â\86\92 â\86\91f = g → sand g1 g2 g
 .
 
 interpretation "intersection (rtmap)"
@@ -27,8 +27,8 @@ interpretation "intersection (rtmap)"
 
 (* Basic inversion lemmas ***************************************************)
 
-lemma sand_inv_ppx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89¡ g â\86\92 â\88\80f1,f2. â\86\91f1 = g1 â\86\92 â\86\91f2 = g2 →
-                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89¡ f & â\86\91f = g.
+lemma sand_inv_ppx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89\98 g â\86\92 â\88\80f1,f2. â«¯f1 = g1 â\86\92 â«¯f2 = g2 →
+                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89\98 f & â«¯f = g.
 #g1 #g2 #g * -g1 -g2 -g
 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
 try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1)
@@ -38,8 +38,8 @@ try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2)
 /2 width=3 by ex2_intro/
 qed-.
 
-lemma sand_inv_npx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89¡ g â\86\92 â\88\80f1,f2. â«¯f1 = g1 â\86\92 â\86\91f2 = g2 →
-                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89¡ f & â\86\91f = g.
+lemma sand_inv_npx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89\98 g â\86\92 â\88\80f1,f2. â\86\91f1 = g1 â\86\92 â«¯f2 = g2 →
+                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89\98 f & â«¯f = g.
 #g1 #g2 #g * -g1 -g2 -g
 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
 try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1)
@@ -49,8 +49,8 @@ try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2)
 /2 width=3 by ex2_intro/
 qed-.
 
-lemma sand_inv_pnx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89¡ g â\86\92 â\88\80f1,f2. â\86\91f1 = g1 â\86\92 â«¯f2 = g2 →
-                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89¡ f & â\86\91f = g.
+lemma sand_inv_pnx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89\98 g â\86\92 â\88\80f1,f2. â«¯f1 = g1 â\86\92 â\86\91f2 = g2 →
+                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89\98 f & â«¯f = g.
 #g1 #g2 #g * -g1 -g2 -g
 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
 try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1)
@@ -60,8 +60,8 @@ try elim (discr_push_next … Hx2) try elim (discr_next_push … Hx2)
 /2 width=3 by ex2_intro/
 qed-.
 
-lemma sand_inv_nnx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89¡ g â\86\92 â\88\80f1,f2. â«¯f1 = g1 â\86\92 â«¯f2 = g2 →
-                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89¡ f & â«¯f = g.
+lemma sand_inv_nnx: â\88\80g1,g2,g. g1 â\8b\92 g2 â\89\98 g â\86\92 â\88\80f1,f2. â\86\91f1 = g1 â\86\92 â\86\91f2 = g2 →
+                    â\88\83â\88\83f. f1 â\8b\92 f2 â\89\98 f & â\86\91f = g.
 #g1 #g2 #g * -g1 -g2 -g
 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
 try (>(injective_push … Hx1) -x1) try (>(injective_next … Hx1) -x1)
@@ -73,12 +73,45 @@ qed-.
 
 (* Basic properties *********************************************************)
 
-let corec sand_refl: ∀f. f ⋒ f ≡ f ≝ ?.
+corec lemma sand_eq_repl_back1: ∀f2,f. eq_repl_back … (λf1. f1 ⋒ f2 ≘ f).
+#f2 #f #f1 * -f1 -f2 -f
+#f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x #Hx
+try cases (eq_inv_px … Hx … H1) try cases (eq_inv_nx … Hx … H1) -g1
+/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/
+qed-.
+
+lemma sand_eq_repl_fwd1: ∀f2,f. eq_repl_fwd … (λf1. f1 ⋒ f2 ≘ f).
+#f2 #f @eq_repl_sym /2 width=3 by sand_eq_repl_back1/
+qed-.
+
+corec lemma sand_eq_repl_back2: ∀f1,f. eq_repl_back … (λf2. f1 ⋒ f2 ≘ f).
+#f1 #f #f2 * -f1 -f2 -f
+#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx
+try cases (eq_inv_px … Hx … H2) try cases (eq_inv_nx … Hx … H2) -g2
+/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/
+qed-.
+
+lemma sand_eq_repl_fwd2: ∀f1,f. eq_repl_fwd … (λf2. f1 ⋒ f2 ≘ f).
+#f1 #f @eq_repl_sym /2 width=3 by sand_eq_repl_back2/
+qed-.
+
+corec lemma sand_eq_repl_back3: ∀f1,f2. eq_repl_back … (λf. f1 ⋒ f2 ≘ f).
+#f1 #f2 #f * -f1 -f2 -f
+#f1 #f2 #f #g1 #g2 #g #Hf #H #H2 #H0 #x #Hx
+try cases (eq_inv_px … Hx … H0) try cases (eq_inv_nx … Hx … H0) -g
+/3 width=7 by sand_pp, sand_np, sand_pn, sand_nn/
+qed-.
+
+lemma sand_eq_repl_fwd3: ∀f1,f2. eq_repl_fwd … (λf. f1 ⋒ f2 ≘ f).
+#f1 #f2 @eq_repl_sym /2 width=3 by sand_eq_repl_back3/
+qed-.
+
+corec lemma sand_refl: ∀f. f ⋒ f ≘ f.
 #f cases (pn_split f) * #g #H
 [ @(sand_pp … H H H) | @(sand_nn … H H H) ] -H //
 qed.
 
-let corec sand_sym: ∀f1,f2,f. f1 ⋒ f2 ≡ f → f2 ⋒ f1 ≡ f ≝ ?.
+corec lemma sand_sym: ∀f1,f2,f. f1 ⋒ f2 ≘ f → f2 ⋒ f1 ≘ f.
 #f1 #f2 #f * -f1 -f2 -f
 #f1 #f2 #f #g1 #g2 #g #Hf * * * -g1 -g2 -g
 [ @sand_pp | @sand_pn | @sand_np | @sand_nn ] /2 width=7 by/