Definition ccons (t : term) (c : coef) :=
if term_zerop t then c else t :: c.

Lemma ccons_c t c : {c[ccons t c]} = ({m[t]} + {c[c]})%f.
Fixpoint cadd (a b : coef) : coef :=
match a with
| nil => b
| t1 :: a1 =>
(fix cadd1 (b : coef) : coef :=
match  b with
| nil => a
| t2 :: b1 =>
match term_cmp t1 t2 with
| Eq => ccons (term_add t1 t2) (cadd a1 b1)
| Lt => ccons t1 (cadd a1 b)
| Gt => ccons t2 (cadd1 b1)
end
end) b
end.