Theory Concrete
section ‹Concrete setting›
theory Concrete
imports Syntactic_Criteria
begin
datatype level = Lo | Hi
lemma [simp]: "⋀ l. l ≠ Hi ⟷ l = Lo" and
[simp]: "⋀ l. Hi ≠ l ⟷ Lo = l" and
[simp]: "⋀ l. l ≠ Lo ⟷ l = Hi" and
[simp]: "⋀ l. Lo ≠ l ⟷ Hi = l"
by (metis level.exhaust level.simps(2))+
lemma [dest]: "⋀ l A. ⟦l ∈ A; Lo ∉ A⟧ ⟹ l = Hi" and
[dest]: "⋀ l A. ⟦l ∈ A; Hi ∉ A⟧ ⟹ l = Lo"
by (metis level.exhaust)+
declare level.split[split]
instantiation level :: complete_lattice
begin
definition top_level: "top ≡ Hi"
definition bot_level: "bot ≡ Lo"
definition inf_level: "inf l1 l2 ≡ if Lo ∈ {l1,l2} then Lo else Hi"
definition sup_level: "sup l1 l2 ≡ if Hi ∈ {l1,l2} then Hi else Lo"
definition less_eq_level: "less_eq l1 l2 ≡ (l1 = Lo ∨ l2 = Hi)"
definition less_level: "less l1 l2 ≡ l1 = Lo ∧ l2 = Hi"
definition Inf_level: "Inf L ≡ if Lo ∈ L then Lo else Hi"
definition Sup_level: "Sup L ≡ if Hi ∈ L then Hi else Lo"
instance
proof qed (auto simp: top_level bot_level inf_level sup_level
less_eq_level less_level Inf_level Sup_level)
end
lemma sup_eq_Lo[simp]: "sup a b = Lo ⟷ a = Lo ∧ b = Lo"
by (auto simp: sup_level)