Theory SML_Semilattices
section‹Relativization of the results about semilattices›
theory SML_Semilattices
imports
"../Simple_Orders/SML_Simple_Orders"
"../Algebra/SML_Monoids"
begin
subsection‹Commutative bands›
subsubsection‹Definitions and common properties›
locale semilattice_ow = abel_semigroup_ow U f
for U :: "'al set" and f +
assumes idem[simp]: "x ∈ U ⟹ x ❙*⇩o⇩w x = x"
locale semilattice_set_ow =
semilattice_ow U f for U :: "'al set" and f (infixl ‹❙*⇩o⇩w› 70)
subsubsection‹Transfer rules›
context
includes lifting_syntax
begin
lemma semilattice_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"((A ===> A ===> A) ===> (=))
(λf. semilattice_ow (Collect (Domainp A)) f) semilattice"
unfolding
semilattice_ow_def semilattice_def
semilattice_ow_axioms_def semilattice_axioms_def
apply transfer_prover_start
apply transfer_step+
by simp
lemma semilattice_set_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"((A ===> A ===> A) ===> (=))
(λf. semilattice_set_ow (Collect (Domainp A)) f) semilattice_set"
unfolding semilattice_set_ow_def semilattice_set_def by transfer_prover
end
subsubsection‹Relativization›
context semilattice_ow
begin
tts_context
tts: (?'a to U)
substituting semilattice_ow_axioms
eliminating through simp
begin
tts_lemma left_idem:
assumes "a ∈ U" and "b ∈ U"
shows "a ❙*⇩o⇩w (a ❙*⇩o⇩w b) = a ❙*⇩o⇩w b"
is semilattice.left_idem.
tts_lemma right_idem:
assumes "a ∈ U" and "b ∈ U"
shows "a ❙*⇩o⇩w b ❙*⇩o⇩w b = a ❙*⇩o⇩w b"
is semilattice.right_idem.
end
end
subsection‹Simple upper and lower semilattices›
subsubsection‹Definitions and common properties›
locale semilattice_order_ow = semilattice_ow U f
for U :: "'al set" and f +
fixes le :: "['al, 'al] ⇒ bool" (infix ‹≤⇩o⇩w› 50)
and ls :: "['al, 'al] ⇒ bool" (infix ‹<⇩o⇩w› 50)
assumes order_iff: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a ≤⇩o⇩w b ⟷ a = a ❙*⇩o⇩w b"
and strict_order_iff: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a <⇩o⇩w b ⟷ a = a ❙*⇩o⇩w b ∧ a ≠ b"
begin
sublocale ordering_ow U ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)›
proof
show "⟦a ∈ U; b ∈ U⟧ ⟹ (a <⇩o⇩w b) = (a ≤⇩o⇩w b ∧ a ≠ b)" for a b
apply standard
subgoal by (auto simp: commute order_iff strict_order_iff)
subgoal by (auto simp: order_iff strict_order_iff)
done
show "x ∈ U ⟹ x ≤⇩o⇩w x" for x by (simp add: order_iff)
show "⟦ x ∈ U; y ∈ U; z ∈ U; x ≤⇩o⇩w y; y ≤⇩o⇩w z ⟧ ⟹ x ≤⇩o⇩w z" for x y z
proof-
assume "x ∈ U" and "y ∈ U" and "z ∈ U" and "x ≤⇩o⇩w y" and "y ≤⇩o⇩w z"
note xy = order_iff[THEN iffD1, OF ‹x ∈ U› ‹y ∈ U› ‹x ≤⇩o⇩w y›]
note yz = order_iff[THEN iffD1, OF ‹y ∈ U› ‹z ∈ U› ‹y ≤⇩o⇩w z›]
note xz = assoc[OF ‹x ∈ U› ‹y ∈ U› ‹z ∈ U›, folded xy yz, symmetric]
show ?thesis by (rule order_iff[THEN iffD2, OF ‹x ∈ U› ‹z ∈ U› xz])
qed
show "⟦ x ∈ U; y ∈ U; x ≤⇩o⇩w y; y ≤⇩o⇩w x ⟧ ⟹ x = y" for x y
by (fastforce simp: commute order_iff)
qed
notation le (infix "≤⇩o⇩w" 50)
and ls (infix "<⇩o⇩w" 50)
end
locale semilattice_order_set_ow =
semilattice_order_ow U f le ls + semilattice_set_ow U f
for U :: "'al set" and f le ls
locale inf_ow =
fixes U :: "'al set" and inf (infixl ‹⊓⇩o⇩w› 70)
assumes inf_closed[simp]: "⟦ x ∈ U; y ∈ U ⟧ ⟹ x ⊓⇩o⇩w y ∈ U"
begin
notation inf (infixl ‹⊓⇩o⇩w› 70)
lemma inf_closed'[simp]: "∀x∈U. ∀y∈U. x ⊓⇩o⇩w y ∈ U" by simp
end
locale inf_pair_ow = inf⇩1: inf_ow U⇩1 inf⇩1 + inf⇩2: inf_ow U⇩2 inf⇩2
for U⇩1 :: "'al set" and inf⇩1
and U⇩2 :: "'bl set" and inf⇩2
begin
notation inf⇩1 (infixl ‹⊓⇩o⇩w⇩.⇩1› 70)
notation inf⇩2 (infixl ‹⊓⇩o⇩w⇩.⇩2› 70)
end
locale semilattice_inf_ow = inf_ow U inf + order_ow U le ls
for U :: "'al set" and inf le ls +
assumes inf_le1[simp]: "⟦ x ∈ U; y ∈ U ⟧ ⟹ x ⊓⇩o⇩w y ≤⇩o⇩w x"
and inf_le2[simp]: "⟦ x ∈ U; y ∈ U ⟧ ⟹ x ⊓⇩o⇩w y ≤⇩o⇩w y"
and inf_greatest:
"⟦ x ∈ U; y ∈ U; z ∈ U; x ≤⇩o⇩w y; x ≤⇩o⇩w z ⟧ ⟹ x ≤⇩o⇩w y ⊓⇩o⇩w z"
begin
sublocale inf: semilattice_order_ow U ‹(⊓⇩o⇩w)› ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)›
proof
show *: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a ⊓⇩o⇩w b ∈ U" for a b by simp
show **: "⟦ a ∈ U; b ∈ U; c ∈ U ⟧ ⟹ a ⊓⇩o⇩w b ⊓⇩o⇩w c = a ⊓⇩o⇩w (b ⊓⇩o⇩w c)"
for a b c
proof -
assume "a ∈ U" and "b ∈ U" and "c ∈ U"
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have ab_c: "a ⊓⇩o⇩w b ⊓⇩o⇩w c ∈ U" by simp
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have a_bc: "a ⊓⇩o⇩w (b ⊓⇩o⇩w c) ∈ U" by simp
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "a ⊓⇩o⇩w b ⊓⇩o⇩w c ≤⇩o⇩w b"
by (meson * inf_le1 inf_le2 order_trans)
moreover from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "a ⊓⇩o⇩w b ⊓⇩o⇩w c ≤⇩o⇩w c" by simp
ultimately have abc_le_bc: "a ⊓⇩o⇩w b ⊓⇩o⇩w c ≤⇩o⇩w b ⊓⇩o⇩w c"
by (rule inf_greatest[OF ab_c ‹b ∈ U› ‹c ∈ U›])
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have abc_le_a: "a ⊓⇩o⇩w b ⊓⇩o⇩w c ≤⇩o⇩w a"
by (meson inf_le1 order_trans inf_closed)
note lhs =
inf_greatest[OF ab_c ‹a ∈ U› *[OF ‹b ∈ U› ‹c ∈ U›] abc_le_a abc_le_bc]
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "a ⊓⇩o⇩w (b ⊓⇩o⇩w c) ≤⇩o⇩w a"
by (meson * inf_le1 order_trans)
moreover from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "a ⊓⇩o⇩w (b ⊓⇩o⇩w c) ≤⇩o⇩w b"
by (meson * inf_le1 inf_le2 order_trans)
ultimately have abc_le_bc: "a ⊓⇩o⇩w (b ⊓⇩o⇩w c) ≤⇩o⇩w a ⊓⇩o⇩w b"
by (rule inf_greatest[OF a_bc ‹a ∈ U› ‹b ∈ U›])
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have abc_le_a: "a ⊓⇩o⇩w (b ⊓⇩o⇩w c) ≤⇩o⇩w c"
by (meson inf_le2 order_trans inf_closed)
note rhs =
inf_greatest[OF a_bc *[OF ‹a ∈ U› ‹b ∈ U›] ‹c ∈ U› abc_le_bc abc_le_a]
show "a ⊓⇩o⇩w b ⊓⇩o⇩w c = a ⊓⇩o⇩w (b ⊓⇩o⇩w c)"
by (rule antisym[OF ab_c a_bc lhs rhs])
qed
show ***: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a ⊓⇩o⇩w b = b ⊓⇩o⇩w a" for a b
by (simp add: inf_greatest xt1(5))
show ****: "x ∈ U ⟹ x ⊓⇩o⇩w x = x" for x
proof-
assume "x ∈ U"
have "x ⊓⇩o⇩w x ≤⇩o⇩w x" by (simp add: ‹x ∈ U›)
moreover have "x ≤⇩o⇩w x ⊓⇩o⇩w x" by (simp add: ‹x ∈ U› inf_greatest)
ultimately show "x ⊓⇩o⇩w x = x" by (simp add: ‹x ∈ U› antisym)
qed
show *****: "⟦ a ∈ U; b ∈ U ⟧ ⟹ (a ≤⇩o⇩w b) = (a = a ⊓⇩o⇩w b)" for a b
by (metis * *** inf_greatest inf_le2 order.eq_iff)
show "⟦ a ∈ U; b ∈ U ⟧ ⟹ (a <⇩o⇩w b) = (a = a ⊓⇩o⇩w b ∧ a ≠ b)" for a b
by (simp add: ***** less_le)
qed
sublocale Inf_fin: semilattice_order_set_ow U ‹(⊓⇩o⇩w)› ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)› ..
end
locale semilattice_inf_pair_ow =
sl_inf⇩1: semilattice_inf_ow U⇩1 inf⇩1 le⇩1 ls⇩1 +
sl_inf⇩2: semilattice_inf_ow U⇩2 inf⇩2 le⇩2 ls⇩2
for U⇩1 :: "'al set" and inf⇩1 le⇩1 ls⇩1
and U⇩2 :: "'bl set" and inf⇩2 le⇩2 ls⇩2
begin
sublocale inf_pair_ow ..
sublocale order_pair_ow ..
end
locale sup_ow =
fixes U :: "'ao set" and sup :: "['ao, 'ao] ⇒ 'ao" (infixl ‹⊔⇩o⇩w› 70)
assumes sup_closed[simp]: "⟦ x ∈ U; y ∈ U ⟧ ⟹ sup x y ∈ U"
begin
notation sup (infixl ‹⊔⇩o⇩w› 70)
lemma sup_closed'[simp]: "∀x∈U. ∀y∈U. x ⊔⇩o⇩w y ∈ U" by simp
end
locale sup_pair_ow = sup⇩1: sup_ow U⇩1 sup⇩1 + sup⇩2: sup_ow U⇩2 sup⇩2
for U⇩1 :: "'al set" and sup⇩1
and U⇩2 :: "'bl set" and sup⇩2
begin
notation sup⇩1 (infixl ‹⊔⇩o⇩w⇩.⇩1› 70)
notation sup⇩2 (infixl ‹⊔⇩o⇩w⇩.⇩2› 70)
end
locale semilattice_sup_ow = sup_ow U sup + order_ow U le ls
for U :: "'al set" and sup le ls +
assumes sup_ge1[simp]: "⟦ x ∈ U; y ∈ U ⟧ ⟹ x ≤⇩o⇩w x ⊔⇩o⇩w y"
and sup_ge2[simp]: "⟦ y ∈ U; x ∈ U ⟧ ⟹ y ≤⇩o⇩w x ⊔⇩o⇩w y"
and sup_least:
"⟦ y ∈ U; x ∈ U; z ∈ U; y ≤⇩o⇩w x; z ≤⇩o⇩w x ⟧ ⟹ y ⊔⇩o⇩w z ≤⇩o⇩w x"
begin
sublocale sup: semilattice_order_ow U ‹(⊔⇩o⇩w)› ‹(≥⇩o⇩w)› ‹(>⇩o⇩w)›
proof
show *: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a ⊔⇩o⇩w b ∈ U" for a b by simp
show **:
"⟦ a ∈ U; b ∈ U; c ∈ U ⟧ ⟹ a ⊔⇩o⇩w b ⊔⇩o⇩w c = a ⊔⇩o⇩w (b ⊔⇩o⇩w c)" for a b c
proof -
assume "a ∈ U" and "b ∈ U" and "c ∈ U"
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have ab_c: "a ⊔⇩o⇩w b ⊔⇩o⇩w c ∈ U" by simp
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have a_bc: "a ⊔⇩o⇩w (b ⊔⇩o⇩w c) ∈ U" by simp
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "b ≤⇩o⇩w a ⊔⇩o⇩w b ⊔⇩o⇩w c"
by (meson order_trans sup_ge1 sup_ge2 sup_closed')
moreover from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "c ≤⇩o⇩w a ⊔⇩o⇩w b ⊔⇩o⇩w c" by simp
ultimately have ab_le_abc: "b ⊔⇩o⇩w c ≤⇩o⇩w a ⊔⇩o⇩w b ⊔⇩o⇩w c"
by (rule sup_least[OF ‹b ∈ U› ab_c ‹c ∈ U›])
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have a_le_abc: "a ≤⇩o⇩w a ⊔⇩o⇩w b ⊔⇩o⇩w c"
by (meson "*" order_trans sup_ge1)
note rhs =
sup_least[OF ‹a ∈ U› ab_c *[OF ‹b ∈ U› ‹c ∈ U›] a_le_abc ab_le_abc]
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "a ≤⇩o⇩w a ⊔⇩o⇩w (b ⊔⇩o⇩w c)" by simp
moreover from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have "b ≤⇩o⇩w a ⊔⇩o⇩w (b ⊔⇩o⇩w c)"
by (meson order_trans sup_ge1 sup_ge2 sup_closed')
ultimately have ab_le_abc: "a ⊔⇩o⇩w b ≤⇩o⇩w a ⊔⇩o⇩w (b ⊔⇩o⇩w c)"
by (rule sup_least[OF ‹a ∈ U› a_bc ‹b ∈ U›])
from ‹a ∈ U› ‹b ∈ U› ‹c ∈ U› have c_le_abc: "c ≤⇩o⇩w a ⊔⇩o⇩w (b ⊔⇩o⇩w c)"
by (meson "*" order_trans sup_ge2)
note lhs =
sup_least[OF *[OF ‹a ∈ U› ‹b ∈ U›] a_bc ‹c ∈ U› ab_le_abc c_le_abc]
show "a ⊔⇩o⇩w b ⊔⇩o⇩w c = a ⊔⇩o⇩w (b ⊔⇩o⇩w c)"
by (rule antisym[OF ab_c a_bc lhs rhs])
qed
show ***: "⟦ a ∈ U; b ∈ U ⟧ ⟹ a ⊔⇩o⇩w b = b ⊔⇩o⇩w a" for a b
by (simp add: antisym sup_least)
show ****: "x ∈ U ⟹ x ⊔⇩o⇩w x = x" for x
proof-
assume "x ∈ U"
have "x ≤⇩o⇩w x ⊔⇩o⇩w x" by (simp add: ‹x ∈ U›)
moreover have "x ⊔⇩o⇩w x ≤⇩o⇩w x" by (simp add: ‹x ∈ U› sup_least)
ultimately show "x ⊔⇩o⇩w x = x" by (simp add: ‹x ∈ U› antisym)
qed
show *****: "⟦ a ∈ U; b ∈ U ⟧ ⟹ (a ≥⇩o⇩w b) = (a = a ⊔⇩o⇩w b)" for a b
by (metis *** order.eq_iff sup_ge2 sup_least sup_closed)
show "⟦ a ∈ U; b ∈ U ⟧ ⟹ (a >⇩o⇩w b) = (a = a ⊔⇩o⇩w b ∧ a ≠ b)" for a b
by (auto simp: ***** less_le)
qed
sublocale Sup_fin: semilattice_order_set_ow U sup "(≥⇩o⇩w)" "(>⇩o⇩w)" ..
end
locale semilattice_sup_pair_ow =
sl_sup⇩1: semilattice_sup_ow U⇩1 sup⇩1 le⇩1 ls⇩1 +
sl_sup⇩2: semilattice_sup_ow U⇩2 sup⇩2 le⇩2 ls⇩2
for U⇩1 :: "'al set" and sup⇩1 le⇩1 ls⇩1
and U⇩2 :: "'bl set" and sup⇩2 le⇩2 ls⇩2
begin
sublocale sup_pair_ow ..
sublocale order_pair_ow ..
end
subsubsection‹Transfer rules›
context
includes lifting_syntax
begin
lemma semilattice_order_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
) (semilattice_order_ow (Collect (Domainp A))) semilattice_order"
unfolding
semilattice_order_ow_def semilattice_order_def
semilattice_order_ow_axioms_def semilattice_order_axioms_def
apply transfer_prover_start
apply transfer_step+
by simp
lemma semilattice_order_set_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
) (semilattice_order_set_ow (Collect (Domainp A))) semilattice_order_set"
unfolding semilattice_order_set_ow_def semilattice_order_set_def
apply transfer_prover_start
apply transfer_step+
by simp
lemma semilattice_inf_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
) (semilattice_inf_ow (Collect (Domainp A))) class.semilattice_inf"
proof -
let ?P =
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
)"
let ?semilattice_ow = "semilattice_inf_ow (Collect (Domainp A))"
let ?rf_UNIV =
"(λinf::['b, 'b] ⇒ 'b. (∀x y. x ∈ UNIV ⟶ y ∈ UNIV ⟶ inf x y ∈ UNIV))"
have
"?P
?semilattice_ow
(λinf le ls. ?rf_UNIV inf ∧ class.semilattice_inf inf le ls)"
unfolding
class.semilattice_inf_def semilattice_inf_ow_def
class.semilattice_inf_axioms_def semilattice_inf_ow_axioms_def
inf_ow_def
apply transfer_prover_start
apply transfer_step+
unfolding Ball_def by fastforce
then show ?thesis by simp
qed
lemma semilattice_sup_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
) (semilattice_sup_ow (Collect (Domainp A))) class.semilattice_sup"
proof -
let ?P =
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
)"
let ?semilattice_ow = "semilattice_sup_ow (Collect (Domainp A))"
let ?rf_UNIV =
"(λsup::['b, 'b] ⇒ 'b. (∀x y. x ∈ UNIV ⟶ y ∈ UNIV ⟶ sup x y ∈ UNIV))"
have
"?P
?semilattice_ow
(λsup le ls. ?rf_UNIV sup ∧ class.semilattice_sup sup le ls)"
unfolding
class.semilattice_sup_def semilattice_sup_ow_def
class.semilattice_sup_axioms_def semilattice_sup_ow_axioms_def
sup_ow_def
apply transfer_prover_start
apply transfer_step+
unfolding Ball_def by fastforce
then show ?thesis by simp
qed
end
subsubsection‹Relativization›
context semilattice_order_ow
begin
tts_context
tts: (?'a to U)
rewriting ctr_simps
substituting semilattice_order_ow_axioms
eliminating through simp
begin
tts_lemma cobounded1:
assumes "a ∈ U" and "b ∈ U"
shows "a ❙*⇩o⇩w b ≤⇩o⇩w a"
is semilattice_order.cobounded1.
tts_lemma cobounded2:
assumes "a ∈ U" and "b ∈ U"
shows "a ❙*⇩o⇩w b ≤⇩o⇩w b"
is semilattice_order.cobounded2.
tts_lemma absorb_iff1:
assumes "a ∈ U" and "b ∈ U"
shows "(a ≤⇩o⇩w b) = (a ❙*⇩o⇩w b = a)"
is semilattice_order.absorb_iff1.
tts_lemma absorb_iff2:
assumes "b ∈ U" and "a ∈ U"
shows "(b ≤⇩o⇩w a) = (a ❙*⇩o⇩w b = b)"
is semilattice_order.absorb_iff2.
tts_lemma strict_coboundedI1:
assumes "a ∈ U" and "c ∈ U" and "b ∈ U" and "a <⇩o⇩w c"
shows "a ❙*⇩o⇩w b <⇩o⇩w c"
is semilattice_order.strict_coboundedI1.
tts_lemma strict_coboundedI2:
assumes "b ∈ U" and "c ∈ U" and "a ∈ U" and "b <⇩o⇩w c"
shows "a ❙*⇩o⇩w b <⇩o⇩w c"
is semilattice_order.strict_coboundedI2.
tts_lemma absorb1:
assumes "a ∈ U" and "b ∈ U" and "a ≤⇩o⇩w b"
shows "a ❙*⇩o⇩w b = a"
is semilattice_order.absorb1.
tts_lemma coboundedI1:
assumes "a ∈ U" and "c ∈ U" and "b ∈ U" and "a ≤⇩o⇩w c"
shows "a ❙*⇩o⇩w b ≤⇩o⇩w c"
is semilattice_order.coboundedI1.
tts_lemma absorb2:
assumes "b ∈ U" and "a ∈ U" and "b ≤⇩o⇩w a"
shows "a ❙*⇩o⇩w b = b"
is semilattice_order.absorb2.
tts_lemma coboundedI2:
assumes "b ∈ U" and "c ∈ U" and "a ∈ U" and "b ≤⇩o⇩w c"
shows "a ❙*⇩o⇩w b ≤⇩o⇩w c"
is semilattice_order.coboundedI2.
tts_lemma orderI:
assumes "a ∈ U" and "b ∈ U" and "a = a ❙*⇩o⇩w b"
shows "a ≤⇩o⇩w b"
is semilattice_order.orderI.
tts_lemma bounded_iff:
assumes "a ∈ U" and "b ∈ U" and "c ∈ U"
shows "(a ≤⇩o⇩w b ❙*⇩o⇩w c) = (a ≤⇩o⇩w b ∧ a ≤⇩o⇩w c)"
is semilattice_order.bounded_iff.
tts_lemma boundedI:
assumes "a ∈ U" and "b ∈ U" and "c ∈ U" and "a ≤⇩o⇩w b" and "a ≤⇩o⇩w c"
shows "a ≤⇩o⇩w b ❙*⇩o⇩w c"
is semilattice_order.boundedI.
tts_lemma orderE:
assumes "a ∈ U" and "b ∈ U" and "a ≤⇩o⇩w b" and "a = a ❙*⇩o⇩w b ⟹ thesis"
shows thesis
is semilattice_order.orderE.
tts_lemma mono:
assumes "a ∈ U"
and "c ∈ U"
and "b ∈ U"
and "d ∈ U"
and "a ≤⇩o⇩w c"
and "b ≤⇩o⇩w d"
shows "a ❙*⇩o⇩w b ≤⇩o⇩w c ❙*⇩o⇩w d"
is semilattice_order.mono.
tts_lemma strict_boundedE:
assumes "a ∈ U"
and "b ∈ U"
and "c ∈ U"
and "a <⇩o⇩w b ❙*⇩o⇩w c"
obtains "a <⇩o⇩w b" and "a <⇩o⇩w c"
given semilattice_order.strict_boundedE by auto
tts_lemma boundedE:
assumes "a ∈ U"
and "b ∈ U"
and "c ∈ U"
and "a ≤⇩o⇩w b ❙*⇩o⇩w c"
obtains "a ≤⇩o⇩w b" and "a ≤⇩o⇩w c"
given semilattice_order.boundedE by auto
end
end
context semilattice_inf_ow
begin
tts_context
tts: (?'a to U)
rewriting ctr_simps
substituting semilattice_inf_ow_axioms
eliminating through simp
begin
tts_lemma le_iff_inf:
assumes "x ∈ U" and "y ∈ U"
shows "(x ≤⇩o⇩w y) = (x ⊓⇩o⇩w y = x)"
is semilattice_inf_class.le_iff_inf.
tts_lemma less_infI1:
assumes "a ∈ U" and "x ∈ U" and "b ∈ U" and "a <⇩o⇩w x"
shows "a ⊓⇩o⇩w b <⇩o⇩w x"
is semilattice_inf_class.less_infI1.
tts_lemma less_infI2:
assumes "b ∈ U" and "x ∈ U" and "a ∈ U" and "b <⇩o⇩w x"
shows "a ⊓⇩o⇩w b <⇩o⇩w x"
is semilattice_inf_class.less_infI2.
tts_lemma le_infI1:
assumes "a ∈ U" and "x ∈ U" and "b ∈ U" and "a ≤⇩o⇩w x"
shows "a ⊓⇩o⇩w b ≤⇩o⇩w x"
is semilattice_inf_class.le_infI1.
tts_lemma le_infI2:
assumes "b ∈ U" and "x ∈ U" and "a ∈ U" and "b ≤⇩o⇩w x"
shows "a ⊓⇩o⇩w b ≤⇩o⇩w x"
is semilattice_inf_class.le_infI2.
tts_lemma le_inf_iff:
assumes "x ∈ U" and "y ∈ U" and "z ∈ U"
shows "(x ≤⇩o⇩w y ⊓⇩o⇩w z) = (x ≤⇩o⇩w y ∧ x ≤⇩o⇩w z)"
is semilattice_inf_class.le_inf_iff.
tts_lemma le_infI:
assumes "x ∈ U" and "a ∈ U" and "b ∈ U" and "x ≤⇩o⇩w a" and "x ≤⇩o⇩w b"
shows "x ≤⇩o⇩w a ⊓⇩o⇩w b"
is semilattice_inf_class.le_infI.
tts_lemma le_infE:
assumes "x ∈ U"
and "a ∈ U"
and "b ∈ U"
and "x ≤⇩o⇩w a ⊓⇩o⇩w b"
and "⟦x ≤⇩o⇩w a; x ≤⇩o⇩w b⟧ ⟹ P"
shows P
is semilattice_inf_class.le_infE.
tts_lemma inf_mono:
assumes "a ∈ U"
and "c ∈ U"
and "b ∈ U"
and "d ∈ U"
and "a ≤⇩o⇩w c"
and "b ≤⇩o⇩w d"
shows "a ⊓⇩o⇩w b ≤⇩o⇩w c ⊓⇩o⇩w d"
is semilattice_inf_class.inf_mono.
end
end
context semilattice_sup_ow
begin
tts_context
tts: (?'a to U)
rewriting ctr_simps
substituting semilattice_sup_ow_axioms
eliminating through simp
begin
tts_lemma le_iff_sup:
assumes "x ∈ U" and "y ∈ U"
shows "(x ≤⇩o⇩w y) = (x ⊔⇩o⇩w y = y)"
is semilattice_sup_class.le_iff_sup.
tts_lemma less_supI1:
assumes "x ∈ U" and "a ∈ U" and "b ∈ U" and "x <⇩o⇩w a"
shows "x <⇩o⇩w a ⊔⇩o⇩w b"
is semilattice_sup_class.less_supI1.
tts_lemma less_supI2:
assumes "x ∈ U" and "b ∈ U" and "a ∈ U" and "x <⇩o⇩w b"
shows "x <⇩o⇩w a ⊔⇩o⇩w b"
is semilattice_sup_class.less_supI2.
tts_lemma le_supI1:
assumes "x ∈ U" and "a ∈ U" and "b ∈ U" and "x ≤⇩o⇩w a"
shows "x ≤⇩o⇩w a ⊔⇩o⇩w b"
is semilattice_sup_class.le_supI1.
tts_lemma le_supI2:
assumes "x ∈ U" and "b ∈ U" and "a ∈ U" and "x ≤⇩o⇩w b"
shows "x ≤⇩o⇩w a ⊔⇩o⇩w b"
is semilattice_sup_class.le_supI2.
tts_lemma le_sup_iff:
assumes "x ∈ U" and "y ∈ U" and "z ∈ U"
shows "(x ⊔⇩o⇩w y ≤⇩o⇩w z) = (x ≤⇩o⇩w z ∧ y ≤⇩o⇩w z)"
is semilattice_sup_class.le_sup_iff.
tts_lemma le_supI:
assumes "a ∈ U" and "x ∈ U" and "b ∈ U" and "a ≤⇩o⇩w x" and "b ≤⇩o⇩w x"
shows "a ⊔⇩o⇩w b ≤⇩o⇩w x"
is semilattice_sup_class.le_supI.
tts_lemma le_supE:
assumes "a ∈ U"
and "b ∈ U"
and "x ∈ U"
and "a ⊔⇩o⇩w b ≤⇩o⇩w x"
and "⟦a ≤⇩o⇩w x; b ≤⇩o⇩w x⟧ ⟹ P"
shows P
is semilattice_sup_class.le_supE.
tts_lemma sup_unique:
assumes "∀x∈U. ∀y∈U. f x y ∈ U"
and "x ∈ U"
and "y ∈ U"
and "⋀x y. ⟦x ∈ U; y ∈ U⟧ ⟹ x ≤⇩o⇩w f x y"
and "⋀x y. ⟦x ∈ U; y ∈ U⟧ ⟹ y ≤⇩o⇩w f x y"
and "⋀x y z. ⟦x ∈ U; y ∈ U; z ∈ U; y ≤⇩o⇩w x; z ≤⇩o⇩w x⟧ ⟹ f y z ≤⇩o⇩w x"
shows "x ⊔⇩o⇩w y = f x y"
is semilattice_sup_class.sup_unique.
tts_lemma sup_mono:
assumes "a ∈ U"
and "c ∈ U"
and "b ∈ U"
and "d ∈ U"
and "a ≤⇩o⇩w c"
and "b ≤⇩o⇩w d"
shows "a ⊔⇩o⇩w b ≤⇩o⇩w c ⊔⇩o⇩w d"
is semilattice_sup_class.sup_mono.
end
end
subsection‹Bounded semilattices›
subsubsection‹Definitions and common properties›
locale semilattice_neutral_ow = semilattice_ow U f + comm_monoid_ow U f z
for U :: "'al set" and f z
locale semilattice_neutral_order_ow =
sl_neut: semilattice_neutral_ow U f z +
sl_ord: semilattice_order_ow U f le ls
for U :: "'al set" and f z le ls
begin
sublocale order_top_ow U ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)› ‹❙1⇩o⇩w›
apply unfold_locales
subgoal by (auto simp: antisym sl_ord.strict_iff_order sl_ord.antisym)
subgoal by (auto simp: sl_ord.order_iff)
subgoal by (auto intro: sl_ord.trans)
subgoal by (auto simp: sl_ord.antisym)
subgoal by auto
subgoal by (simp add: sl_ord.absorb_iff1)
done
end
locale bounded_semilattice_inf_top_ow =
semilattice_inf_ow U inf le ls + order_top_ow U le ls top
for U :: "'al set" and inf le ls top
begin
sublocale inf_top: semilattice_neutral_order_ow U ‹(⊓⇩o⇩w)› ‹⊤⇩o⇩w› ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)›
apply unfold_locales
subgoal by simp
subgoal using top_greatest by (simp add: inf.order_iff)
done
end
locale bounded_semilattice_sup_bot_ow =
semilattice_sup_ow U sup le ls + order_bot_ow U bot le ls
for U :: "'al set" and sup le ls bot
begin
sublocale sup_bot: semilattice_neutral_order_ow U ‹(⊔⇩o⇩w)› ‹⊥⇩o⇩w› ‹(≥⇩o⇩w)› ‹(>⇩o⇩w)›
by unfold_locales (simp_all add: sup.absorb1)
end
subsubsection‹Transfer rules›
context
includes lifting_syntax
begin
lemma semilattice_neutral_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"((A ===> A ===> A) ===> A ===> (=))
(semilattice_neutral_ow (Collect (Domainp A))) semilattice_neutr"
unfolding semilattice_neutral_ow_def semilattice_neutr_def by transfer_prover
lemma semilattice_neutr_order_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
A ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(=)
)
(semilattice_neutral_order_ow (Collect (Domainp A)))
semilattice_neutr_order"
unfolding semilattice_neutral_order_ow_def semilattice_neutr_order_def
by transfer_prover
lemma bounded_semilattice_inf_top_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
A ===>
(=)
)
(bounded_semilattice_inf_top_ow (Collect (Domainp A)))
class.bounded_semilattice_inf_top"
unfolding
bounded_semilattice_inf_top_ow_def class.bounded_semilattice_inf_top_def
by transfer_prover
lemma bounded_semilattice_sup_bot_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
A ===>
(=)
)
(bounded_semilattice_sup_bot_ow (Collect (Domainp A)))
class.bounded_semilattice_sup_bot"
unfolding
bounded_semilattice_sup_bot_ow_def class.bounded_semilattice_sup_bot_def
by transfer_prover
end
text‹\newpage›
end