]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/overlap/o-algebra.ma
1) stuff moved from categories.ma to setoids*.ma
[helm.git] / helm / software / matita / nlibrary / overlap / o-algebra.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "sets/categories2.ma".
16
17 (*
18 interpretation "unary morphism comprehension with no proof" 'comprehension T P = 
19   (mk_unary_morphism T ? P ?).
20 interpretation "unary morphism1 comprehension with no proof" 'comprehension T P = 
21   (mk_unary_morphism1 T ? P ?).
22
23 notation > "hvbox({ ident i ∈ s | term 19 p | by })" with precedence 90
24 for @{ 'comprehension_by $s (λ${ident i}. $p) $by}.
25 notation < "hvbox({ ident i ∈ s | term 19 p })" with precedence 90
26 for @{ 'comprehension_by $s (λ${ident i}:$_. $p) $by}.
27
28 interpretation "unary morphism comprehension with proof" 'comprehension_by s \eta.f p = 
29   (mk_unary_morphism s ? f p).
30 interpretation "unary morphism1 comprehension with proof" 'comprehension_by s \eta.f p = 
31   (mk_unary_morphism1 s ? f p).
32 *)
33
34 (* per il set-indexing vedere capitolo BPTools (foundational tools), Sect. 0.3.4 complete
35    lattices, Definizione 0.9 *)
36 (* USARE L'ESISTENZIALE DEBOLE *)
37 nrecord OAlgebra : Type[2] := {
38   oa_P :> setoid1;
39   oa_leq : binary_morphism1 oa_P oa_P CPROP; (*CSC: dovrebbe essere CProp bug refiner*)
40   oa_overlap: binary_morphism1 oa_P oa_P CPROP;
41   binary_meet: binary_morphism1 oa_P oa_P oa_P;
42 (*CSC:  oa_join: ∀I:setoid.unary_morphism1 (setoid1_of_setoid … I ⇒ oa_P) oa_P;*)
43   oa_one: oa_P;
44   oa_zero: oa_P;
45   oa_leq_refl: ∀a:oa_P. oa_leq a a; 
46   oa_leq_antisym: ∀a,b:oa_P.oa_leq a b → oa_leq b a → a = b;
47   oa_leq_trans: ∀a,b,c:oa_P.oa_leq a b → oa_leq b c → oa_leq a c;
48   oa_overlap_sym: ∀a,b:oa_P.oa_overlap a b → oa_overlap b a;
49 (*CSC:  oa_join_sup: ∀I:setoid.∀p_i:I ⇒ oa_P.∀p:oa_P.oa_leq (oa_join I p_i) p = (∀i:I.oa_leq (p_i i) p);*)
50   oa_zero_bot: ∀p:oa_P.oa_leq oa_zero p;
51   oa_one_top: ∀p:oa_P.oa_leq p oa_one;
52   oa_overlap_preservers_meet: ∀p,q:oa_P.oa_overlap p q → oa_overlap p (binary_meet p q);
53 (*CSC:  oa_join_split:
54       ∀I:SET.∀p.∀q:I ⇒ oa_P.
55        oa_overlap p (oa_join I q) = (∃i:I.oa_overlap p (q i));*)
56   (*oa_base : setoid;
57   1) enum non e' il nome giusto perche' non e' suriettiva
58   2) manca (vedere altro capitolo) la "suriettivita'" come immagine di insiemi di oa_base
59   oa_enum : ums oa_base oa_P;
60   oa_density: ∀p,q.(∀i.oa_overlap p (oa_enum i) → oa_overlap q (oa_enum i)) → oa_leq p q
61   *)
62   oa_density: 
63       ∀p,q.(∀r.oa_overlap p r → oa_overlap q r) → oa_leq p q
64 }.
65
66 interpretation "o-algebra leq" 'leq a b = (fun21 ??? (oa_leq ?) a b).
67
68 notation "hovbox(a mpadded width -150% (>)< b)" non associative with precedence 45
69 for @{ 'overlap $a $b}.
70 interpretation "o-algebra overlap" 'overlap a b = (fun21 ??? (oa_overlap ?) a b).
71
72 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∧) \below (\emsp) \nbsp term 90 p)" 
73 non associative with precedence 50 for @{ 'oa_meet $p }.
74 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∧) \below (ident i ∈  I) break term 90 p)" 
75 non associative with precedence 50 for @{ 'oa_meet_mk (λ${ident i}:$I.$p) }.
76
77 (*notation > "hovbox(∧ f)" non associative with precedence 60
78 for @{ 'oa_meet $f }.
79 interpretation "o-algebra meet" 'oa_meet f = 
80   (fun12 ?? (oa_meet ??) f).
81 interpretation "o-algebra meet with explicit function" 'oa_meet_mk f = 
82   (fun12 ?? (oa_meet ??) (mk_unary_morphism ?? f ?)).
83 *)
84 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (\emsp) \nbsp term 90 p)" 
85 non associative with precedence 50 for @{ 'oa_join $p }.
86 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (ident i ∈  I) break term 90 p)" 
87 non associative with precedence 50 for @{ 'oa_join_mk (λ${ident i}:$I.$p) }.
88
89 (*CSC
90 notation > "hovbox(∨ f)" non associative with precedence 60
91 for @{ 'oa_join $f }.
92 interpretation "o-algebra join" 'oa_join f = 
93   (fun12 ?? (oa_join ??) f).
94 interpretation "o-algebra join with explicit function" 'oa_join_mk f = 
95   (fun12 ?? (oa_join ??) (mk_unary_morphism ?? f ?)).
96 *)
97 (*definition binary_meet : ∀O:OAlgebra. binary_morphism1 O O O.
98 intros; split;
99 [ intros (p q); 
100   apply (∧ { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p ? p q });
101 | intros; lapply (prop12 ? O (oa_meet O BOOL));
102    [2: apply ({ x ∈ BOOL | match x with [ true ⇒ a | false ⇒ b ] | IF_THEN_ELSE_p ? a b });
103    |3: apply ({ x ∈ BOOL | match x with [ true ⇒ a' | false ⇒ b' ] | IF_THEN_ELSE_p ? a' b' });
104    | apply Hletin;]
105   intro x; simplify; cases x; simplify; assumption;]
106 qed.*)
107
108 interpretation "o-algebra binary meet" 'and a b = 
109   (fun21 ??? (binary_meet ?) a b).
110
111 (*
112 prefer coercion Type1_OF_OAlgebra.
113
114 definition binary_join : ∀O:OAlgebra. binary_morphism1 O O O.
115 intros; split;
116 [ intros (p q); 
117   apply (∨ { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p ? p q });
118 | intros; lapply (prop12 ? O (oa_join O BOOL));
119    [2: apply ({ x ∈ BOOL | match x with [ true ⇒ a | false ⇒ b ] | IF_THEN_ELSE_p ? a b });
120    |3: apply ({ x ∈ BOOL | match x with [ true ⇒ a' | false ⇒ b' ] | IF_THEN_ELSE_p ? a' b' });
121    | apply Hletin;]
122   intro x; simplify; cases x; simplify; assumption;]
123 qed.
124
125 interpretation "o-algebra binary join" 'or a b = 
126   (fun21 ??? (binary_join ?) a b).
127 *)
128 (*
129 lemma oa_overlap_preservers_meet: ∀O:OAlgebra.∀p,q:O.p >< q → p >< (p ∧ q).
130 (* next change to avoid universe inconsistency *)
131 change in ⊢ (?→%→%→?) with (Type1_OF_OAlgebra O);
132 intros;  lapply (oa_overlap_preserves_meet_ O p q f);
133 lapply (prop21 O O CPROP (oa_overlap O) p p ? (p ∧ q) # ?);
134 [3: apply (if ?? (Hletin1)); apply Hletin;|skip] apply refl1;
135 qed.
136 *)
137 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (\emsp) \nbsp term 90 p)" 
138 non associative with precedence 49 for @{ 'oa_join $p }.
139 notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (ident i ∈  I) break term 90 p)" 
140 non associative with precedence 49 for @{ 'oa_join_mk (λ${ident i}:$I.$p) }.
141 notation < "hovbox(a ∨ b)" left associative with precedence 49
142 for @{ 'oa_join_mk (λ${ident i}:$_.match $i with [ true ⇒ $a | false ⇒ $b ]) }.
143
144 notation > "hovbox(∨ f)" non associative with precedence 59
145 for @{ 'oa_join $f }.
146 notation > "hovbox(a ∨ b)" left associative with precedence 49
147 for @{ 'oa_join (mk_unary_morphism BOOL ? (λx__:bool.match x__ with [ true ⇒ $a | false ⇒ $b ]) (IF_THEN_ELSE_p ? $a $b)) }.
148
149 (*interpretation "o-algebra join" 'oa_join f = 
150   (fun12 ?? (oa_join ??) f).
151 interpretation "o-algebra join with explicit function" 'oa_join_mk f = 
152   (fun12 ?? (oa_join ??) (mk_unary_morphism ?? f ?)).
153 *)
154 nrecord ORelation (P,Q : OAlgebra) : Type[1] ≝ {
155   or_f :> P ⇒ Q;
156   or_f_minus_star : P ⇒ Q;
157   or_f_star : Q ⇒ P;
158   or_f_minus : Q ⇒ P;
159   or_prop1 : ∀p,q. (or_f p ≤ q) = (p ≤ or_f_star q);
160   or_prop2 : ∀p,q. (or_f_minus p ≤ q) = (p ≤ or_f_minus_star q);
161   or_prop3 : ∀p,q. (or_f p >< q) = (p >< or_f_minus q)
162 }.
163  
164 notation "r \sup *" non associative with precedence 90 for @{'OR_f_star $r}.
165 notation > "r *" non associative with precedence 90 for @{'OR_f_star $r}.
166
167 notation "r \sup (⎻* )" non associative with precedence 90 for @{'OR_f_minus_star $r}.
168 notation > "r⎻*" non associative with precedence 90 for @{'OR_f_minus_star $r}.
169
170 notation "r \sup ⎻" non associative with precedence 90 for @{'OR_f_minus $r}.
171 notation > "r⎻" non associative with precedence 90 for @{'OR_f_minus $r}.
172
173 interpretation "o-relation f⎻*" 'OR_f_minus_star r = (or_f_minus_star ? ? r).
174 interpretation "o-relation f⎻" 'OR_f_minus r = (or_f_minus ? ? r).
175 interpretation "o-relation f*" 'OR_f_star r = (or_f_star ? ? r).
176
177
178 ndefinition ORelation_setoid : OAlgebra → OAlgebra → setoid1.
179 #P; #Q; @ (ORelation P Q); @
180  [ napply (λp,q.p = q)
181  | #x; napply refl1
182  | #x; #y; napply sym1
183  | #x; #y; #z; napply trans1 ]
184 nqed.
185
186 unification hint 0 ≔ P, Q ;
187   R ≟ (ORelation_setoid P Q)
188 (* -------------------------- *) ⊢
189     carr1 R ≡ ORelation P Q.
190
191 ndefinition or_f_morphism1: ∀P,Q:OAlgebra.unary_morphism1 (ORelation_setoid P Q)
192  (unary_morphism1_setoid1 P Q).
193  #P; #Q; @
194   [ napply or_f
195   | #a; #a'; #e; nassumption]
196 nqed.
197
198 unification hint 0 ≔ P, Q, r;
199  R ≟ (mk_unary_morphism1 … (or_f …) (prop11 … (or_f_morphism1 …)))
200 (* ------------------------ *) ⊢
201   fun11 … R r ≡ or_f P Q r.
202
203 nlemma ORelation_eq_respects_leq_or_f_minus_:
204  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
205   r=r' → ∀x. r⎻ x ≤ r'⎻ x.
206  #P; #Q; #a; #a'; #e; #x;
207  napply oa_density; #r; #H;
208  napply oa_overlap_sym;
209  napply (. (or_prop3 … a' …)^-1); (*CSC: why a'? *)
210  napply (. ?‡#)
211   [##2: napply (a r)
212   | ngeneralize in match r in ⊢ %;
213     nchange with (or_f … a' = or_f … a);
214     napply (.= †e^-1);
215     napply #]
216  napply (. (or_prop3 …));
217  napply oa_overlap_sym;
218  nassumption.
219 nqed.
220
221 nlemma ORelation_eq2:
222  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
223   r=r' → r⎻ = r'⎻.
224  #P; #Q; #a; #a'; #e; #x;
225  napply oa_leq_antisym; napply ORelation_eq_respects_leq_or_f_minus_
226   [ napply e | napply e^-1]
227 nqed.
228
229 ndefinition or_f_minus_morphism1: ∀P,Q:OAlgebra.unary_morphism1 (ORelation_setoid P Q)
230  (unary_morphism1_setoid1 Q P).
231  #P; #Q; @
232   [ napply or_f_minus
233   | napply ORelation_eq2]
234 nqed.
235
236 unification hint 0 ≔ P, Q, r;
237  R ≟ (mk_unary_morphism1 … (or_f_minus …) (prop11 … (or_f_minus_morphism1 …)))
238 (* ------------------------ *) ⊢
239   fun11 … R r ≡ or_f_minus P Q r.
240
241 nlemma ORelation_eq_respects_leq_or_f_star_:
242  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
243   r=r' → ∀x. r* x ≤ r'* x.
244  #P; #Q; #a; #a'; #e; #x; (*CSC: una schifezza *)
245  ngeneralize in match (. (or_prop1 P Q a' (a* x) x)^-1) in ⊢ %; #H; napply H;
246  nchange with (or_f P Q a' (a* x) ≤ x);
247  napply (. ?‡#)
248   [##2: napply (a (a* x))
249   | ngeneralize in match (a* x);
250     nchange with (or_f P Q a' = or_f P Q a);
251     napply (.= †e^-1); napply #]
252  napply (. (or_prop1 …));
253  napply oa_leq_refl.
254 nqed.
255
256 nlemma ORelation_eq3:
257  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
258   r=r' → r* = r'*.
259  #P; #Q; #a; #a'; #e; #x;
260  napply oa_leq_antisym; napply ORelation_eq_respects_leq_or_f_star_
261   [ napply e | napply e^-1]
262 nqed.
263
264 ndefinition or_f_star_morphism1: ∀P,Q:OAlgebra.unary_morphism1 (ORelation_setoid P Q)
265  (unary_morphism1_setoid1 Q P).
266  #P; #Q; @
267   [ napply or_f_star
268   | napply ORelation_eq3] 
269 nqed.
270
271 unification hint 0 ≔ P, Q, r;
272  R ≟ (mk_unary_morphism1 … (or_f_star …) (prop11 … (or_f_star_morphism1 …)))
273 (* ------------------------ *) ⊢
274   fun11 … R r ≡ or_f_star P Q r.
275
276 nlemma ORelation_eq_respects_leq_or_f_minus_star_:
277  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
278   r=r' → ∀x. r⎻* x ≤ r'⎻* x.
279  #P; #Q; #a; #a'; #e; #x; (*CSC: una schifezza *)
280  ngeneralize in match (. (or_prop2 P Q a' (a⎻* x) x)^-1) in ⊢ %; #H; napply H;
281  nchange with (or_f_minus P Q a' (a⎻* x) ≤ x);
282  napply (. ?‡#)
283   [##2: napply (a⎻ (a⎻* x))
284   | ngeneralize in match (a⎻* x);
285     nchange with (a'⎻ = a⎻);
286     napply (.= †e^-1); napply #]
287  napply (. (or_prop2 …));
288  napply oa_leq_refl.
289 nqed.
290
291 nlemma ORelation_eq4:
292  ∀P,Q:OAlgebra.∀r,r':ORelation P Q.
293   r=r' → r⎻* = r'⎻*.
294  #P; #Q; #a; #a'; #e; #x;
295  napply oa_leq_antisym; napply ORelation_eq_respects_leq_or_f_minus_star_
296   [ napply e | napply e^-1]
297 nqed.
298
299 ndefinition or_f_minus_star_morphism1:
300  ∀P,Q:OAlgebra.unary_morphism1 (ORelation_setoid P Q) (unary_morphism1_setoid1 P Q).
301  #P; #Q; @
302   [ napply or_f_minus_star
303   | napply ORelation_eq4]
304 nqed.
305
306 unification hint 0 ≔ P, Q, r;
307  R ≟ (mk_unary_morphism1 … (or_f_minus_star …) (prop11 … (or_f_minus_star_morphism1 …)))
308 (* ------------------------ *) ⊢
309   fun11 … R r ≡ or_f_minus_star P Q r.
310
311 ndefinition ORelation_composition : ∀P,Q,R. 
312   binary_morphism1 (ORelation_setoid P Q) (ORelation_setoid Q R) (ORelation_setoid P R).
313 #P; #Q; #R; @
314 [ #F; #G; @
315   [ napply (comp1_unary_morphisms … G F) (*CSC: was (G ∘ F);*)
316   | napply (comp1_unary_morphisms … G⎻* F⎻* ) (*CSC: was (G⎻* ∘ F⎻* );*)
317   | napply (comp1_unary_morphisms … F* G* ) (*CSC: was (F* ∘ G* );*)
318   | napply (comp1_unary_morphisms … F⎻ G⎻) (*CSC: was (F⎻ ∘ G⎻);*)
319   | #p; #q; nnormalize;
320     napply (.= (or_prop1 … G …)); (*CSC: it used to understand without G *)
321     napply (or_prop1 …)
322   | #p; #q; nnormalize;
323     napply (.= (or_prop2 … F …));
324     napply or_prop2
325   | #p; #q; nnormalize;
326     napply (.= (or_prop3 … G …));
327     napply or_prop3
328   ]
329 ##| #a;#a';#b;#b';#e;#e1;#x;nnormalize;napply (.= †(e x));napply e1]
330 nqed.
331
332 (*
333 ndefinition OA : category2.
334 split;
335 [ apply (OAlgebra);
336 | intros; apply (ORelation_setoid o o1);
337 | intro O; split;
338   [1,2,3,4: apply id2;
339   |5,6,7:intros; apply refl1;] 
340 | apply ORelation_composition;
341 | intros (P Q R S F G H); split;
342    [ change with (H⎻* ∘ G⎻* ∘ F⎻* = H⎻* ∘ (G⎻* ∘ F⎻* ));
343      apply (comp_assoc2 ????? (F⎻* ) (G⎻* ) (H⎻* ));
344    | apply ((comp_assoc2 ????? (H⎻) (G⎻) (F⎻))^-1);
345    | apply ((comp_assoc2 ????? F G H)^-1);
346    | apply ((comp_assoc2 ????? H* G* F* ));]
347 | intros; split; unfold ORelation_composition; simplify; apply id_neutral_left2;
348 | intros; split; unfold ORelation_composition; simplify; apply id_neutral_right2;]
349 qed.
350
351 definition OAlgebra_of_objs2_OA: objs2 OA → OAlgebra ≝ λx.x.
352 coercion OAlgebra_of_objs2_OA.
353
354 definition ORelation_setoid_of_arrows2_OA: 
355   ∀P,Q. arrows2 OA P Q → ORelation_setoid P Q ≝ λP,Q,c.c.
356 coercion ORelation_setoid_of_arrows2_OA.
357
358 prefer coercion Type_OF_objs2.
359 *)
360 (* alias symbol "eq" = "setoid1 eq". *)
361
362 (* qui la notazione non va *)
363 (*CSC
364 nlemma leq_to_eq_join: ∀S:OAlgebra.∀p,q:S. p ≤ q → q = (binary_join ? p q).
365  intros;
366  apply oa_leq_antisym;
367   [ apply oa_density; intros;
368     apply oa_overlap_sym;
369     unfold binary_join; simplify;
370     apply (. (oa_join_split : ?));
371     exists; [ apply false ]
372     apply oa_overlap_sym;
373     assumption
374   | unfold binary_join; simplify;
375     apply (. (oa_join_sup : ?)); intro;
376     cases i; whd in ⊢ (? ? ? ? ? % ?);
377      [ assumption | apply oa_leq_refl ]]
378 qed.
379
380 nlemma overlap_monotone_left: ∀S:OAlgebra.∀p,q,r:S. p ≤ q → p >< r → q >< r.
381  #S; #p; #q; #r; #H1; #H2;
382  apply (. (leq_to_eq_join : ?)‡#);
383   [ apply f;
384   | skip
385   | apply oa_overlap_sym;
386     unfold binary_join; simplify;
387     apply (. (oa_join_split : ?));
388     exists [ apply true ]
389     apply oa_overlap_sym;
390     assumption; ]
391 qed.*)
392
393 (* Part of proposition 9.9 *)
394 nlemma f_minus_image_monotone: ∀S,T.∀R:ORelation S T.∀p,q. p ≤ q → R⎻ p ≤ R⎻ q.
395  #S; #T; #R; #p; #q; #H;
396  napply (. (or_prop2 …));
397  napply oa_leq_trans; ##[##2: napply H; ##| ##skip |
398   napply (. (or_prop2 … q …)^ -1);(*CSC: why q?*) napply oa_leq_refl]
399 nqed.
400  
401 (* Part of proposition 9.9 *)
402 nlemma f_minus_star_image_monotone: ∀S,T.∀R:ORelation S T.∀p,q. p ≤ q → R⎻* p ≤ R⎻* q.
403  #S; #T; #R; #p; #q; #H;
404  napply (. (or_prop2 … (R⎻* p) q)^ -1); (*CSC: why ?*)
405  napply oa_leq_trans; ##[##3: napply H; ##| ##skip | napply (. (or_prop2 …)); napply oa_leq_refl]
406 nqed.
407
408 (* Part of proposition 9.9 *)
409 nlemma f_image_monotone: ∀S,T.∀R:ORelation S T.∀p,q. p ≤ q → R p ≤ R q.
410  #S; #T; #R; #p; #q; #H;
411  napply (. (or_prop1 …));
412  napply oa_leq_trans; ##[##2: napply H; ##| ##skip | napply (. (or_prop1 … q …)^ -1); napply oa_leq_refl]
413 nqed.
414
415 (* Part of proposition 9.9 *)
416 nlemma f_star_image_monotone: ∀S,T.∀R:ORelation S T.∀p,q. p ≤ q → R* p ≤ R* q.
417  #S; #T; #R; #p; #q; #H;
418  napply (. (or_prop1 … (R* p) q)^ -1);
419  napply oa_leq_trans; ##[##3: napply H; ##| ##skip | napply (. (or_prop1 …)); napply oa_leq_refl]
420 nqed.
421
422 nlemma lemma_10_2_a: ∀S,T.∀R:ORelation S T.∀p. p ≤ R⎻* (R⎻ p).
423  #S; #T; #R; #p;
424  napply (. (or_prop2 … p …)^-1);
425  napply oa_leq_refl.
426 nqed.
427
428 nlemma lemma_10_2_b: ∀S,T.∀R:ORelation S T.∀p. R⎻ (R⎻* p) ≤ p.
429  #S; #T; #R; #p;
430  napply (. (or_prop2 …));
431  napply oa_leq_refl.
432 nqed.
433
434 nlemma lemma_10_2_c: ∀S,T.∀R:ORelation S T.∀p. p ≤ R* (R p).
435  #S; #T; #R; #p;
436  napply (. (or_prop1 … p …)^-1);
437  napply oa_leq_refl.
438 nqed.
439
440 nlemma lemma_10_2_d: ∀S,T.∀R:ORelation S T.∀p. R (R* p) ≤ p.
441  #S; #T; #R; #p;
442  napply (. (or_prop1 …));
443  napply oa_leq_refl.
444 nqed.
445
446 nlemma lemma_10_3_a: ∀S,T.∀R:ORelation S T.∀p. R⎻ (R⎻* (R⎻ p)) = R⎻ p.
447  #S; #T; #R; #p; napply oa_leq_antisym
448   [ napply lemma_10_2_b
449   | napply f_minus_image_monotone;
450     napply lemma_10_2_a ]
451 nqed.
452
453 nlemma lemma_10_3_b: ∀S,T.∀R:ORelation S T.∀p. R* (R (R* p)) = R* p.
454  #S; #T; #R; #p; napply oa_leq_antisym
455   [ napply f_star_image_monotone;
456     napply (lemma_10_2_d ?? R p)
457   | napply lemma_10_2_c ]
458 nqed.
459
460 nlemma lemma_10_3_c: ∀S,T.∀R:ORelation S T.∀p. R (R* (R p)) = R p.
461  #S; #T; #R; #p; napply oa_leq_antisym
462   [ napply lemma_10_2_d
463   | napply f_image_monotone;
464     napply (lemma_10_2_c ?? R p) ]
465 nqed.
466
467 nlemma lemma_10_3_d: ∀S,T.∀R:ORelation S T.∀p. R⎻* (R⎻ (R⎻* p)) = R⎻* p.
468  #S; #T; #R; #p; napply oa_leq_antisym
469   [ napply f_minus_star_image_monotone;
470     napply (lemma_10_2_b ?? R p)
471   | napply lemma_10_2_a ]
472 nqed.
473
474 nlemma lemma_10_4_a: ∀S,T.∀R:ORelation S T.∀p. R⎻* (R⎻ (R⎻* (R⎻ p))) = R⎻* (R⎻ p).
475  #S; #T; #R; #p; napply (†(lemma_10_3_a …)).
476 nqed.
477
478 nlemma lemma_10_4_b: ∀S,T.∀R:ORelation S T.∀p. R (R* (R (R* p))) = R (R* p).
479  #S; #T; #R; #p; napply (†(lemma_10_3_b …));
480 nqed.
481
482 nlemma oa_overlap_sym': ∀o:OAlgebra.∀U,V:o. (U >< V) = (V >< U).
483  #o; #U; #V; @; #H; napply oa_overlap_sym; nassumption.
484 nqed.