fact: Fixpoint fusion {A} (compare : A -> A -> comparison)(l1 l2 : list A) := let fix aux l2 {struct l2}:= match l1,l2 with | nil,_ => l2 | _,nil => l1 | a1::l1',a2::l2' => match compare a1 a2 with Lt => a2 :: aux l2' | Eq => a1 :: fusion compare l1' l2' | Gt => a1 :: fusion compare l1' l2 end end in aux l2.
imports: Coq(List) Addition_Chains PArith