Library proofs



Reserved Notation "e =* f" (at level 80).

Kleene algebra axioms with no constants.
Inductive ka_eq : relation expr :=
| ka_tt e f g : (e · (f · g)) =* ((e · f) · g)

| ka_pp e f g : (e + (f + g)) =* ((e + f) + g)
| ka_pc e f : (e + f) =* (f + e)
| ka_pi e : (e + e) =* e
                    
| ka_pt e f g : (e · (f + g)) =* ((e · f) + (e · g))
| ka_tp e f g : ((e + f) · g) =* ((e · g) + (f · g))

where "e =* f" := (ka_eq e f).
Kleene algebra entailments.
Inductive ka_impl : expr relation expr :=
| ka_s3 e f g : ka_impl (f + e·g) (e^*·f) g
| ka_s4 e f g : ka_impl (f + g·e) (f·e^* ) g.

Kleene algebra axioms for untyped constants.
Inductive ka_eq_u : relation expr :=
| kau_t1 e : ka_eq_u (e · 1) e
| kau_1t e : ka_eq_u (1 · e) e
| kau_s1 e : ka_eq_u (1 + e · (e^*) + e ^*) (e^*)
| kau_s2 e : ka_eq_u (1 + (e^*) · e + e^*) (e^*).
Kleene algebra axioms for typed constants.
Inductive ka_eq_t : relation expr :=
| kat_t1 e A : A e ka_eq_t (e · id A) e
| kat_1t e A : A e ka_eq_t (id A · e) e
| kat_s1 e A : A e ka_eq_t (id A + e · (e^*) + e ^*) (e^*)
| kat_s2 e A : A e ka_eq_t (id A + (e^*) · e + e^*) (e^*).


Reserved Notation " ax ⊢ e ≡ f" (at level 80).
Reserved Notation " ax ⊢ e ≤ f" (at level 80).

Inductive eq (ax : relation expr) : relation expr :=
Structural rules
| eq_sym e f : (ax e f) ax f e
| eq_trans e f g : ax e f ax f g ax e g

Congruence
| eq_zero : ax 0 0
| eq_un : ax 1 1
| eq_bot A B : A B ax ( A) ( B)
| eq_id A B : A B ax (id A) (id B)
| eq_var x y : x y ax (var x) (var y)
| eq_vat a : ax (vat a) (vat a)
| eq_plus e f g h : ax e f ax g h ax (e+g) (f+h)
| eq_times e f g h : ax e f ax g h ax (e·g) (f·h)
| eq_star e f : ax e f ax (e^* ) (f^* )
| eq_ν a e f: ax e f ax (ν a e) (ν a f)
| eq_θ p q e f: pq ax e f ax ( p e) ( q f)
| eq_ω a e f: ax e f ax (ω a e) (ω a f)

Kleene algebra without constants
| eq_ka e f : e =* f ax e f
| eq_ka_impl e f g : ax e g ka_impl e f g ax f g
                     
Additionnal axioms
| eq_ax e f : ax e f ax e f
where " ax ⊢ e ≡ f " := (eq ax e f)
and " ax ⊢ e ≤ f " := (eq ax (e+f) f).
For any axiomatic system the eq relation is reflexive.
Lemma eq_refl ax e : ax e e.
For any axiomatic system the eq relation an equivalence relation.
Instance eq_Equiv ax : Equivalence (eq ax).
Lemma eq_expr_eq ax e f : (e == f) ax e f.

Global Instance stronger_ax_proof :
  Proper ((@stronger expr) ==> inclusion expr) eq.
Lemma stronger_ax_eq a b : a b a eq b.
Lemma stronger_eq_or_rel_l :
   A B, inclusion expr (eq A) (eq (AB)).
Lemma stronger_eq_or_rel_r :
   A B, inclusion expr (eq B) (eq (AB)).

Goal ( A B C e f, ABC e f A∨(BC) e f).

For any axiomatic system all operators are morphisms with respect to eq.
Global Instance ν_eq ax a :
  Proper (eq ax ==> eq ax) (ν a).
Global Instance ω_eq ax a :
  Proper (eq ax ==> eq ax) (ω a).
Global Instance plus_eq ax :
  Proper (eq ax ==> eq ax ==> eq ax) plus.
Global Instance times_eq ax :
  Proper (eq ax ==> eq ax ==> eq ax) times.
Global Instance θ_eq ax :
  Proper (equiv_perm ==> eq ax ==> eq ax) θ.
Global Instance star_eq ax:
  Proper (eq ax ==> eq ax) star.
Global Instance bot_equiv_lst_eq ax:
  Proper (equiv_lst ==> eq ax) bot.
Global Instance id_equiv_lst_eq ax:
  Proper (equiv_lst ==> eq ax) id.

Notation inf ax := (fun x yax x y).
The relation ≤ is antisymmetric with respect to ≡.
Instance inf_antisym ax : Antisymmetric expr (eq ax) (inf ax).

Kleene algebra axioms for 0.
Kleene algebra axioms for ⊥.
Inductive zero_ka_t : relation expr :=
| zero_t_p0 e A : A e zero_ka_t (e + A) e
| zero_t_t0 e A : A e zero_ka_t (e · A) ( A)
| zero_t_0t e A : A e zero_ka_t ( A · e) ( A).

Inductive zero_perm_u : relation expr :=
| eq_θ_0 p : zero_perm_u ( p 0) 0.

Inductive zero_perm_t : relation expr :=
| eq_θ_bot A B p : (B p A) zero_perm_t ( p ›( A)) ( B).
Inductive zero_nom_u : relation expr :=
| equ_ν0 a : zero_nom_u (ν a 0) 0.
derivable from eq_nom_untyped, because a#0
Permutations.
Distributivity laws of ν,ω.
Inductive eq_ν_smpl : relation expr :=
| eq_νp a e f : eq_ν_smpl (ν a (e+f)) (ν a e + ν a f)
| eq_νab a b e : eq_ν_smpl (ν a (ν b e)) (ν b (ν a e)).
Inductive eq_ω_smpl : relation expr :=
| eq_ω_id a A : ~(In a A) eq_ω_smpl (ω a (id A)) (id (a::A))
| eq_ω_p e f a : eq_ω_smpl (ω a (e + f)) (ω a e + ω a f)
| eq_ω_t e f a : eq_ω_smpl (ω a (e · f)) (ω a e · ω a f)
| eq_ω_s e a : eq_ω_smpl (ω a (e^*)) ((ω a e)^*)
| eq_ωω e a b : eq_ω_smpl (ω a (ω b e)) (ω b (ω a e)).


Untyped nominal axioms.
Inductive eq_nom_untyped_p : relation expr :=
| equ_θν' a b e :
    a # e eq_nom_untyped_p (ν b e) (ν a ( [a,b]e )).
Inductive eq_nom_untyped_np : relation expr :=
| equ_θν a b e :
    a # e eq_nom_untyped_np (ν b e) (ν a ( [a,b]e )).

Inductive eq_nom_untyped : relation expr :=
| equ_νω1 a e :
    a # e eq_nom_untyped (ν a e) e
| equ_ν3 a e f :
    a # e eq_nom_untyped ((ν a f) · e) (ν a (f · e))
| equ_ν4 a e f :
    a # e eq_nom_untyped (e · (ν a f)) (ν a (e · f)).

Typed nominal axioms.
Inductive eq_nom_typed_p : relation expr :=
| eqt_θν' A a b e : A ν a e ¬ In b A
                    eq_nom_typed_p (ν a e) (ν b ([b,a]e)).
Inductive eq_nom_typed_np : relation expr :=
| eqt_θν A a b e : A ν a e ¬ In b A
                    eq_nom_typed_np (ν a e) (ν b ([b,a]e)).
Inductive eq_nom_typed : relation expr :=


| eqt_νω1 A a e :
    A ν a (ω a e)
    eq_nom_typed (ν a (ω a e)) e
| eqt_νω2 e a b :
    a b eq_nom_typed (ν a (ω b e)) (ω b (ν a e))
| eqt_ν3 a e f :
    eq_nom_typed ((ν a f) · e) (ν a (f · ω a e))
| eqt_ν4 a e f :
    eq_nom_typed (e · (ν a f)) (ν a ((ω a e) · f)).

Lemma eqt_ν1 A a :
  In a A
  eq_nom_typed eq_ω_smpl (ν a (id A)) (id (rm a A)).

Lemma stronger_Ty_zero_ka_t : zero_ka_t ty' zero_ka_t.
Lemma stronger_Ty_ka_eq_t : ka_eq_t ty' ka_eq_t.

Lemma one_star_is_one_u : ka_eq_u 1^* 1.
Lemma one_star_is_one_t A: ka_eq_t (id A)^* (id A).

Lemma zero_nom_u_derivable : zero_nom_u eq_nom_untyped.

Lemma derivable_axioms (ax1 ax2 : relation expr) :
  ( e f, ax1 e f ax2 e f)
  ( e f, (ax1ax2) e f ax2 e f).

Type preservation.
Lemma eq_nom_typed_np_type A :
    Proper (eq_nom_typed_np ==> iff) (has_type A).
Lemma eq_nom_typed_p_type A :
    Proper (eq_nom_typed_p ==> iff) (has_type A).

Lemma eq_nom_typed_type A :
    Proper (eq_nom_typed ==> iff) (has_type A).
Lemma eq_perm_elim_type A :
    Proper (eq_perm_elim ==> iff) (has_type A).
Lemma eq_perm_type A :
    Proper (eq_perm ==> iff) (has_type A).
Lemma eq_perm_ω_type A :
    Proper (eq_perm_ω ==> iff) (has_type A).
Lemma eq_ν_smpl_type A :
  Proper (eq_ν_smpl ==> iff) (has_type A).
Lemma eq_ω_smpl_type A :
  Proper (eq_ω_smpl ==> iff) (has_type A).
Lemma zero_ka_t_type A :
  Proper (zero_ka_t ==> iff) (has_type A).

Lemma ka_eq_t_type A :
  Proper (ka_eq_t ==> iff) ( has_type A).
Lemma ka_eq_type A :
  Proper (ka_eq ==> iff) ( has_type A).

Lemma zero_perm_t_type A :
  Proper (zero_perm_t ==> iff) ( has_type A).

Lemma zero_nom_t_type A :
  Proper (zero_nom_t ==> iff) ( has_type A).

Lemma eq_type ax:
  ( A, Proper (ax ==> iff) ( has_type A))
   A, Proper (eq ax ==> iff) ( has_type A).

Lemma eq_nom_untyped_untyped :
  Proper (eq_nom_untyped ==> iff) untyped.

Lemma eq_nom_untyped_np_untyped :
  Proper (eq_nom_untyped_np ==> iff) untyped.
Lemma eq_nom_untyped_p_untyped :
  Proper (eq_nom_untyped_p ==> iff) untyped.
Lemma eq_perm_elim_untyped : Proper (eq_perm_elim ==> iff) untyped.
Lemma eq_perm_untyped : Proper (eq_perm ==> iff) untyped.
Lemma eq_perm_ω_untyped : Proper (eq_perm_ω ==> iff) untyped.
Lemma eq_ν_smpl_untyped : Proper (eq_ν_smpl ==> iff) untyped.
Lemma eq_ω_smpl_untyped : Proper (eq_ω_smpl ==> iff) untyped.
Lemma zero_ka_u_untyped : Proper (zero_ka_u ==> iff) untyped.
Lemma ka_eq_u_untyped : Proper (ka_eq_u ==> iff) untyped.
Lemma ka_eq_untyped : Proper (ka_eq ==> iff) untyped.
Lemma zero_perm_u_untyped : Proper (zero_perm_u ==> iff) untyped.
Lemma zero_nom_u_untyped : Proper (zero_nom_u ==> iff) untyped.
Lemma eq_untyped ax :
  (Proper (ax ==> iff) untyped)
  Proper (eq ax ==> iff) untyped.

Lemma proper_eq : (ax1 ax2 : relation expr) φ,
    Proper (ax1 ==> ax2) φ
    Proper (ax1 ==> eq ax2) φ.

Lemma remain_Ty ax :
  ( A, Proper (ax ==> iff) ( has_type A))
   e f A, A e ax e f ty' ax e f.

Lemma remain_Ut ax :
  (Proper (ax ==> iff) untyped)
   e f, untyped e ax e f ut ax e f.

Lemma eq_nom_typed_single : Proper (eq_nom_typed ==> iff) single.
Lemma eq_nom_typed_np_single : Proper (eq_nom_typed_np ==> iff) single.
Lemma eq_nom_typed_p_single : Proper (eq_nom_typed_p ==> iff) single.
Lemma eq_nom_untyped_single : Proper (eq_nom_untyped ==> iff) single.
Lemma eq_nom_untyped_np_single :
  Proper (eq_nom_untyped_np ==> iff) single.
Lemma eq_nom_untyped_p_single :
  Proper (eq_nom_untyped_p ==> iff) single.
Lemma eq_ω_smpl_single : Proper (eq_ω_smpl ==> iff) single.
Lemma eq_ν_smpl_single : Proper (eq_ν_smpl ==> iff) single.
Lemma eq_perm_elim_single : Proper (eq_perm_elim ==> iff) single.
Lemma eq_perm_ω_single : Proper (eq_perm_ω ==> iff) single.
Lemma eq_perm_single : Proper (eq_perm ==> iff) single.
Lemma zero_nom_t_single : Proper (zero_nom_t ==> iff) single.
Lemma zero_nom_u_single : Proper (zero_nom_u ==> iff) single.
Lemma zero_perm_t_single : Proper (zero_perm_t ==> iff) single.
Lemma zero_perm_u_single : Proper (zero_perm_u ==> iff) single.
Lemma ka_eq_t_single : Proper (ka_eq_t ==> iff) single.
Lemma ka_eq_u_single : Proper (ka_eq_u ==> iff) single.
Lemma ka_eq_single : Proper (ka_eq ==> iff) single.

Lemma eq_single ax :
  (Proper (ax ==> iff) single)
  (Proper (eq ax ==> iff) single).

Lemma remain_Sg ax :
  (Proper (ax ==> iff) single)
   e f, single e ax e f sg ax e f.

Lemma eq_nom_typed_multi : Proper (eq_nom_typed ==> iff) multi.
Lemma eq_nom_typed_np_multi : Proper (eq_nom_typed_np ==> iff) multi.
Lemma eq_nom_typed_p_multi : Proper (eq_nom_typed_p ==> iff) multi.
Lemma eq_nom_untyped_multi : Proper (eq_nom_untyped ==> iff) multi.
Lemma eq_nom_untyped_np_multi :
  Proper (eq_nom_untyped_np ==> iff) multi.
Lemma eq_nom_untyped_p_multi :
  Proper (eq_nom_untyped_p ==> iff) multi.
Lemma eq_ω_smpl_multi : Proper (eq_ω_smpl ==> iff) multi.
Lemma eq_ν_smpl_multi : Proper (eq_ν_smpl ==> iff) multi.
Lemma eq_perm_elim_multi : Proper (eq_perm_elim ==> iff) multi.
Lemma eq_perm_ω_multi : Proper (eq_perm_ω ==> iff) multi.
Lemma eq_perm_multi : Proper (eq_perm ==> iff) multi.
Lemma zero_nom_t_multi : Proper (zero_nom_t ==> iff) multi.
Lemma zero_nom_u_multi : Proper (zero_nom_u ==> iff) multi.
Lemma zero_perm_t_multi : Proper (zero_perm_t ==> iff) multi.
Lemma zero_perm_u_multi : Proper (zero_perm_u ==> iff) multi.
Lemma ka_eq_t_multi : Proper (ka_eq_t ==> iff) multi.
Lemma ka_eq_u_multi : Proper (ka_eq_u ==> iff) multi.
Lemma ka_eq_multi : Proper (ka_eq ==> iff) multi.

Lemma eq_multi ax :
  (Proper (ax ==> iff) multi)
  (Proper (eq ax ==> iff) multi).

Lemma remain_Mlt ax :
  (Proper (ax ==> iff) multi)
   e f, multi e ax e f mlt ax e f.

Lemma eq_nom_typed_no_perm : Proper (eq_nom_typed ==> iff) no_perm.
Lemma eq_nom_untyped_no_perm : Proper (eq_nom_untyped ==> iff) no_perm.
Lemma eq_nom_typed_np_no_perm :
  Proper (eq_nom_typed_np ==> iff) no_perm.
Lemma eq_nom_untyped_np_no_perm :
  Proper (eq_nom_untyped_np ==> iff) no_perm.
Lemma eq_ω_smpl_no_perm : Proper (eq_ω_smpl ==> iff) no_perm.
Lemma eq_ν_smpl_no_perm : Proper (eq_ν_smpl ==> iff) no_perm.
Lemma eq_perm_ω_no_perm : Proper (eq_perm_ω ==> iff) no_perm.
Lemma eq_perm_no_perm : Proper (eq_perm ==> iff) no_perm.
Lemma zero_nom_t_no_perm : Proper (zero_nom_t ==> iff) no_perm.
Lemma zero_nom_u_no_perm : Proper (zero_nom_u ==> iff) no_perm.
Lemma ka_eq_t_no_perm : Proper (ka_eq_t ==> iff) no_perm.
Lemma ka_eq_u_no_perm : Proper (ka_eq_u ==> iff) no_perm.
Lemma ka_eq_no_perm : Proper (ka_eq ==> iff) no_perm.

Lemma eq_no_perm ax :
  (Proper (ax ==> iff) no_perm)
  (Proper (eq ax ==> iff) no_perm).
Lemma remain_Np ax :
  (Proper (ax ==> iff) no_perm)
   e f, no_perm e ax e f np ax e f.

Lemma eq_nom_typed_str_positive : Proper (eq_nom_typed ==> iff) str_positive.
Lemma eq_nom_untyped_str_positive : Proper (eq_nom_untyped ==> iff) str_positive.
Lemma eq_nom_typed_np_str_positive :
  Proper (eq_nom_typed_np ==> iff) str_positive.
Lemma eq_nom_untyped_np_str_positive :
  Proper (eq_nom_untyped_np ==> iff) str_positive.
Lemma eq_ω_smpl_str_positive : Proper (eq_ω_smpl ==> iff) str_positive.
Lemma eq_ν_smpl_str_positive : Proper (eq_ν_smpl ==> iff) str_positive.
Lemma eq_perm_ω_str_positive : Proper (eq_perm_ω ==> iff) str_positive.
Lemma eq_perm_str_positive : Proper (eq_perm ==> iff) str_positive.
Lemma zero_nom_t_str_positive : Proper (zero_nom_t ==> iff) str_positive.
Lemma zero_nom_u_str_positive : Proper (zero_nom_u ==> iff) str_positive.
Lemma ka_eq_t_str_positive : Proper (ka_eq_t ==> iff) str_positive.
Lemma ka_eq_u_str_positive : Proper (ka_eq_u ==> iff) str_positive.
Lemma ka_eq_str_positive : Proper (ka_eq ==> iff) str_positive.

Lemma eq_str_positive ax :
  (Proper (ax ==> iff) str_positive)
  (Proper (eq ax ==> iff) str_positive).

Lemma remain_Sp ax :
  (Proper (ax ==> iff) str_positive)
   e f, str_positive e ax e f po ax e f.

Lemma zero_star_is_one_u : (zero_ka_u ka_eq_u) 0^* 1.
Lemma zero_star_is_one_t A : zero_ka_t ka_eq_t ( A)^* (id A).