equal
deleted
inserted
replaced
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" |