(* Title: HOLCF/One.thy ID: $Id: One.thy,v 1.18 2007/10/21 12:21:48 wenzelm Exp $ Author: Oscar Slotosch The unit domain. *) header {* The unit domain *} theory One imports Lift begin types one = "unit lift" translations "one" <= (type) "unit lift" constdefs ONE :: "one" "ONE == Def ()" text {* Exhaustion and Elimination for type @{typ one} *} lemma Exh_one: "t = ⊥ ∨ t = ONE" apply (unfold ONE_def) apply (induct t) apply simp apply simp done lemma oneE: "[|p = ⊥ ==> Q; p = ONE ==> Q|] ==> Q" apply (rule Exh_one [THEN disjE]) apply fast apply fast done lemma dist_less_one [simp]: "¬ ONE \<sqsubseteq> ⊥" apply (unfold ONE_def) apply simp done lemma dist_eq_one [simp]: "ONE ≠ ⊥" "⊥ ≠ ONE" apply (unfold ONE_def) apply simp_all done lemma compact_ONE [simp]: "compact ONE" by (rule compact_chfin) text {* Case analysis function for type @{typ one} *} definition one_when :: "'a::pcpo -> one -> 'a" where "one_when = (Λ a. strictify·(Λ _. a))" translations "case x of CONST ONE => t" == "CONST one_when·t·x" "Λ (CONST ONE). t" == "CONST one_when·t" lemma one_when1 [simp]: "(case ⊥ of ONE => t) = ⊥" by (simp add: one_when_def) lemma one_when2 [simp]: "(case ONE of ONE => t) = t" by (simp add: one_when_def) lemma one_when3 [simp]: "(case x of ONE => ONE) = x" by (rule_tac p=x in oneE, simp_all) end
lemma Exh_one:
t = UU ∨ t = ONE
lemma oneE:
[| p = UU ==> Q; p = ONE ==> Q |] ==> Q
lemma dist_less_one:
¬ ONE << UU
lemma dist_eq_one:
ONE ≠ UU
UU ≠ ONE
lemma compact_ONE:
compact ONE
lemma one_when1:
(case UU of ONE => t) = UU
lemma one_when2:
(case ONE of ONE => t) = t
lemma one_when3:
(case x of ONE => ONE) = x