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 "preamble.ma".
17 (* PREDICATES *********************************************************)
19 definition u0_predicate1: Type[0] → Type[1] ≝ λT.T → Prop.
21 definition u0_predicate2: Type[0] → Type[1] ≝ λT.T → u0_predicate1 T.
23 definition u1_predicate1: Type[1] → Type[2] ≝ λT.T → Prop.
25 definition u1_predicate2: Type[1] → Type[2] ≝ λT.T → u1_predicate1 T.
27 definition u0_full: ∀T:Type[0]. u0_predicate1 T ≝ λT,a. ⊤.
29 definition u0_empty: ∀T:Type[0]. u0_predicate1 T ≝ λT,a. ⊥.
31 definition u0_quantifier: Type[0] → Type[2] ≝ λT. u1_predicate2 (u0_predicate1 T).
33 definition u0_all: ∀T:Type[0]. u0_quantifier T ≝ λT,I,P. ∀a. I a → P a.
35 definition u0_ex: ∀T:Type[0]. u0_quantifier T ≝ λT,I,P. ∃a. I a ∧ P a.
37 definition u0_refl (T:Type[0]) (I:u0_predicate1 T) (P:u0_predicate2 T): Prop ≝
38 u0_all T I (λa. P a a).
40 definition u0_sym (T:Type[0]) (I:u0_predicate1 T) (P:u0_predicate2 T): Prop ≝
41 u0_all T I (λa1. u0_all T I (λa2. P a2 a1 → P a1 a2)).
43 definition u0_trans (T:Type[0]) (I:u0_predicate1 T) (P:u0_predicate2 T): Prop ≝
44 u0_all T I (λa1. u0_all T I (λa. P a1 a → (u0_all T I (λa2. P a a2 → P a1 a2)))).
46 definition u0_conf (T:Type[0]) (I:u0_predicate1 T) (P:u0_predicate2 T): Prop ≝
47 u0_all T I (λa. u0_all T I (λa1. P a a1 → (u0_all T I (λa2. P a a2 → P a1 a2)))).
49 definition u0_div (T:Type[0]) (I:u0_predicate1 T) (P:u0_predicate2 T): Prop ≝
50 u0_all T I (λa1. u0_all T I (λa. P a1 a → (u0_all T I (λa2. P a2 a → P a1 a2)))).
52 definition u0_repl2 (T:Type[0]) (I:u0_predicate1 T) (Q:u0_predicate2 T) (P:u0_predicate2 T): Prop ≝
53 u0_all T I (λa1. u0_all T I (λa2. P a1 a2 → u0_all T I (λb1. u0_all T I (λb2. Q b1 a1 → Q b2 a2 → P b1 b2)))).
55 definition u0_hom1 (T:Type[0]) (I:u0_predicate1 T) (U:Type[0]) (f:T → U) (P:u0_predicate1 T) (Q:u0_predicate1 U) : Prop ≝
56 u0_all T I (λa. P a → Q (f a)).
58 definition u0_hom2 (T:Type[0]) (I:u0_predicate1 T) (U:Type[0]) (f:T → U) (P:u0_predicate2 T) (Q:u0_predicate2 U) : Prop ≝
59 u0_all T I (λa1. u0_all T I (λa2. P a1 a2 → Q (f a1) (f a2))).
61 definition u0_xeq (T:Type[0]) (I:u0_predicate1 T) (U:Type[0]) (Q:u0_predicate2 U): u0_predicate2 (T → U) ≝
62 λf,g. u0_all T I (λa. Q (f a) (g a)).
64 (* Basic properties ***************************************************)
66 lemma u0_refl_repl_sym: ∀T,I,P. u0_refl T I P → u0_repl2 T I P P → u0_sym T I P.
67 normalize /3 width=7 by/ qed-.
69 lemma u0_refl_repl_trans: ∀T,I,P. u0_refl T I P → u0_repl2 T I P P → u0_trans T I P.
70 normalize /3 width=7 by/ qed-.
72 lemma u0_refl_repl_conf: ∀T,I,P. u0_refl T I P → u0_repl2 T I P P → u0_conf T I P.
75 /3 width=1 by (u0_refl_repl_trans T I P), (u0_refl_repl_sym T I P)/
77 #H1 #H2 #a #Ha #a1 #Ha1 #Haa1
78 @(u0_refl_repl_trans T I P) /2 width=7 by/
79 @(u0_refl_repl_sym T I P) /2 width=7 by/
82 lemma u0_refl_repl_div: ∀T,I,P. u0_refl T I P → u0_repl2 T I P P → u0_div T I P.
83 #T #I #P #H1 #H2 #a1 #Ha1 #a #Ha #Ha1a #a2 #Ha2 #Ha2a
84 @(u0_refl_repl_trans T I P … a) /2 width=7 by/
85 @(u0_refl_repl_sym T I P) /2 width=7 by/