src/HOL/Product_Type.thy
changeset 57201 697e0fad9337
parent 57091 1fa9c19ba2c9
child 57233 8fcbfce2a2a9
equal deleted inserted replaced
57200:aab87ffa60cc 57201:697e0fad9337
   137 "less_eq_unit _ _ = True"
   137 "less_eq_unit _ _ = True"
   138 
   138 
   139 definition less_unit :: "unit \<Rightarrow> unit \<Rightarrow> bool" where
   139 definition less_unit :: "unit \<Rightarrow> unit \<Rightarrow> bool" where
   140 "less_unit _ _ = False"
   140 "less_unit _ _ = False"
   141 
   141 
   142 declare less_eq_unit_def [simp] less_unit_def [simp]
   142 declare less_eq_unit_def [simp, abs_def, code_unfold] less_unit_def [simp, abs_def, code_unfold]
   143 
   143 
   144 instance
   144 instance
   145 proof qed auto
   145 proof qed auto
   146 
   146 
   147 end
   147 end
       
   148 
       
   149 instantiation unit :: complete_boolean_algebra begin
       
   150 
       
   151 definition "top = ()"
       
   152 definition "bot = ()"
       
   153 definition [code_unfold]: "sup _ _ = ()"
       
   154 definition [code_unfold]: "inf _ _ = ()"
       
   155 definition "Sup _ = ()"
       
   156 definition "Inf _ = ()"
       
   157 definition [simp, code_unfold]: "uminus = (\<lambda>_ :: unit. ())"
       
   158 
       
   159 instance by intro_classes auto
       
   160 
       
   161 end
       
   162 
       
   163 instance unit :: "{complete_linorder, wellorder}"
       
   164   by intro_classes auto
   148 
   165 
   149 lemma [code]:
   166 lemma [code]:
   150   "HOL.equal (u\<Colon>unit) v \<longleftrightarrow> True" unfolding equal unit_eq [of u] unit_eq [of v] by rule+
   167   "HOL.equal (u\<Colon>unit) v \<longleftrightarrow> True" unfolding equal unit_eq [of u] unit_eq [of v] by rule+
   151 
   168 
   152 code_printing
   169 code_printing