Theory SML_Complete_Lattices
section‹Relativization of the results about complete lattices›
theory SML_Complete_Lattices
imports SML_Lattices
begin
subsection‹Simple complete lattices›
subsubsection‹Definitions and common properties›
locale Inf_ow =
fixes U :: "'al set" and Inf (‹⨅⇩o⇩w›)
assumes Inf_closed[simp]: "⨅⇩o⇩w ` Pow U ⊆ U"
begin
notation Inf (‹⨅⇩o⇩w›)
lemma Inf_closed'[simp]: "∀x⊆U. ⨅⇩o⇩w x ∈ U" using Inf_closed by blast
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 (‹⨅⇩o⇩w⇩.⇩1›)
notation Inf⇩2 (‹⨅⇩o⇩w⇩.⇩2›)
end
locale Sup_ow =
fixes U :: "'al set" and Sup (‹⨆⇩o⇩w›)
assumes Sup_closed[simp]: "⨆⇩o⇩w ` Pow U ⊆ U"
begin
notation Sup (‹⨆⇩o⇩w›)
lemma Sup_closed'[simp]: "∀x⊆U. ⨆⇩o⇩w x ∈ U" using Sup_closed by blast
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 (‹⨆⇩o⇩w⇩.⇩1›)
notation Sup⇩2 (‹⨆⇩o⇩w⇩.⇩2›)
end
locale complete_lattice_ow =
lattice_ow U inf le ls sup +
Inf_ow U Inf +
Sup_ow U Sup +
bot_ow U bot +
top_ow U top
for U :: "'al set" and Inf Sup inf le ls sup bot top +
assumes Inf_lower: "⟦ A ⊆ U; x ∈ A ⟧ ⟹ ⨅⇩o⇩w A ≤⇩o⇩w x"
and Inf_greatest:
"⟦ A ⊆ U; z ∈ U; (⋀x. x ∈ A ⟹ z ≤⇩o⇩w x) ⟧ ⟹ z ≤⇩o⇩w ⨅⇩o⇩w A"
and Sup_upper: "⟦ x ∈ A; A ⊆ U ⟧ ⟹ x ≤⇩o⇩w ⨆⇩o⇩w A"
and Sup_least:
"⟦ A ⊆ U; z ∈ U; (⋀x. x ∈ A ⟹ x ≤⇩o⇩w z) ⟧ ⟹ ⨆⇩o⇩w A ≤⇩o⇩w z"
and Inf_empty[simp]: "⨅⇩o⇩w {} = ⊤⇩o⇩w"
and Sup_empty[simp]: "⨆⇩o⇩w {} = ⊥⇩o⇩w"
begin
sublocale bounded_lattice_ow U ‹(⊓⇩o⇩w)› ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)› ‹(⊔⇩o⇩w)› ‹⊥⇩o⇩w› ‹⊤⇩o⇩w›
apply standard
subgoal using Sup_least by force
subgoal using Inf_greatest by fastforce
done
tts_register_sbts ‹⊥⇩o⇩w› | U
proof-
assume ALA: "Domainp ALA = (λx. x ∈ U)"
have "Domainp ALA ⊥⇩o⇩w" unfolding ALA by simp
then obtain bot' where "ALA ⊥⇩o⇩w bot'" by blast
then show "∃bot'. ALA ⊥⇩o⇩w bot'" by auto
qed
tts_register_sbts ‹⊤⇩o⇩w› | U
proof-
assume ALA: "Domainp ALA = (λx. x ∈ U)"
have "Domainp ALA ⊤⇩o⇩w" unfolding ALA by simp
then obtain top' where "ALA ⊤⇩o⇩w top'" by blast
then show "∃top'. ALA ⊤⇩o⇩w top'" by auto
qed
end
locale complete_lattice_pair_ow =
cl⇩1: complete_lattice_ow U⇩1 Inf⇩1 Sup⇩1 inf⇩1 le⇩1 ls⇩1 sup⇩1 bot⇩1 top⇩1 +
cl⇩2: complete_lattice_ow U⇩2 Inf⇩2 Sup⇩2 inf⇩2 le⇩2 ls⇩2 sup⇩2 bot⇩2 top⇩2
for U⇩1 :: "'al set" and Inf⇩1 Sup⇩1 inf⇩1 le⇩1 ls⇩1 sup⇩1 bot⇩1 top⇩1
and U⇩2 :: "'bl set" and Inf⇩2 Sup⇩2 inf⇩2 le⇩2 ls⇩2 sup⇩2 bot⇩2 top⇩2
begin
sublocale bounded_lattice_pair_ow ..
sublocale Inf_pair_ow ..
sublocale Sup_pair_ow ..
end
subsubsection‹Transfer rules›
context
includes lifting_syntax
begin
lemma complete_lattice_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"(
(rel_set A ===> A) ===>
(rel_set A ===> A) ===>
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> A) ===>
A ===> A ===>
(=)
)
(complete_lattice_ow (Collect (Domainp A))) class.complete_lattice"
proof-
let ?P =
"(
(rel_set A ===> A) ===>
(rel_set A ===> A) ===>
(A ===> A ===> A) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> (=)) ===>
(A ===> A ===> A) ===>
A ===> A ===>
(=)
)"
let ?complete_lattice_ow = "(complete_lattice_ow (Collect (Domainp A)))"
let ?Inf_Sup_UNIV =
"(λF'::'b set ⇒ 'b. (F' ` Pow UNIV ⊆ UNIV))"
have rrng:
"((A2 ∧ A3 ∧ A4 ∧ A5 ∧ A1 ∧ A6 ∧ A7 ∧ A8 ∧ A9 ∧ A10 ∧ A11) = F') ⟹
((A1 ∧ A2 ∧ A3 ∧ A4 ∧ A5 ∧ A6 ∧ A7 ∧ A8 ∧ A9 ∧ A10 ∧ A11) = F')"
for A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 F'
by auto
have
"?P
?complete_lattice_ow
(
λInf Sup inf le ls sup bot top.
?Inf_Sup_UNIV Inf ∧ ?Inf_Sup_UNIV Sup ∧ bot ∈ UNIV ∧ top ∈ UNIV ∧
class.complete_lattice Inf Sup inf le ls sup bot top
)"
unfolding
complete_lattice_ow_def class.complete_lattice_def
complete_lattice_ow_axioms_def class.complete_lattice_axioms_def
Inf_ow_def Sup_ow_def bot_ow_def top_ow_def
apply transfer_prover_start
apply transfer_step+
apply(simp, intro ext, rule rrng, intro arg_cong2[where f="(∧)"])
subgoal unfolding Ball_Collect by simp
subgoal unfolding Ball_Collect by simp
subgoal by simp
subgoal by simp
subgoal by simp
subgoal unfolding Ball_Collect[symmetric] by auto
subgoal unfolding Ball_Collect[symmetric] by metis
subgoal unfolding Ball_Collect[symmetric] by auto
subgoal unfolding Ball_Collect[symmetric] by metis
subgoal by simp
subgoal by simp
done
then show ?thesis by simp
qed
end
subsubsection‹Relativization›
context complete_lattice_ow
begin
tts_context
tts: (?'a to U)
rewriting ctr_simps
substituting complete_lattice_ow_axioms and sup_bot.sl_neut.not_empty
eliminating ‹?a ∈ ?A› and ‹?A ⊆ ?B› through