Skip to main content
danger

This module's API reference is not yet ready.

danger

This API is bloated for no reason. It will be revised and simplified until there are more diverse use cases.

danger

There is thought to move polynomials API to "Algebraic Extra" module.

Kone: Polynomial

This module extends module "algebraic" and provides the basic concept of working with univariate and multivariate polynomials and rational functions over any specified ring in so-called polynomial and rational functions spaces and their implementations.

Applying the dependencies​

build.gradle.kts
dependencies {
implementation("dev.lounres:kone.polynomial:0.0.0-experiment-2025.7.7.14")
}

πŸ’­ Concept: "polynomial" and other terms​

Let us remind common terms and introduce Kone-specific ones:

  • Free variable or indeterminate is just a formal symbol. Like xx, yy, zz, nn, mm, Ξ±\alpha, ΞΆ\zeta, etc. In Kone variable can be described as absolutely arbitrary string wrapped in LabeledVariable value class.
  • Monomial or term of polynomial (over a ring RR) is a formal finite (associative commutative) product of an element of RR and free variables. If used variables are x1x_1, x2x_2, ..., xnx_n, then monomial is usually represented as a product aβ€…β€Šx1d1x2d2…xndna \; x_1^{d_1} x_2^{d_2} \dots x_n^{d_n} for some natural did_i. aa is called a coefficient of the monomial and mapping {x1β†’d1,…,xnβ†’dn}\{x_1 \to d_1, \dots, x_n \to d_n\} is called signature of the monomial.
  • Polynomial (over a ring RR) is a formal finite (associative commutative) sum of monomials.
  • If a polynomial does not involve any variable (it is equal to an element of the ring RR), it is called constant. If it involves a single variable, it is called univariate. If it involves several variables, it is called multivariate.
  • Polynomials of variables x1x_1, ..., xnx_n over ring RR form a ring that is called polynomial space over RR and is denoted as R[x1,…,xn]R[x_1, \dots, x_n].
  • Given a total order on signatures, the term with the greatest signature is called a leading term of the polynomial. Its coefficient is called a leading coefficient of the polynomial. And its signature is called a leading signature of the polynomial.

Polynomial spaces interfaces​

In a polynomial space over ring R we specify algebraic operations on polynomials, and algebraic operations on polynomials and constants. See API reference for PolynomialSpace and MultivariatePolynomialSpace.

There are also division operations in case of a field R See PolynomialSpaceOverField and MultivariatePolynomialSpaceOverField.

Implementations of polynomial spaces​

In Kone, there are two types of polynomial representation:

  1. One can represent a univariate polynomial a0+β‹―+anxna_0 + \dots + a_n x^n as a list [a0,…,an][a_0, \dots, a_n]. ListPolynomial implements this behaviour.
  2. One can represent a multivariate polynomial βˆ‘i=1naix1d1,i…xkdk,i\sum_{i=1}^n a_i x_1^{d_{1, i}} \dots x_k^{d_{k, i}} as a map {s1β†’a1,…,snβ†’an}\{s_1 \to a_1, \dots, s_n \to a_n\} where each sis_i is a signature of aix1d1,i…xkdk,ia_i x_1^{d_{1, i}} \dots x_k^{d_{k, i}} and is represented as a map {x1β†’d1,i,…,xkβ†’dk,i}\{x_1 \to d_{1, i}, \dots, x_k \to d_{k, i}\}. LabelledPolynomial implements this behaviour.

Both types of polynomials have associated polynomial spaces ( ListPolynomialSpace and LabelledPolynomial) that are constructed on provided ring.

Rational functions spaces interfaces​

In a rational functions space over ring R we specify algebraic operations on constants, polynomials, (variables,) and rational functions. See API reference for RationalFunctionSpace and RationalFunctionSpaceOverField.

Implementations of rational functions spaces​

In Kone, there are two types of rational functions: ListRationalFunction and LabeledRationalFunction. They both are just represented as fractions of corresponding polynomial types. Both types of rational functions have associated spaces ( ListRationalFunctionSpace and LabeledRationalFunctionSpace) that are constructed on provided ring.