1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/notation/relations/rintersection_3.ma".
16 include "ground/relocation/pr_tl.ma".
18 (* RELATIONAL INTERSECTION FOR PARTIAL RELOCATION MAPS **********************)
21 coinductive pr_sand: relation3 pr_map pr_map pr_map ≝
23 | pr_sand_push_bi (f1) (f2) (f) (g1) (g2) (g):
24 pr_sand f1 f2 f → ⫯f1 = g1 → ⫯f2 = g2 → ⫯f = g → pr_sand g1 g2 g
26 | pr_sand_next_push (f1) (f2) (f) (g1) (g2) (g):
27 pr_sand f1 f2 f → ↑f1 = g1 → ⫯f2 = g2 → ⫯f = g → pr_sand g1 g2 g
29 | pr_sand_push_next (f1) (f2) (f) (g1) (g2) (g):
30 pr_sand f1 f2 f → ⫯f1 = g1 → ↑f2 = g2 → ⫯f = g → pr_sand g1 g2 g
32 | pr_sand_next_bi (f1) (f2) (f) (g1) (g2) (g):
33 pr_sand f1 f2 f → ↑f1 = g1 → ↑f2 = g2 → ↑f = g → pr_sand g1 g2 g
37 "relational intersection (partial relocation maps)"
38 'RIntersection f1 f2 f = (pr_sand f1 f2 f).
40 (* Basic constructions ******************************************************)
43 corec lemma pr_sand_idem:
45 #f cases (pr_map_split_tl f) #H
46 [ @(pr_sand_push_bi … H H H)
47 | @(pr_sand_next_bi … H H H)
52 corec lemma pr_sand_comm:
53 ∀f1,f2,f. f1 ⋒ f2 ≘ f → f2 ⋒ f1 ≘ f.
54 #f1 #f2 #f * -f1 -f2 -f
55 #f1 #f2 #f #g1 #g2 #g #Hf * * * -g1 -g2 -g
63 (* Basic inversions *********************************************************)
66 lemma pr_sand_inv_push_bi:
67 ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ⫯f2 = g2 →
68 ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g.
69 #g1 #g2 #g * -g1 -g2 -g
70 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
71 try (>(eq_inv_pr_push_bi … Hx1) -x1) try (>(eq_inv_pr_next_bi … Hx1) -x1)
72 try elim (eq_inv_pr_push_next … Hx1) try elim (eq_inv_pr_next_push … Hx1)
73 try (>(eq_inv_pr_push_bi … Hx2) -x2) try (>(eq_inv_pr_next_bi … Hx2) -x2)
74 try elim (eq_inv_pr_push_next … Hx2) try elim (eq_inv_pr_next_push … Hx2)
75 /2 width=3 by ex2_intro/
79 lemma pr_sand_inv_next_push:
80 ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ⫯f2 = g2 →
81 ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g.
82 #g1 #g2 #g * -g1 -g2 -g
83 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
84 try (>(eq_inv_pr_push_bi … Hx1) -x1) try (>(eq_inv_pr_next_bi … Hx1) -x1)
85 try elim (eq_inv_pr_push_next … Hx1) try elim (eq_inv_pr_next_push … Hx1)
86 try (>(eq_inv_pr_push_bi … Hx2) -x2) try (>(eq_inv_pr_next_bi … Hx2) -x2)
87 try elim (eq_inv_pr_push_next … Hx2) try elim (eq_inv_pr_next_push … Hx2)
88 /2 width=3 by ex2_intro/
92 lemma pr_sand_inv_push_next:
93 ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ⫯f1 = g1 → ↑f2 = g2 →
94 ∃∃f. f1 ⋒ f2 ≘ f & ⫯f = g.
95 #g1 #g2 #g * -g1 -g2 -g
96 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
97 try (>(eq_inv_pr_push_bi … Hx1) -x1) try (>(eq_inv_pr_next_bi … Hx1) -x1)
98 try elim (eq_inv_pr_push_next … Hx1) try elim (eq_inv_pr_next_push … Hx1)
99 try (>(eq_inv_pr_push_bi … Hx2) -x2) try (>(eq_inv_pr_next_bi … Hx2) -x2)
100 try elim (eq_inv_pr_push_next … Hx2) try elim (eq_inv_pr_next_push … Hx2)
101 /2 width=3 by ex2_intro/
105 lemma pr_sand_inv_next_bi:
106 ∀g1,g2,g. g1 ⋒ g2 ≘ g → ∀f1,f2. ↑f1 = g1 → ↑f2 = g2 →
107 ∃∃f. f1 ⋒ f2 ≘ f & ↑f = g.
108 #g1 #g2 #g * -g1 -g2 -g
109 #f1 #f2 #f #g1 #g2 #g #Hf #H1 #H2 #H0 #x1 #x2 #Hx1 #Hx2 destruct
110 try (>(eq_inv_pr_push_bi … Hx1) -x1) try (>(eq_inv_pr_next_bi … Hx1) -x1)
111 try elim (eq_inv_pr_push_next … Hx1) try elim (eq_inv_pr_next_push … Hx1)
112 try (>(eq_inv_pr_push_bi … Hx2) -x2) try (>(eq_inv_pr_next_bi … Hx2) -x2)
113 try elim (eq_inv_pr_push_next … Hx2) try elim (eq_inv_pr_next_push … Hx2)
114 /2 width=3 by ex2_intro/