src/HOL/Library/Polynomial.thy
changeset 46031 ac6bae9fdc2f
parent 45928 874845660119
child 47002 9435d419109a
equal deleted inserted replaced
46030:51b2f3412a03 46031:ac6bae9fdc2f
   145 apply (rule degree_le, simp add: coeff_pCons split: nat.split)
   145 apply (rule degree_le, simp add: coeff_pCons split: nat.split)
   146 apply (rule order_antisym [OF degree_pCons_le])
   146 apply (rule order_antisym [OF degree_pCons_le])
   147 apply (rule le_degree, simp)
   147 apply (rule le_degree, simp)
   148 done
   148 done
   149 
   149 
   150 lemma pCons_0_0 [simp]: "pCons 0 0 = 0"
   150 lemma pCons_0_0 [simp, code_post]: "pCons 0 0 = 0"
   151 by (rule poly_ext, simp add: coeff_pCons split: nat.split)
   151 by (rule poly_ext, simp add: coeff_pCons split: nat.split)
   152 
   152 
   153 lemma pCons_eq_iff [simp]:
   153 lemma pCons_eq_iff [simp]:
   154   "pCons a p = pCons b q \<longleftrightarrow> a = b \<and> p = q"
   154   "pCons a p = pCons b q \<longleftrightarrow> a = b \<and> p = q"
   155 proof (safe)
   155 proof (safe)
  1503 
  1503 
  1504 code_datatype "0::'a::zero poly" pCons
  1504 code_datatype "0::'a::zero poly" pCons
  1505 
  1505 
  1506 quickcheck_generator poly constructors: "0::'a::zero poly", pCons
  1506 quickcheck_generator poly constructors: "0::'a::zero poly", pCons
  1507 
  1507 
  1508 declare pCons_0_0 [code_post]
       
  1509 
       
  1510 instantiation poly :: ("{zero, equal}") equal
  1508 instantiation poly :: ("{zero, equal}") equal
  1511 begin
  1509 begin
  1512 
  1510 
  1513 definition
  1511 definition
  1514   "HOL.equal (p::'a poly) q \<longleftrightarrow> p = q"
  1512   "HOL.equal (p::'a poly) q \<longleftrightarrow> p = q"