Theory SML_Linorders
section‹Relativization of the results about linear orders›
theory SML_Linorders
imports SML_Semilattices
begin
subsection‹Linear orders›
subsubsection‹Definitions and further properties›
locale linorder_ow = order_ow +
assumes linear: "⟦ x ∈ U; y ∈ U ⟧ ⟹ x ≤⇩o⇩w y ∨ y ≤⇩o⇩w x"
begin
sublocale min:
semilattice_order_ow U ‹(λx y. (with (≤⇩o⇩w) : «min» x y))› ‹(≤⇩o⇩w)› ‹(<⇩o⇩w)›
apply unfold_locales
subgoal unfolding min.with_def by simp
subgoal by (metis linear order_trans min.with_def)
subgoal unfolding min.with_def by (auto dest: linear simp: antisym)
subgoal unfolding min.with_def by simp
subgoal unfolding min.with_def by (simp add: eq_iff)
subgoal unfolding min.with_def by (simp add: less_le)
done
sublocale max:
semilattice_order_ow U ‹(λx y. (with (≤⇩o⇩w) : «max» x y))› ‹(≥⇩o⇩w)› ‹(>⇩o⇩w)›
apply unfold_locales
subgoal unfolding max.with_def by simp
subgoal by (metis linear order_trans max.with_def)
subgoal unfolding max.with_def by (auto dest: linear simp: antisym)
subgoal unfolding max.with_def by simp
subgoal unfolding max.with_def by (auto dest: linear simp: antisym)
subgoal unfolding max.with_def by (auto dest: linear simp: less_le_not_le)
done
end
locale ord_linorder_ow =
ord?: ord_ow U⇩1 le⇩1 ls⇩1 + lo?: linorder_ow U⇩2 le⇩2 ls⇩2
for U⇩1 :: "'ao set" and le⇩1 ls⇩1 and U⇩2 :: "'bo set" and le⇩2 ls⇩2
begin
sublocale ord_order_ow ..
end
locale preorder_linorder_ow =
po?: preorder_ow U⇩1 le⇩1 ls⇩1 + lo?: linorder_ow U⇩2 le⇩2 ls⇩2
for U⇩1 :: "'ao set" and le⇩1 ls⇩1 and U⇩2 :: "'bo set" and le⇩2 ls⇩2
begin
sublocale preorder_order_ow ..
end
locale order_linorder_ow =
order?: order_ow U⇩1 le⇩1 ls⇩1 + lo?: linorder_ow U⇩2 le⇩2 ls⇩2
for U⇩1 :: "'ao set" and le⇩1 ls⇩1 and U⇩2 :: "'bo set" and le⇩2 ls⇩2
begin
sublocale order_pair_ow ..
end
locale linorder_pair_ow =
lo⇩1?: linorder_ow U⇩1 le⇩1 ls⇩1 + lo⇩2?: linorder_ow U⇩2 le⇩2 ls⇩2
for U⇩1 :: "'ao set" and le⇩1 ls⇩1 and U⇩2 :: "'bo set" and le⇩2 ls⇩2
begin
sublocale order_linorder_ow ..
end
subsubsection‹Transfer rules›
context
includes lifting_syntax
begin
lemma linorder_transfer[transfer_rule]:
assumes [transfer_rule]: "bi_unique A" "right_total A"
shows
"((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=))
(linorder_ow (Collect (Domainp A))) class.linorder"
unfolding
linorder_ow_def class.linorder_def
linorder_ow_axioms_def class.linorder_axioms_def
apply transfer_prover_start
apply transfer_step+
by simp
end
subsubsection‹Relativization›
context linorder_ow
begin
tts_context
tts: (?'a to U)
rewriting ctr_simps
substituting linorder_ow_axioms
eliminating through