Documentation

BSeries.Algebra.ComputablePolynomial

Computable polynomials #

Mathlib's Polynomial is noncomputable (it is Finsupp-based), which rules out native_decide verification of identities in polynomial or rational-function coefficients. This file provides CPoly K, a computable polynomial ring over a DecidableEq commutative ring, as trimmed coefficient lists (little-endian, no trailing zeros).

The ring axioms are not proven from scratch: the coefficient-list operations are transported along the injective evaluation CPoly.toPoly : CPoly K → Polynomial K via Function.Injective.commRing.

The intended use is the generic-parameter verification of order conditions for the parametric EES(2,5;x) family: with a computable fraction field of CPoly the symbolic identities of arXiv:2509.20599, Theorem E.1, become native_decide checks.

def BSeries.CPoly (K : Type u) [Zero K] [DecidableEq K] :

Trailing-zero-free little-endian coefficient lists.

Equations
Instances For
    def BSeries.CPoly.trim {L : Type u} [Zero L] [DecidableEq L] (l : List L) :

    Remove trailing zeros.

    Equations
    Instances For

      Raw coefficient-list operations #

      def BSeries.CPoly.rawAdd {K : Type u} [CommRing K] :
      List KList KList K

      Pointwise addition (little-endian, ragged).

      Equations
      Instances For
        def BSeries.CPoly.rawNeg {K : Type u} [CommRing K] (l : List K) :

        Negation.

        Equations
        Instances For
          def BSeries.CPoly.rawMul {K : Type u} [CommRing K] :
          List KList KList K

          Convolution product.

          Equations
          Instances For
            noncomputable def BSeries.CPoly.toPolyList {K : Type u} [CommRing K] :

            Interpret a coefficient list as a polynomial.

            Equations
            Instances For
              theorem BSeries.CPoly.toPolyList_map_mul {K : Type u} [CommRing K] (c : K) (l : List K) :
              toPolyList (List.map (fun (x : K) => c * x) l) = Polynomial.C c * toPolyList l
              noncomputable def BSeries.CPoly.toPoly {K : Type u} [CommRing K] [DecidableEq K] (p : CPoly K) :

              Interpret a trimmed coefficient list as a polynomial.

              Equations
              Instances For

                Ring structure by injective transfer #

                def BSeries.CPoly.C {K : Type u} [CommRing K] [DecidableEq K] (c : K) :

                Constant polynomials.

                Equations
                Instances For
                  @[implicit_reducible]
                  Equations
                  @[implicit_reducible]
                  instance BSeries.CPoly.instOne {K : Type u} [CommRing K] [DecidableEq K] :
                  Equations
                  @[implicit_reducible]
                  instance BSeries.CPoly.instAdd {K : Type u} [CommRing K] [DecidableEq K] :
                  Equations
                  @[implicit_reducible]
                  instance BSeries.CPoly.instMul {K : Type u} [CommRing K] [DecidableEq K] :
                  Equations
                  @[implicit_reducible]
                  instance BSeries.CPoly.instNeg {K : Type u} [CommRing K] [DecidableEq K] :
                  Equations
                  @[implicit_reducible]
                  Equations
                  theorem BSeries.CPoly.toPoly_add {K : Type u} [CommRing K] [DecidableEq K] (p q : CPoly K) :
                  (p + q).toPoly = p.toPoly + q.toPoly
                  theorem BSeries.CPoly.toPoly_mul {K : Type u} [CommRing K] [DecidableEq K] (p q : CPoly K) :
                  (p * q).toPoly = p.toPoly * q.toPoly
                  @[implicit_reducible]

                  The commutative ring structure: axioms transported from Polynomial K through the injection, data fully computable.

                  Equations
                  noncomputable def BSeries.CPoly.toPolyHom {K : Type u} [CommRing K] [DecidableEq K] :

                  toPoly as a ring homomorphism.

                  Equations
                  Instances For

                    The polynomial variable.

                    Equations
                    Instances For

                      No zero divisors, transported along the injection.

                      Unverified division and gcd #

                      Polynomial long division and the Euclidean algorithm, for use as runtime-checked reductions: callers verify the defining equations by a decidable guard, so no correctness theory is needed here.

                      def BSeries.CPoly.rawDivModAux {L : Type u} [Field L] [DecidableEq L] (q : List L) :
                      List LList L × List L

                      One pass of polynomial long division (fuelled; little-endian).

                      Equations
                      Instances For
                        def BSeries.CPoly.rawDivMod {L : Type u} [Field L] [DecidableEq L] (p q : List L) :

                        Quotient and remainder of polynomial division (unverified).

                        Equations
                        Instances For
                          def BSeries.CPoly.rawGcd {L : Type u} [Field L] [DecidableEq L] :
                          List LList LList L

                          Euclidean gcd, normalised to be monic (unverified).

                          Equations
                          Instances For
                            def BSeries.CPoly.cGcd {L : Type u} [Field L] [DecidableEq L] (p q : CPoly L) :

                            Monic gcd of two computable polynomials (unverified).

                            Equations
                            Instances For
                              def BSeries.CPoly.cDiv {L : Type u} [Field L] [DecidableEq L] (p q : CPoly L) :

                              Quotient of polynomial division (unverified).

                              Equations
                              Instances For