(complete) lattices are Heyting algebras. The following development is oriented towards
the derived Heyting implication in a logical fashion. As there are no standard classes for
-(complete-)lattices we simply work with complete lattices.
class heyting_algebra = complete_lattice + assumes inf_Sup_distrib1: "∧Y::'a set. ∧x::'a. x ⊓ (⊔Y) = (⊔y∈Y. x ⊓ y)" begin
definition heyting :: "'a ==> 'a ==> 'a" (infixr‹\⟶H›53) where "x \<longrightarrow>H y = ⊔{z. x ⊓ z ≤ y}"
lemma heyting: ―‹ The Galois property for ‹(⊓)› and ‹\⟶H›› shows"z ≤ x \<longrightarrow>H y ⟷ z ⊓ x ≤ y" (is"?lhs ⟷ ?rhs") proof(rule iffI) from inf_Sup_distrib1 have"⊔{a. x ⊓ a ≤ y} ⊓ x ≤ y"by (simp add: SUP_le_iff inf_commute) thenshow"?lhs ==> ?rhs"unfolding heyting_def by (meson inf_mono order.trans order_refl) show"?rhs ==> ?lhs"by (simp add: heyting_def Sup_upper inf.commute) qed
end
setup‹Sign.mandatory_path "heyting"›
context heyting_algebra begin
lemma commute: shows"x ⊓ z ≤ y ⟷ z ≤ (x \<longrightarrow>H y)" by (simp add: heyting inf.commute)
lemma detachment: shows"x ⊓ (x \<longrightarrow>H y) = x ⊓ y" (is ?thesis1) and"(x \<longrightarrow>H y) ⊓ x = x ⊓ y" (is ?thesis2) proof - show ?thesis1 by (metis absorb(1) uncurry inf.assoc inf.commute inf.idem inf_iff_le(2)) thenshow ?thesis2 by (simp add: ac_simps) qed
lemma discharge: assumes"x' ≤ x" shows"x' ⊓ (x \<longrightarrow>H y) = x' ⊓ y" (is ?thesis1) and"(x \<longrightarrow>H y) ⊓ x' = y ⊓ x'" (is ?thesis2) proof - from assms show ?thesis1 by (metis curry_conv detachment(2) inf.absorb1) thenshow ?thesis2 by (simp add: ac_simps) qed
lemma trans: shows"(x \<longrightarrow>H y) ⊓ (y \<longrightarrow>H z) ≤ x \<longrightarrow>H z" by (metis curry detachment(2) swap uncurry inf_le2)
lemma rev_trans: shows"(y \<longrightarrow>H z) ⊓ (x \<longrightarrow>H y) ≤ x \<longrightarrow>H z" by (simp add: inf.commute trans)
lemma discard: shows"Q ≤ P \<longrightarrow>H Q" by (simp add: curry)
lemma infR: shows"x \<longrightarrow>H y ⊓ z = (x \<longrightarrow>H y) ⊓ (x \<longrightarrow>H z)" by (simp add: order_eq_iff curry uncurry detachment le_infI2)
lemma mono: assumes"x' ≤ x" assumes"y ≤ y'" shows"x \<longrightarrow>H y ≤ x' \<longrightarrow>H y'" using assms by (metis curry detachment(1) uncurry inf_commute inf_absorb2 le_infI1)
lemma strengthen[strg]: assumes"st_ord (¬ F) X X'" assumes"st_ord F Y Y'" shows"st_ord F (X \<longrightarrow>H Y) (X' \<longrightarrow>H Y')" using assms by (cases F; simp add: heyting.mono)
lemma mono2mono[cont_intro, partial_function_mono]: assumes"monotone orda (≥) F" assumes"monotone orda (≤) G" shows"monotone orda (≤) (λx. F x \<longrightarrow>H G x)" by (simp add: monotoneI curry discharge le_infI1 monotoneD[OF assms(1)] monotoneD[OF assms(2)])
lemma mp: assumes"x ≤ y \<longrightarrow>H z" assumes"x ≤ y" shows"x ≤ z" by (meson assms uncurry inf_greatest order.refl order_trans)
lemma botL: shows"⊥\<longrightarrow>H x = ⊤" by (simp add: heyting top_le)
lemma top_conv: shows"x \<longrightarrow>H y = ⊤⟷ x ≤ y" by (metis curry detachment(2) inf_iff_le(1) inf_top.left_neutral)
lemma refl[simp]: shows"x \<longrightarrow>H x = ⊤" by (simp add: top_conv)
lemma topL[simp]: shows"⊤\<longrightarrow>H x = x" by (metis detachment(1) inf_top_left)
lemma topR[simp]: shows"x \<longrightarrow>H⊤ = ⊤" by (simp add: top_conv)
subclass distrib_lattice proof ―‹🍋‹‹Proposition~1.5.3› in "Esakia:2019"›› have"x ⊓ (y ⊔ z) ≤ x ⊓ y ⊔ x ⊓ z"for x y z :: 'a using commute by fastforce thenhave"x ⊓ (y ⊔ z) = (x ⊓ y) ⊔ (x ⊓ z)"for x y z :: 'a by (simp add: order.eq_iff le_infI2) thenshow"x ⊔ (y ⊓ z) = (x ⊔ y) ⊓ (x ⊔ z)"for x y z :: 'a by (rule distrib_imp1) qed
subclass (in complete_distrib_lattice) heyting_algebra by standard (rule inf_Sup)
lemma inf_Sup_distrib: shows"x ⊓⊔Y = (⊔y∈Y. x ⊓ y)" and"⊔Y ⊓ x = (⊔y∈Y. x ⊓ y)" by (simp_all add: inf_Sup_distrib1 inf_commute)
lemma inf_SUP_distrib: shows"x ⊓ (⊔i∈I. Y i) = (⊔i∈I. x ⊓ Y i)" and"(⊔i∈I. Y i) ⊓ x = (⊔i∈I. Y i ⊓ x)" by (simp_all add: inf_Sup_distrib image_image ac_simps)
end
lemma eq_boolean_implication: ―‹ the implications coincide in 🍋‹boolean_algebra›s› fixes x :: "_::boolean_algebra" shows"x \<longrightarrow>H y = x \<longrightarrow>B y" by (simp add: order.eq_iff boolean_implication_def heyting.detachment heyting.curry flip: shunt1)
lemma Sup_prime_Sup_irreducible_iff: fixes x :: "_::heyting_algebra" shows"Sup_prime x ⟷ Sup_irreducible x" by (fastforce simp: Sup_prime_on_def Sup_irreducible_on_def inf.order_iff heyting.inf_Sup_distrib
intro: Sup_prime_on_imp_Sup_irreducible_on)
paragraph‹ Logical rules ala HOL ›
lemma bspec: fixes P :: "_ ==> (_::heyting_algebra)" shows"x ∈ X ==> (⊓x∈X. P x \<longrightarrow>H Q x) ⊓ P x ≤ Q x" (is"?X ==> ?thesis1") and"x ∈ X ==> P x ⊓ (⊓x∈X. P x \<longrightarrow>H Q x) ≤ Q x" (is"_ ==> ?thesis2") and"(⊓x. P x \<longrightarrow>H Q x) ⊓ P x ≤ Q x" (is ?thesis3) and"P x ⊓ (⊓x. P x \<longrightarrow>H Q x) ≤ Q x" (is ?thesis4) proof - show"?X ==> ?thesis1"by (meson INF_lower heyting.uncurry) thenshow"?X ==> ?thesis2"by (simp add: inf_commute) show ?thesis3 by (simp add: Inf_lower heyting.commute inf_commute) thenshow ?thesis4 by (simp add: inf_commute) qed
lemma INFL: fixes Q :: "_::heyting_algebra" shows"(⊓x∈X. P x \<longrightarrow>H Q) = (⊔x∈X. P x) \<longrightarrow>H Q" (is"?lhs = ?rhs") proof(rule antisym) show"?lhs ≤ ?rhs"by (meson INFE SUPE order.refl heyting.commute heyting.uncurry) show"?rhs ≤ ?lhs"by (simp add: INFI SupI heyting.mono) qed
lemma contrapos_le: shows"x \<longrightarrow>H y ≤\<not>Hy\<longrightarrow>H\<not>Hx" by (simp add: heyting.curry heyting.trans pseudocomplement_def)
lemma sup_inf: ―‹ half of de Morgan › shows"\<not>H(x ⊔ y) = \<not>Hx⊓\<not>Hy" by (simp add: pseudocomplement_def heyting.supL)
lemma inf_sup_weak: ―‹ the weakened other half of de Morgan › shows"\<not>H(x ⊓ y) = \<not>H\<not>H(\<not>Hx⊔\<not>Hy)" by (metis (no_types, opaque_lifting) pseudocomplement_def heyting.curry_conv heyting.supL inf_commute pseudocomplement.triple)
lemma fix_triv: assumes"x = \<not>Hx" shows"x = y" using assms by (metis antisym bot.extremum inf.idem inf_le2 pseudocomplementI)
lemma Inf_inf: fixes P :: "_ ==> (_::heyting_algebra)" shows"(⊓x. P x) ⊓\<not>HP x = ⊥" by (simp add: pseudocomplement_def Inf_lower heyting.discharge(1))
lemma SUP_le: ―‹ half of de Morgan › fixes P :: "_ ==> (_::heyting_algebra)" shows"(⊔x∈X. P x) ≤\<not>H(⊓x∈X. \<not>HP x)" by (rule SUP_least) (meson INF_lower order.trans pseudocomplement.double_le pseudocomplement.mono)
lemma SUP_INF_le: fixes P :: "_ ==> (_::heyting_algebra)" shows"(⊔x∈X. \<not>HP x) ≤\<not>H(⊓x∈X. P x)" by (simp add: INF_lower SUPE pseudocomplement.mono)
lemma SUP: fixes P :: "_ ==> (_::heyting_algebra)" shows"\<not>H(⊔x∈X. P x) = (⊓x∈X. \<not>HP x)" by (simp add: order.eq_iff SUP_upper le_INF_iff pseudocomplement.mono)
(metis inf_commute pseudocomplement.SUP_le pseudocomplementI)
setup‹Sign.parent_path›
subsection‹ Downwards closure of preorders (downsets) \label{sec:closures-downwards} ›
text‹
🪙‹downset› (also 🪙‹lower set› and 🪙‹order ideal›) is a subset of a preorder that is closed under
order relation. (An 🪙‹ideal› is a downset that is const‹directed›.) Some results require
(a partial order).
definition cl :: "'a::preorder set ==> 'a set"where "cl P = {x |x y. y ∈ P ∧ x ≤ y}"
setup‹Sign.parent_path›
interpretation downwards: closure_powerset_distributive downwards.cl ―‹ On preorders› proof standard show"(P ⊆ downwards.cl Q) ⟷ (downwards.cl P ⊆ downwards.cl Q)"for P Q :: "'a set" unfolding downwards.cl_def by (auto dest: order_trans) show"downwards.cl (∪X) ⊆∪ (downwards.cl ` X) ∪ downwards.cl {}"for X :: "'a set set" unfolding downwards.cl_def by auto qed
interpretation downwards: closure_powerset_distributive_anti_exchange "(downwards.cl::_::order set ==> _)"
―‹ On partial orders; see 🍋‹"PfaltzSlapal:2013"›› by standard (unfold downwards.cl_def; blast intro: anti_exchangeI antisym)
setup‹Sign.mandatory_path "downwards"›
lemma cl_empty: shows"downwards.cl {} = {}" unfolding downwards.cl_def by simp
lemma closed_empty[iff]: shows"{} ∈ downwards.closed" using downwards.cl_def by fastforce
lemma clI[intro]: assumes"y ∈ P" assumes"x ≤ y" shows"x ∈ downwards.cl P" unfolding closure.closed_def downwards.cl_def using assms by blast
lemma clE: assumes"x ∈ downwards.cl P" obtains y where"y ∈ P"and"x ≤ y" using assms unfolding downwards.cl_def by fast
lemma order_embedding: ―‹ On preorders; see 🍋‹‹\S1.35› in "DaveyPriestley:2002"›› fixes x :: "_::preorder" shows"downwards.cl {x} ⊆ downwards.cl {y} ⟷ x ≤ y" using downwards.cl by (blast elim: downwards.clE)
text‹
lattice of downsets of a set ‹X› is always a 🍋‹heyting_algebra›.
definition imp :: "'a::preorder set ==> 'a set ==> 'a set"where "imp P Q = {σ. ∀σ'≤σ. σ' ∈ P ⟶ σ' ∈ Q}"
lemma imp_refl: shows"downwards.imp P P = UNIV" by (simp add: downwards.imp_def)
lemma imp_contained: assumes"P ⊆ Q" shows"downwards.imp P Q = UNIV" unfolding downwards.imp_def using assms by fast
lemma heyting_imp: assumes"P ∈ downwards.closed" shows"P ⊆ downwards.imp Q R ⟷ P ∩ Q ⊆ R" using assms unfolding downwards.imp_def downwards.closed_def by blast
lemma imp_mp': assumes"σ ∈ downwards.imp P Q" assumes"σ ∈ P" shows"σ ∈ Q" using assms by (simp add: downwards.imp_def)
lemma imp_mp: shows"P ∩ downwards.imp P Q ⊆ Q" and"downwards.imp P Q ∩ P ⊆ Q" by (meson IntD1 IntD2 downwards.imp_mp' subsetI)+
lemma imp_contains: assumes"X ⊆ Q" assumes"X ∈ downwards.closed" shows"X ⊆ downwards.imp P Q" using assms by (auto simp: downwards.imp_def elim: downwards.closed_in)
lemma imp_downwards: assumes"y ∈ downwards.imp P Q" assumes"x ≤ y" shows"x ∈ downwards.imp P Q" using assms order_trans by (force simp: downwards.imp_def)
lemma closed_imp: shows"downwards.imp P Q ∈ downwards.closed" by (meson downwards.clE downwards.closedI downwards.imp_downwards)
text‹
set ‹downwards.imp P Q› is the greatest downset contained in the Boolean implication ‹P \⟶B Q›, i.e., ‹downwards.imp› is the 🪙‹kernel› of ‹(\⟶B)›🍋‹"Zwiers:1989"›.
that ``kernel'' is a choice or interior function.
›
lemma imp_boolean_implication_subseteq: shows"downwards.imp P Q ⊆ P \<longrightarrow>B Q" unfolding downwards.imp_def boolean_implication.set_alt_def by blast
lemma downwards_closed_imp_greatest: assumes"R ⊆ P \<longrightarrow>B Q" assumes"R ∈ downwards.closed" shows"R ⊆ downwards.imp P Q" using assms unfolding boolean_implication.set_alt_def downwards.imp_def downwards.closed_def by blast
definition kernel :: "'a::order set ==> 'a set"where "kernel X = ⊔{Q ∈ downwards.closed. Q ⊆ X}"
lemma kernel_def2: shows"downwards.kernel X = {σ. ∀σ'≤σ. σ' ∈ X}" (is"?lhs = ?rhs") proof(rule antisym) show"?lhs ⊆ ?rhs" unfolding downwards.kernel_def using downwards.closed_conv by blast next have"x ∈ ?lhs"if"x ∈ ?rhs"for x unfolding downwards.kernel_def using that by (auto elim: downwards.clE intro: exI[where x="downwards.cl {x}"]) thenshow"?rhs ⊆ ?lhs"by blast qed
lemma kernel_contractive: shows"downwards.kernel X ⊆ X" unfolding downwards.kernel_def by blast
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.