proposition: Lemma del_tail_app n d d' : n <= nb_digits d' -> del_tail n (app d d') = app d (del_tail n d').
proof: Proof. rewrite nb_digits_spec; intro Hn. unfold del_tail. rewrite <-(of_list_to_list (rev (app d d'))), rev_spec, app_spec. rewrite List.rev_app_distr, <-!rev_spec, <-app_spec, of_list_to_list. rewrite del_head_app; [|now rewrite nb_digits_spec, rev_spec, List.rev_length]. apply to_list_inj. rewrite rev_spec, !app_spec, !rev_spec. now rewrite List.rev_app_distr, List.rev_involutive. Qed.
imports: Decimal Arith ZArith