Library order



Preorder on theories.

We say that P,A is smaller than Q,B if for every pair e,f of expressions satisfying P we can find a pair e',f' such that :
  • both e' and f' satisfy Q and
  • A e f if and only if B e' f'.
Definition included_th (S1 S2 : TyEq) : Prop :=
  let (P,A) := S1 in
  let (Q,B) := S2 in
   e f, P e P f
               e' f', Q e' Q f'
                             (A e f B e' f').
Infix "<<" := included_th (at level 60).
Definition equiv_th S T := (included_th S T)/\(included_th T S).
Infix "≡≡" := equiv_th (at level 60).

Global Instance included_th_PreOrder : PreOrder included_th.
Instance equiv_th_Equivalence : Equivalence equiv_th.

If the theory (P,A) is smaller than (Q,B), and if the equivalence relation B __ is decidable for elements satifying Q, then the equivalence relation A __ is decidable for elements satifying P.
Lemma included_th_decidable :
   P A Q B,
    (P,A) << (Q,B)
    ( e f, Q e Q f Decidable.decidable (B e f))
     e f, P e P f Decidable.decidable (A e f).

This notion will be instrumental in proving orderings. φ is a transfer morphism between relation P with axioms A to relation Q with axioms B if for every pair e,f related by P, the pair φ e f is related by Q and A e f if and only if B φ e φ f.
Definition transfer_fun (R1 R2 : relation expr × relation expr) φ : Prop :=
  let (P,A):= R1 in
  let (Q,B):= R2 in
     e f, P e f
                Q (φ e) (φ f)
                (A e f B (φ e) (φ f)).
Notation " φ ⊩ R → S " := (transfer_fun R S φ) (at level 50).

We may use this to define a stronger preorder on theories.
Definition is_model (T1 T2 : TyEq) :=
  let (P,A):= T1 in let (Q,B):= T2 in
                     φ, φ (P^2,A) (Q^2,B).
Infix "⊲" := is_model (at level 60).

Existence of such a morphism is a also a preorder.
This preorder is stronger. Indeed it is straightforward to show that if there is a transfer morphism from P^2 with axioms A to Q^2 with axioms B then P,A is smaller than Q,B.

Technical lemmas about transfer morphisms.

Global Instance transfer_fun_proper_str_impl :
  Proper (Basics.flip (@stronger expr) ==> (@eq_rel expr)
                      ==> (@stronger expr) ==> (@eq_rel expr)
                      ==> Logic.eq
                      ==> Basics.impl)
         (fun P A Q Btransfer_fun (P,A) (Q,B)).
Global Instance transfer_fun_proper_eq_impl :
  Proper ((@eq_rel expr) ==> (@eq_rel expr)
                      ==> (@eq_rel expr) ==> (@eq_rel expr)
                      ==> Logic.eq
                      ==> Basics.impl)
         (fun P A Q Btransfer_fun (P,A) (Q,B)).
Global Instance transfer_fun_proper_eq_impl_rev :
  Proper ((@eq_rel expr) ==> (@eq_rel expr)
                      ==> (@eq_rel expr) ==> (@eq_rel expr)
                      ==> Logic.eq
                      ==> Basics.flip Basics.impl)
         (fun P A Q Btransfer_fun (P,A) (Q,B)).
Global Instance transfer_fun_proper_iff :
  Proper ((@eq_rel expr) ==> (@eq_rel expr) ==> (@eq_rel expr) ==>
                        (@eq_rel expr) ==> Logic.eq ==> iff)
         (fun P A Q Btransfer_fun (P,A) (Q,B)).
Global Instance transfer_fun_proper_iff_1 A Q B φ :
  Proper ((@eq_rel expr) ==> Basics.flip Basics.impl)
         (fun Pφ (P,A) (Q,B)).
Global Instance transfer_fun_proper_iff_2 P A B φ :
  Proper ((@eq_rel expr) ==>Basics.flip Basics.impl)
         (fun Qφ (P,A) (Q,B)).
Lemma TTrue_unit_l a A b B φ :
  (φ (a,A) (b,B)) φ (TTruea,A) (b,B).
Lemma TTrue_unit_r a A b B φ :
  (φ (a,A) (b,B)) φ (a,A) (TTrueb,B).
Lemma incl_p_fun (p q : relation expr) φ P A Q B :
  (φ (P,A) (Q,B))
  ( x y, (pP) x y q (φ x) (φ y))
  (φ (pP,A) (qQ,B)).
Lemma incl_p_fun_r (q : relation expr) φ P A Q B :
  (φ (P,A) (Q,B))
  ( x y, P x y q (φ x) (φ y))
  (φ (P,A) (qQ,B)).
Lemma incl_p_fun_l (p : relation expr) φ P A Q B :
  (φ (P,A) (Q,B)) φ (pP,A) (Q,B).
Lemma augm_transfer (p : predicate expr) φ P A Q B :
  (φ (P,A) (Q,B))
  ( x, p x p (φ x))
  (φ (p^2P,A) (p^2Q,B)).
Lemma augm_transfer' (p : predicate expr) φ A B :
  (φ (TTrue,A) (TTrue,B))
  ( x, p x p (φ x))
  (φ (p^2,A) (p^2,B)).
Lemma augm_transfer2 (p : predicate expr) φ P A Q B :
  (φ (P,A) (Q,B))
  ( x, p (φ x))
  (φ (P,A) (p^2Q,B)).

Lemma technical e0 f0 (p q : exprProp) (a b r s : relation expr) φ :
  (φ (r,a) (s,b))
  ( e f, r e f ¬ p e ¬ p f ¬ (a ef))
  ¬ (b e0 f0) q e0 q f0
  ( e f, s e f q ^2 e f (e == f) ¬ (b ef))
  (p,a) << (q,b).
Lemma pos_rev_rm0 {A B a} :
  (rm0 (a,A) (a,B)) rm0 (poa,B) (poa,A).
Lemma str_pos_rev_rm0 {A B a} :
  (rm0 (a,A) (a,B))
  rm0 (spa,B) (spa,A).
Lemma po_to_str_rm0 r a s b :
  (rm0 (r^2,a) (po∧(s^2),b))
  ( e, r e ¬ r e)
  (( e, s e untyped e)
    ( A e f, b e f A e A f))
  ( e f, b e f str_positive e str_positive f)
  ( e f, ¬ (b e f) (str_positives)^2 e f)
  (r,a) << (str_positives,b).

Transfer morphisms.

Lemma NKA_NKA_p : rm0 (nput,NKA) (nput,NKA_p).
Lemma NKA_incl_NKA_p : rm0 (nput,NKA) (po∧(nput),NKA_p).
Lemma NKA_incl_NKA_p_nm :
  rm0 (mlt∧(nput),NKA) (mlt∧(po∧(nput)),NKA_p).
Lemma NKA_incl_NKA_p_ns :
  rm0 (sg∧(nput),NKA) (sg∧(po∧(nput)),NKA_p).

Lemma NKA_p_incl_NKA : rm0 (sp∧(nput),NKA_p) (nput,NKA).
Lemma NKA_p_incl_NKA_nm :
  rm0 (mlt∧(sp∧(nput)),NKA_p) (mlt∧(nput),NKA).
Lemma NKA_p_incl_NKA_ns :
  rm0 (sg∧(sp∧(nput)),NKA_p) (sg∧(nput),NKA).

Lemma NKA_t_NKA_tp : rm0 (npty,NKA_t) (npty,NKA_tp).
Lemma NKA_t_incl_NKA_tp : rm0 (npty,NKA_t) (po∧(npty),NKA_tp).
Lemma NKA_t_incl_NKA_tp_nm :
  rm0 (mlt∧(npty),NKA_t) (mlt∧(po∧(npty)),NKA_tp).
Lemma NKA_t_incl_NKA_tp_ns :
  rm0 (sg∧(npty),NKA_t) (sg∧(po∧(npty)),NKA_tp).

Lemma NKA_tp_incl_NKA_t :
  rm0 (sp∧(npty),NKA_tp) (npty,NKA_t).
Lemma NKA_tp_incl_NKA_tnm :
  rm0 (mlt∧(sp∧(npty)),NKA_tp) (mlt∧(npty),NKA_t).
Lemma NKA_tp_incl_NKA_tns :
  rm0 (sg∧(sp∧(npty)),NKA_tp) (sg∧(npty),NKA_t).

Lemma NKA_θ_NKA_θp : rm0 (ut,NKA_θ) (ut,NKA_θp).
Lemma NKA_θ_incl_NKA_θp : rm0 (ut,NKA_θ) (pout,NKA_θp).
Lemma NKA_θ_incl_NKA_θp_s : rm0 (sgut,NKA_θ) (sg∧(pout),NKA_θp).
Lemma NKA_θ_incl_NKA_θp_m :
  rm0 (mltut,NKA_θ) (mlt∧(pout),NKA_θp).

Lemma NKA_θp_incl_NKA_θ :
  rm0 (sput,NKA_θp) (ut,NKA_θ).
Lemma NKA_θp_incl_NKA_θ_s : rm0 (sg∧(sput),NKA_θp) (sgut,NKA_θ).
Lemma NKA_θp_incl_NKA_θ_m :
  rm0 (mlt∧(sput),NKA_θp) (mltut,NKA_θ).

Lemma NKA_θt_NKA_θtp : rm0 (ty,NKA_θt) (ty,NKA_θtp).

Lemma NKA_θt_incl_NKA_θtp : rm0 (ty,NKA_θt) (poty,NKA_θtp).
Lemma NKA_θt_incl_NKA_θtp_s :
  rm0 (sgty,NKA_θt) (sg∧(poty),NKA_θtp).
Lemma NKA_θt_incl_NKA_θtp_m :
  rm0 (mltty,NKA_θt) (mlt∧(poty),NKA_θtp).

Lemma NKA_θtp_incl_NKA_θt :
  rm0 (spty,NKA_θtp) (ty,NKA_θt).
Lemma NKA_θtp_incl_NKA_θt_s :
  rm0 (sg∧(spty),NKA_θtp) (sgty,NKA_θt).
Lemma NKA_θtp_incl_NKA_θt_m :
  rm0 (mlt∧(spty),NKA_θtp) (mltty,NKA_θt).

Lemma NKA_θp_NKA_θtp_fun :
  typed_vers (Bs ut,NKA_θp) (ty',NKA_θtp).
Lemma NKA_θp_NKA_θtp_precise :
  typed_vers (ut,NKA_θp) (ty,NKA_θtp).
Lemma NKA_θtp_NKA_θp_fun :
  erase (sp ty',NKA_θtp)
  (sp ut,NKA_θp).
Lemma NKA_p_NKA_tp :
  typed_vers (sp∧(npBs ut),NKA_p)
  (sp∧(npty'), NKA_tp).
Lemma NKA_p_NKA_tp_precise :
  typed_vers (sp∧(nput),NKA_p) (sp∧(npty),NKA_tp).
Lemma NKA_tp_NKA_p :
  erase (sp∧(npty'),NKA_tp)
  (sp∧(nput),NKA_p).
Lemma NKA_p_NKA_tp_s:
  typed_vers
     (sg∧(sp (np Bs ut)), NKA_p) (sg∧(sp (np ty')), NKA_tp).
Lemma NKA_θp_NKA_θtp_s:
  typed_vers (sg∧(Bs ut), NKA_θp) (sgty', NKA_θtp).
Lemma NKA_p_NKA_tp_m:
  typed_vers
     (mlt∧(sp∧(npBs ut)),NKA_p) (mlt∧(sp (np ty')), NKA_tp).
Lemma NKA_θp_NKA_θtp_m:
  typed_vers (mlt∧(Bs ut), NKA_θp) (mltty', NKA_θtp).

Lemma NKA_tp_NKA_p_s :
  erase
     (sg (sp (np ty')), NKA_tp) (sg (sp (np ut)),NKA_p).
Lemma NKA_θtp_NKA_θp_s:
  erase (sg (sp ty'), NKA_θtp) (sg (sp ut), NKA_θp).
Lemma NKA_tp_NKA_p_m:
  erase (mlt∧(sp∧(npty')),NKA_tp) (mlt (sp (np ut)), NKA_p).
Lemma NKA_θtp_NKA_θp_m:
  erase (mlt (sp ty'), NKA_θtp) (mlt (sp ut), NKA_θp).

Lemma NKA_θ_NKA_fun :
  rm_perm (apply_perm [])(sput,NKA_θp) (np∧(sput),NKA_p).
Lemma NKA_θt_NKA_t_fun :
  rm_perm (apply_perm [])(spty,NKA_θtp) (np∧(spty),NKA_tp).
Lemma NKA_θ_NKA_s :
  rm_perm (apply_perm [])
          (sg∧(sput),NKA_θp) (sg∧(np∧(sput)),NKA_p).
Lemma NKA_θ_NKA_m :
  rm_perm (apply_perm [])
          (mlt∧(sput),NKA_θp) (mlt∧(np∧(sput)),NKA_p).
Lemma NKA_NKA_θ_fun :
  (fun ee) (np∧(sput),NKA_p)(sput,NKA_θp).
Lemma NKA_t_NKA_θt_fun :
  (fun ee) (np∧(spty),NKA_tp)(spty,NKA_θtp).
Lemma NKA_NKA_θ_s :
  (fun ee) (sg∧(np∧(sput)),NKA_p)(sg∧(sput),NKA_θp).
Lemma NKA_NKA_θ_m :
  (fun ee) (mlt∧(np∧(sput)),NKA_p)(mlt∧(sput),NKA_θp).

Lemma single_multi_ut :
  single_to_multi (sg∧(sput),NKA_θp)
  (mlt∧(sput),NKA_θp).
Lemma single_multi_ty :
  single_to_multi (sg∧(spty),NKA_θtp)
  (mlt∧(spty),NKA_θtp).

Order between theories.

Expressions without explicit permutations.

For untyped and typed expressions, zero may be eliminated.
Typed and untyped expressions are equivalent.

For positive expressions, it is equivalent to have

explicit and applied permutations.

Expression with explicit permutations over atoms.

Zero may be eliminated both in the untyped and typed setting.
Typed and untyped expressions are equivalent.

Expressions over letters (with explicit permutations).

In this theory zero may be eliminated as well.
Typed and untyped versions of the theory are also equivalent.

The theory of expressions over atoms may be encoded in that of expressions over letters.