Theory Quantale_Converse
section ‹Quantales with converse›
theory Quantale_Converse
imports Modal_Quantale Modal_Kleene_Algebra_Converse
begin
subsection ‹Properties of unital quantales›
text ‹These properties should eventually added to the quantales AFP entry.›
lemma (in quantale) bres_bot_top [simp]: "⊥ → ⊤ = ⊤"
by (simp add: local.bres_galois_imp local.order.antisym)
lemma (in quantale) fres_top_bot [simp]: "⊤ ← ⊥ = ⊤"
by (meson local.fres_galois local.order_antisym local.top_greatest)
lemma (in unital_quantale) bres_top_top2 [simp]: "(x → y ⋅ ⊤) ⋅ ⊤ = x → y ⋅ ⊤"
proof-
have "(x → y ⋅ ⊤) ⋅ ⊤ ≤ x → y ⋅ ⊤ ⋅ ⊤"
by (simp add: local.bres_interchange)
hence "(x → y ⋅ ⊤) ⋅ ⊤ ≤ x → y ⋅ ⊤"
by (simp add: mult_assoc)
thus ?thesis
by (metis local.mult_1_right local.order_eq_iff local.psrpq.subdistl local.sup_top_right)
qed
lemma (in unital_quantale) fres_top_top2 [simp]: "⊤ ⋅ (⊤ ⋅ y ← x) = ⊤ ⋅ y ← x"
by (metis local.dual_order.antisym local.fres_interchange local.le_top local.top_greatest mult_assoc)
lemma (in unital_quantale) bres_top_bot [simp]: "⊤ → ⊥ = ⊥"
by (metis local.bot_least local.bres_canc1 local.le_top local.order.antisym)
lemma (in unital_quantale) fres_bot_top [simp]: "⊥ ← ⊤ = ⊥"
by (metis local.bot_unique local.fres_canc1 local.top_le local.uqka.independence2 local.uwqlka.star_ext)
lemma (in unital_quantale) top_bot_iff: "(x ⋅ ⊤ = ⊥) = (x = ⊥)"
by (metis local.fres_bot_top local.fres_canc2 local.le_bot local.mult_botl)
subsection ‹Involutive quantales›
text ‹The following axioms for involutive quantales are standard.›
class involutive_quantale = unital_quantale + invol_op +
assumes inv_invol [simp]: "(x⇧∘)⇧∘ = x"
and inv_contrav: "(x ⋅ y)⇧∘ = y⇧∘ ⋅ x⇧∘"
and inv_sup [simp]: "(⨆X)⇧∘ = (⨆x ∈ X. x⇧∘)"
context involutive_quantale
begin
lemma inv_binsup [simp]: "(x ⊔ y)⇧∘ = x⇧∘ ⊔ y⇧∘"
proof-
have "(x ⊔ y)⇧∘ = (⨆z ∈ {x,y}. z⇧∘)"
using local.inv_sup local.sup_Sup by presburger
also have "… = (⨆z ∈ {x⇧∘,y⇧∘}. z)"
by simp
also have "… = x⇧∘ ⊔ y⇧∘"
by fastforce
finally show ?thesis.
qed
lemma inv_iso: "x ≤ y ⟹ x⇧∘ ≤ y⇧∘"
by (metis inv_binsup local.sup.absorb_iff1)
lemma inv_galois: "(x⇧∘ ≤ y) = (x ≤ y⇧∘)"
using local.inv_iso by fastforce
lemma bres_fres_conv: "(y⇧∘ ← x⇧∘)⇧∘ = x → y"
proof-
have "(y⇧∘ ← x⇧∘)⇧∘ = (⨆{z. z ⋅ x⇧∘ ≤ y⇧∘})⇧∘"
by (simp add: local.fres_def)
also have "… = ⨆{z⇧∘ |z. z ⋅ x⇧∘ ≤ y⇧∘}"
by (simp add: image_Collect)
also have "… = ⨆{z. z⇧∘ ⋅ x⇧∘ ≤ y⇧∘}"
by (metis local.inv_invol)
also have "… = ⨆{z. (x ⋅ z)⇧∘ ≤ y⇧∘}"
by (simp add: local.inv_contrav)
also have "… = ⨆{z. x ⋅ z ≤ y}"
by (metis local.inv_invol local.inv_iso)
also have "… = x → y"
by (simp add: local.bres_def)
finally show ?thesis.
qed
lemma fres_bres_conv: "(y⇧∘ → x⇧∘)⇧∘ = x ← y"
by (metis bres_fres_conv local.inv_invol)
sublocale invqka: involutive_kleene_algebra "(⊔)" "(⋅)" 1 ⊥ "(≤)" "(<)" qstar invol
by unfold_locales (simp_all add: local.inv_contrav)
lemma inv_binf [simp]: "(x ⊓ y)⇧∘ = x⇧∘ ⊓ y⇧∘"
proof-
{fix z
have "(z ≤ (x ⊓ y)⇧∘) = (z⇧∘ ≤ x ⊓ y)"
using invqka.inv_adj by blast
also have "… = (z⇧∘ ≤ x ∧ z⇧∘ ≤ y)"
by simp
also have "… = (z ≤ x⇧∘ ∧ z ≤ y⇧∘)"
by (simp add: invqka.inv_adj)
also have "… = (z ≤ x⇧∘ ⊓ y⇧∘)"
by simp
finally have "(z ≤ (x ⊓ y)⇧∘) = (z ≤ x⇧∘ ⊓ y⇧∘)".}
thus ?thesis
using local.dual_order.antisym by blast
qed
lemma inv_inf [simp]: "(⨅X)⇧∘ = (⨅x ∈ X. x⇧∘)"
by (metis invqka.inv_adj local.INF_eqI local.Inf_greatest local.Inf_lower local.inv_invol)
lemma inv_top [simp]: "⊤⇧∘ = ⊤"
proof-
have a: "⊤⇧∘ ≤ ⊤"
by simp
hence "(⊤⇧∘)⇧∘ ≤ ⊤⇧∘"
using local.inv_iso by blast
hence "⊤ ≤ ⊤⇧∘"
by simp
thus ?thesis
by (simp add: local.top_le)
qed
lemma inv_qstar_aux [simp]: "(x ^ i)⇧∘ = (x⇧∘) ^ i"
by (induct i, simp_all add: local.power_commutes)
lemma inv_conjugate: "(x⇧∘ ⊓ y = ⊥) = (x ⊓ y⇧∘ = ⊥)"
using inv_binf invqka.inv_zero by fastforce
text ‹We define domain and codomain as in relation algebra and compare with the domain
and codomain axioms above.›
definition do :: "'a ⇒ 'a" where
"do x = 1 ⊓ (x ⋅ x⇧∘)"
definition cd :: "'a ⇒ 'a" where
"cd x = 1 ⊓ (x⇧∘ ⋅ x)"
lemma do_inv: "do (x⇧∘) = cd x"
proof-
have "do (x⇧∘) = 1 ⊓ (x⇧∘ ⋅ (x⇧∘)⇧∘)"
by (simp add: do_def)
also have "… = 1 ⊓ (x⇧∘ ⋅ x)"
by simp
also have "… = cd x"
by (simp add: cd_def)
finally show ?thesis.
qed
lemma cd_inv: "cd (x⇧∘) = do x"
by (simp add: cd_def do_def)
lemma do_le_top: "do x ≤ 1 ⊓ (x ⋅ ⊤)"
by (simp add: do_def local.inf.coboundedI2 local.mult_isol)
lemma do_subid: "do x ≤ 1"
by (simp add: do_def)
lemma cd_subid: "cd x ≤ 1"
by (simp add: cd_def)
lemma do_bot [simp]: "do ⊥ = ⊥"
by (simp add: do_def)
lemma cd_bot [simp]: "cd ⊥ = ⊥"
by (simp add: cd_def)
lemma do_iso: "x ≤ y ⟹ do x ≤ do y"
by (simp add: do_def local.inf.coboundedI2 local.inv_iso local.psrpq.mult_isol_var)
lemma cd_iso: "x ≤ y ⟹ cd x ≤ cd y"
using cd_def local.eq_refl local.inf_mono local.inv_iso local.psrpq.mult_isol_var by presburger
lemma do_subdist: "do x ⊔ do y ≤ do (x ⊔ y)"
proof-
have "do x ≤ do (x ⊔ y)" and "do y ≤ do (x ⊔ y)"
by (simp_all add: do_iso)
thus ?thesis
by simp
qed
lemma cd_subdist: "cd x ⊔ cd y ≤ cd (x ⊔ y)"
by (simp add: cd_iso)
lemma inv_do [simp]: "(do x)⇧∘ = do x"
by (simp add: do_def)
lemma inv_cd [simp]: "(cd x)⇧∘ = cd x"
by (metis do_inv inv_do)
lemma dedekind_modular:
assumes "(x ⋅ y) ⊓ z ≤ (x ⊓ (z ⋅ y⇧∘)) ⋅ (y ⊓ (x⇧∘ ⋅ z))"
shows "(x ⋅ y) ⊓ z ≤ (x ⊓ (z ⋅ y⇧∘)) ⋅ y"
using assms local.inf.cobounded1 local.mult_isol local.order_trans by blast
lemma modular_eq1:
assumes "∀x y z w. (y ⊓ (z ⋅ x⇧∘) ≤ w ⟶ (y ⋅ x) ⊓ z ≤ w ⋅ x)"
shows "∀x y z. (x ⋅ y) ⊓ z ≤ (x ⊓ (z ⋅ y⇧∘)) ⋅ y"
using assms by blast
lemma "do x ⋅ do y = do x ⊓ do y"
oops
lemma "p ≤ 1 ⟹ q ≤ 1 ⟹ p ⋅ q = p ⊓ q"
oops
end