theory Quantales imports "Order_Lattice_Props.Closure_Operators"
Kleene_Algebra.Dioid begin
subsection‹Families of Proto-Quantales›
text‹Proto-Quanales are complete lattices equipped with an operation of composition or multiplication
need not be associative. The notation in this component differs from Rosenthal's cite‹"Rosenthal90"›, but is consistent with the one we use
semirings and Kleene algebras.›
class proto_near_quantale = complete_lattice + times + assumes Sup_distr: "⊔X ⋅ y = (⊔x ∈ X. x ⋅ y)"
lemma Sup_pres_multr: "Sup_pres (λ(z::'a::proto_near_quantale). z ⋅ y)" unfolding fun_eq_iff comp_def Sup_distr by simp
lemma sup_pres_multr: "sup_pres (λ(z::'a::proto_near_quantale). z ⋅ y)" using Sup_pres_multr Sup_sup_pres by fastforce
lemma bot_pres_multr: "bot_pres (λ(z::'a::proto_near_quantale). z ⋅ y)" by (metis SUP_empty Sup_distr Sup_empty)
context proto_near_quantale begin
lemma mult_botl [simp]: "⊥⋅ x = ⊥" proof - have"⊥⋅ x = (⊔a∈{}. a ⋅ x)" using Sup_distr Sup_empty by blast thus ?thesis by simp qed
lemma mult_isor: "x ≤ y ==> x ⋅ z ≤ y ⋅ z" by (metis sup.absorb_iff1 sup_distr)
text‹Left and right residuals can be defined in every proto-nearquantale.›
definition bres :: "'a ==> 'a ==> 'a" (infixr‹→›60) where "x → z = ⊔{y. x ⋅ y ≤ z}"
definition fres :: "'a ==> 'a ==> 'a" (infixl‹←›60) where "z ← y = ⊔{x. x ⋅ y ≤ z}"
text‹The left one is a right adjoint to composition. For the right one, additional assumptions are needed›
lemma bres_galois_imp: "x ⋅ y ≤ z ==> y ≤ x → z" by (simp add: Sup_upper bres_def)
lemma fres_galois: "(x ⋅ y ≤ z) = (x ≤ z ← y)" proof show"x ⋅ y ≤ z ==> x ≤ z ← y" by (simp add: Sup_upper fres_def) next assume"x ≤ z ← y" hence"x ⋅ y ≤⊔{x. x ⋅ y ≤ z} ⋅ y" by (simp add: fres_def mult_isor) alsohave"... = ⊔{x ⋅ y |x. x ⋅ y ≤ z}" by (simp add: Sup_distr setcompr_eq_image) alsohave"... ≤ z" by (rule Sup_least, auto) finallyshow"x ⋅ y ≤ z" . qed
end
lemma fres_adj: "(λ(x::'a::proto_near_quantale). x ⋅ y) ⊣ (λx. x ← y)" by (simp add: adj_def fres_galois)
context proto_near_quantale begin
lemma fres_canc1: "(y ← x) ⋅ x ≤ y" by (simp add: fres_galois)
lemma fres_canc2: "y ≤ (y ⋅ x) ← x" using fres_galois by force
lemma inf_fres: "y ⋅ x = ⊓{z. y ≤ z ← x}" by (metis (mono_tags, lifting) fres_canc2 Inf_eqI fres_galois mem_Collect_eq)
lemma bres_iso: "x ≤ y ==> z → x ≤ z → y" using Sup_le_iff bres_def bres_galois_imp by force
lemma bres_anti: "x ≤ y ==> y → z ≤ x → z" by (smt Sup_le_iff bres_def bres_galois_imp fres_galois order_trans mem_Collect_eq)
lemma fres_iso: "x ≤ y ==> x ← z ≤ y ← z" using fres_galois dual_order.trans by blast
lemma mult_isol: "x ≤ y ==> z ⋅ x ≤ z ⋅ y" by (metis le_iff_sup le_sup_iff sup_subdistl)
lemma fres_anti: "x ≤ y ==> z ← y ≤ z ← x" using dual_order.trans fres_galois mult_isol by blast
end
class weak_proto_quantale = proto_near_quantale + assumes weak_Sup_distl: "Y ≠ {} ==> x ⋅⊔Y = (⊔y ∈ Y. x ⋅ y)"
begin
subclass proto_pre_quantale proof unfold_locales have a: "∧x Y. Y = {} ==> (⊔y ∈ Y. x ⋅ y) ≤ x ⋅⊔Y" by simp have b: "∧x Y. Y ≠ {} ==> (⊔y ∈ Y. x ⋅ y) ≤ x ⋅⊔Y" by (simp add: weak_Sup_distl) show"∧x Y. (⊔y ∈ Y. x ⋅ y) ≤ x ⋅⊔Y" using a b by blast qed
text‹Now there is also an adjunction for the other residual.›
lemma bres_galois: "x ⋅ y ≤ z ⟷ y ≤ x → z" proof show"x ⋅ y ≤ z ==> y ≤ x → z" by (simp add: Sup_upper bres_def) next assume"y ≤ x → z" hence"x ⋅ y ≤ x ⋅⊔{y. x ⋅ y ≤ z}" by (simp add: bres_def mult_isol) alsohave"... = ⊔{x ⋅ y |y. x ⋅ y ≤ z}" by (simp add: Sup_distl setcompr_eq_image) alsohave"... ≤ z" by (rule Sup_least, safe) finallyshow"x ⋅ y ≤ z" . qed
end
lemma bres_adj: "(λ(y::'a::proto_quantale). x ⋅ y) ⊣ (λy. x → y)" by (simp add: adj_def bres_galois)
text‹In this setting, residuation is classical implication.›
lemma cba_bres1: "x ⊓ y ≤ z ⟷ x ≤ cba_quantale.bres y z" using cba_quantale.bres_galois inf.commute by fastforce
lemma cba_bres2: "x ≤ -y ⊔ z ⟷ x ≤ cba_quantale.bres y z" using cba_bres1 shunt1 by auto
lemma cba_bres_prop: "cba_quantale.bres x y = -x ⊔ y" using cba_bres2 order.eq_iff by blast
end
subsection‹Quantales Based on Sup-Lattices and Inf-Lattices›
text‹These classes are defined for convenience in instantiation and interpretation proofs, or likewise.
are useful, e.g., in the context of predicate transformers, where only one of Sup or Inf may be well behaved.›
class Sup_quantale = Sup_lattice + semigroup_mult + assumes Supq_distr: "⊔X ⋅ y = (⊔x ∈ X. x ⋅ y)" and Supq_distl: "x ⋅⊔Y = (⊔y ∈ Y. x ⋅ y)"
class unital_Sup_quantale = Sup_quantale + monoid_mult
class Inf_quantale = Inf_lattice + monoid_mult + assumes Supq_distr: "⊓X ⋅ y = (⊓x ∈ X. x ⋅ y)" and Supq_distl: "x ⋅⊓Y = (⊓y ∈ Y. x ⋅ y)"
class unital_Inf_quantale = Inf_quantale + monoid_mult
lemma quantale_homset_iff: "f ∈ quantale_homset = (comp_pres f ∧ Sup_pres f)" unfolding quantale_homset_def by clarsimp
definition unital_quantale_homset :: "('a::unital_quantale ==> 'b::unital_quantale) set"where "unital_quantale_homset = {f. comp_pres f ∧ Sup_pres f ∧ un_pres f}"
lemma unital_quantale_homset_iff: "f ∈ unital_quantale_homset = (comp_pres f ∧ Sup_pres f ∧ un_pres f)" unfolding unital_quantale_homset_def by clarsimp
text‹Though Infs can be defined from Sups in any quantale, quantale morphisms do not generally preserve Infs.
different kind of morphism is needed if this is to be guaranteed.›
text‹Of course Sups are preserved by quantale-morphisms, hence they are the same in subsets as in the original set.
in the subset, however, exist, since they subset forms a quantale in which Infs can be defined, but these are generally
from the Infs in the superstructure.
fact is hidden in Isabelle's definition of complete lattices, where Infs are axiomatised. There is no easy way in general to
that images of quantale morphisms form quantales, though the statement for Sup-quantales is straightforward. I show this for quantic nuclei
left-sided elements.›
typedef (overloaded) ('a,'b) quantale_homset = "quantale_homset::('a::quantale ==> 'b::quantale) set" proof- have a: "comp_pres (λx::'a::quantale. bot::'b)" by simp have b: "Sup_pres (λx::'a::quantale. bot::'b)" unfolding fun_eq_iff comp_def by simp hence"(λx::'a::quantale. bot::'b) ∈ quantale_homset" by (simp add: quantale_homset_iff) thus ?thesis by auto qed
setup_lifting type_definition_quantale_homset
text‹Interestingly, the following type is not (gobally) inhabited.›
lemma quantale_hom_radj: fixes f :: "'a::quantale_with_dual ==> 'b::quantale_with_dual" shows"f ∈ quantale_homset ==> f ⊣ radj f" unfolding quantale_homset_iff by (simp add: Sup_pres_ladj_aux)
lemma quantale_hom_prop1: fixes f :: "'a::quantale_with_dual ==> 'b::quantale_with_dual" shows"f ∈ quantale_homset ==> radj f (f x → y) = x → radj f y" proof- assume h: "f ∈ quantale_homset" have"f x ⋅ f (radj f (f x → y)) ≤ y" by (meson h adj_def bres_galois order_refl quantale_hom_radj) hence"f (x ⋅ radj f (f x → y)) ≤ y" by (metis h quantale_homset_iff) hence"x ⋅ radj f (f x → y) ≤ radj f y" using adj_def h quantale_hom_radj by blast hence le: "radj f (f x → y) ≤ x → radj f y" by (simp add: bres_galois) have"x ⋅ (x → radj f y) ≤ radj f y" by (simp add: bres_canc1) hence"f (x ⋅ (x → radj f y)) ≤ y" using adj_def h quantale_hom_radj by blast hence"f x ⋅ f (x → radj f y) ≤ y" by (metis h quantale_homset_iff) hence"f (x → radj f y) ≤ f x → y" by (simp add: bres_galois) hence"x → radj f y ≤ radj f (f x → y)" using adj_def h quantale_hom_radj by blast thus ?thesis by (simp add: dual_order.antisym le) qed
lemma quantale_hom_prop2: fixes f :: "'a::quantale_with_dual ==> 'b::quantale_with_dual" shows"f ∈ quantale_homset ==> radj f (y ← f x) = radj f y ← x" proof- assume h: "f ∈ quantale_homset" have"f (radj f (y ← f x)) ⋅ f x ≤ y" by (meson adj_def fres_galois h order_refl quantale_hom_radj) hence"f (radj f (y ← f x) ⋅ x) ≤ y" by (metis h quantale_homset_iff) hence"radj f (y ← f x) ⋅ x≤ radj f y" using adj_def h quantale_hom_radj by blast hence le: "radj f (y ← f x) ≤ radj f y ← x" by (simp add: fres_galois) have"(radj f y ← x) ⋅ x ≤ radj f y" by (simp add: fres_canc1) hence"f ((radj f y ← x) ⋅ x) ≤ y" using adj_def h quantale_hom_radj by blast hence"f (radj f y ← x) ⋅ f x≤ y" by (metis h quantale_homset_iff) hence"f (radj f y ← x) ≤ y ← f x" by (simp add: fres_galois) hence"radj f y ← x≤ radj f (y ← f x)" using adj_def h quantale_hom_radj by blast thus ?thesis by (simp add: dual_order.antisym le) qed
definition quantale_closed_maps :: "('a::quantale ==> 'b::quantale) set"where "quantale_closed_maps = {f. (∀x y. f x ⋅ f y ≤ f (x ⋅ y))}"
lemma quantale_closed_maps_iff: "f ∈ quantale_closed_maps = (∀ x y. f x ⋅ f y ≤ f (x ⋅ y))" unfolding quantale_closed_maps_def by clarsimp
definition quantale_closed_Sup_maps :: "('a::quantale ==> 'b::quantale) set"where "quantale_closed_Sup_maps = {f. (∀ x y. f x ⋅ f y ≤ f (x ⋅ y)) ∧ Sup_pres f}"
lemma quantale_closed_Sup_maps_iff: "f ∈ quantale_closed_Sup_maps = (∀ x y. f x ⋅f y ≤ f (x ⋅ y) ∧ Sup_pres f)" unfolding quantale_closed_Sup_maps_def by clarsimp
definition quantale_closed_unital_maps :: "('a::unital_quantale ==> 'b::unital_quantale) set"where "quantale_closed_unital_maps = {f. (∀ x y. f x ⋅ f y ≤ f (x ⋅ y)) ∧ 1 ≤ f 1}"
lemma quantale_closed_unital_maps_iff: "f ∈ quantale_closed_unital_maps = (∀ x y. f x ⋅ f y ≤ f (x ⋅ y) ∧ 1 ≤ f 1)" unfolding quantale_closed_unital_maps_def by clarsimp
definition quantale_closed_unital_Sup_maps :: "('a::unital_quantale ==> 'b::unital_quantale) set"where "quantale_closed_unital_Sup_maps = {f. (∀ x y. f x ⋅ f y ≤ f (x ⋅ y)) ∧ Sup_pres f ∧ 1 ≤ f 1}"
lemma quantale_closed_unital_Sup_maps_iff: "f ∈ quantale_closed_unital_Sup_maps = (∀ x y. f x ⋅ f y ≤ f (x ⋅ y) ∧ Sup_pres f ∧ 1 ≤ f 1)" unfolding quantale_closed_unital_Sup_maps_def by clarsimp
text‹Closed maps are the right adjoints of quantale morphisms.›
lemma quantale_hom_closed_map: fixes f :: "'a::quantale_with_dual ==> 'b::quantale_with_dual" shows"(f ∈ quantale_homset) ==> (radj f ∈ quantale_closed_maps)" proof- assume h: "f ∈ quantale_homset" have"∀x y. f (radj f x) ⋅ f (radj f y) ≤ x ⋅ y" by (metis adj_def h order_refl psrpq.mult_isol_var quantale_hom_radj) hence"∀x y. f (radj f x ⋅ radj f y) ≤ x ⋅ y" by (metis h quantale_homset_iff) hence"∀x y. radj f x ⋅ radj f y ≤ radj f (x ⋅ y)" using adj_def h quantale_hom_radj by blast thus ?thesis by (simp add: quantale_closed_maps_iff) qed
lemma unital_quantale_hom_closed_unital_map: fixes f :: "'a::unital_quantale_with_dual ==> 'b::unital_quantale_with_dual" shows"(f ∈ unital_quantale_homset) ==> (radj f ∈ quantale_closed_unital_maps)" by (metis (no_types, opaque_lifting) adj_def order_refl quantale_closed_maps_iff quantale_closed_unital_maps_iff quantale_hom_closed_map quantale_hom_radj quantale_homset_iff unital_quantale_homset_iff)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.