Computable analysis · ComplexPolynomial · fd889115 k1
Definitionliuyao_ca_fd889115_k1_Analysis_ComplexPolynomialca-fd889115-k1
Private dependency for the Distribution Theory mission. Module ComputableAnalysis/ComplexPolynomial.lean from the frozen computable-analysis foundation with kernel-checked rational decision proofs.
Definition code
import Definitions.Def_liuyao_ca_fd889115_k1_Analysis_Basic
set_option autoImplicit true
namespace ComputableAnalysis
namespace CPoly
abbrev Coeffs := List QComplex
def eval (coeffs : Coeffs) (z : QComplex) : QComplex :=
coeffs.foldr (fun c acc => QComplex.add c (QComplex.mul z acc)) QComplex.zero
def degreeBound (coeffs : Coeffs) : Nat :=
coeffs.length
def coeffNonzero (c : QComplex) : Bool :=
decide (c != QComplex.zero)
def isZeroPoly (coeffs : Coeffs) : Bool :=
coeffs.all (fun c => decide (c = QComplex.zero))
def positiveDegree (coeffs : Coeffs) : Prop :=
Exists fun n : Nat => Exists fun c : QComplex =>
coeffs[n]? = some c /\ n != 0 /\ c != QComplex.zero
def hasExactRoot (coeffs : Coeffs) (z : QComplex) : Prop :=
eval coeffs z = QComplex.zero
end CPoly
end ComputableAnalysis