fact: Fixpoint addXn (n : N) p q {struct p} := match p, q with | Pc a , q => addXn_const n a q | PX a n' p', Pc b => if (n == 0)%C then PX (a + b) n' p' else PX b (cast n) (PX a n' p') | PX a n' p', PX b m q' => if (n == 0)%C then if (n' == m)%C then PX (a + b) n' (addXn 0 p' q') else if (n' < m)%C then PX (a + b) n' (addXn 0 p' (PX 0 (m - n') q')) else PX (a + b) m (addXn (cast (n' - m)) p' q') else addXn (n + cast n') p' (addXn_const 0 b (addXn_const n a (PX 0 m q'))) end.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat div seq zmodp) mathcomp(path choice fintype tuple finset ssralg bigop poly polydiv) CoqEAL(param refinements pos hrel poly_op)