YukonModule.ArkLib.ToCompPoly.Univariate.Lagrange.part0
DefinitionYukon_06abc6af2bee1228adb4245ebetter-codes
Source module ArkLib.ToCompPoly.Univariate.Lagrange.
Definition code
/-
Copyright (c) 2025 ArkLib Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
import Definitions.Def_Yukon_5b023a2e28d9b62160ff10b5
import Mathlib.Algebra.Polynomial.Roots
import Mathlib.Data.Nat.Log
import Mathlib.Algebra.Order.Star.Basic
import Mathlib.Algebra.Order.Ring.Nat
import Mathlib.Tactic.Cases
import Mathlib.Order.Lattice.Nat
import Mathlib.Data.List.GetD
import Mathlib.Algebra.GroupWithZero.Nat
import Init
import Mathlib.RingTheory.Polynomial.Basic
import Mathlib.Algebra.Tropical.Basic
import Mathlib.Algebra.Ring.TransferInstance
import Mathlib.Algebra.Polynomial.Inductions
import Mathlib.LinearAlgebra.Lagrange
set_option backward.isDefEq.respectTransparency.types false
/-!
# Additions to `CompPoly.Univariate.Lagrange` not yet upstreamed to CompPoly.
-/
namespace CompPoly.CPolynomial.CLagrange
variable {R ι : Type*} [BEq R] [Field R] [LawfulBEq R] [DecidableEq ι]
lemma interpolation_of_constants (s : Finset ι) (x y : ι → R) (c : R)
(hy : ∀ i ∈ s, y i = c) (hx : Set.InjOn x s) (hs : s.Nonempty) :
interpolate s x y = CPolynomial.C c := by
suffices h : (interpolate s x y).toPoly = (CPolynomial.C c).toPoly from
CPolynomial.ringEquiv.injective h
rw [cinterpolate_eq_interpolate, CPolynomial.C_toPoly]
symm
exact Lagrange.eq_interpolate_of_eval_eq y hx
(lt_of_le_of_lt Polynomial.degree_C_le (by exact_mod_cast Finset.card_pos.mpr hs))
(fun i hi => by simp [hy i hi])
end CompPoly.CPolynomial.CLagrange
Source