proposition: Lemma lagrange_add_zero {R: fieldType} (x: R) (l1 l2: seq (R * R)) (r: seq R): uniq (unzip1 (l1 ++ zero_points r)) -> uniq (unzip1 (l2 ++ zero_points r)) -> x \in r -> (lagrange_poly (l1 ++ zero_points r) + lagrange_poly (l2 ++ zero_points r)).[x] = 0.
proof: Proof. rewrite hornerD. generalize dependent l2. generalize dependent l1. elim: r => [// | a r IHr] l1 l2 Huniq1 Huniq2 Hin. rewrite /= in_cons in Hin. destruct (x == a) eqn:Heq. - move /eqP in Heq. rewrite Heq (lagrange_poly_correct a 0) //. 1: rewrite (lagrange_poly_correct a 0) ?GRing.addr0 //. all: by rewrite mem_cat in_cons eq_refl Bool.orb_true_r. - rewrite -!cat_rcons -!cats1 in Huniq1 Huniq2*. by apply: IHr. Qed.
imports: Relational(OrderEnrichedCategory GenericRulesSimple) mathcomp(all_ssreflect all_algebra reals distr realsum ssrnat ssreflect ssrfun ssrbool ssrnum eqtype choice seq) Mon(SPropBase) Crypt(Axioms ChoiceAsOrd SubDistr Couplings UniformDistrLemmas FreeProbProg Theta_dens RulesStateProb pkg_core_definition choice_type pkg_composition pkg_rhl Package Prelude) extructures(ord fset fmap) Equations(Equations)