src/HOL/HOL.thy
changeset 31956 c3844c4d0c2c
parent 31902 862ae16a799d
child 31998 2c7a24f74db9
equal deleted inserted replaced
31951:9787769764bb 31956:c3844c4d0c2c
  1867 text {* Equality *}
  1867 text {* Equality *}
  1868 
  1868 
  1869 declare simp_thms(6) [code nbe]
  1869 declare simp_thms(6) [code nbe]
  1870 
  1870 
  1871 setup {*
  1871 setup {*
  1872   Code.add_const_alias @{thm equals_eq}
  1872   Sign.add_const_constraint (@{const_name eq}, SOME @{typ "'a\<Colon>type \<Rightarrow> 'a \<Rightarrow> bool"})
       
  1873 *}
       
  1874 
       
  1875 lemma equals_alias_cert: "OFCLASS('a, eq_class) \<equiv> ((op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool) \<equiv> eq)" (is "?ofclass \<equiv> ?eq")
       
  1876 proof
       
  1877   assume "PROP ?ofclass"
       
  1878   show "PROP ?eq"
       
  1879     by (tactic {* ALLGOALS (rtac (Drule.unconstrainTs @{thm equals_eq})) *}) 
       
  1880       (fact `PROP ?ofclass`)
       
  1881 next
       
  1882   assume "PROP ?eq"
       
  1883   show "PROP ?ofclass" proof
       
  1884   qed (simp add: `PROP ?eq`)
       
  1885 qed
       
  1886   
       
  1887 setup {*
       
  1888   Sign.add_const_constraint (@{const_name eq}, SOME @{typ "'a\<Colon>eq \<Rightarrow> 'a \<Rightarrow> bool"})
       
  1889 *}
       
  1890 
       
  1891 setup {*
       
  1892   Code.add_const_alias @{thm equals_alias_cert}
  1873 *}
  1893 *}
  1874 
  1894 
  1875 hide (open) const eq
  1895 hide (open) const eq
  1876 hide const eq
  1896 hide const eq
  1877 
  1897