Documentation

HexPolyFp.SquareFree.Algebra

One square-free factor together with its multiplicity.

  • factor : FpPoly p

    The square-free factor polynomial.

  • multiplicity : Nat

    The exponent with which factor divides the original polynomial.

Instances For

    A square-free decomposition records the scalar unit and the nonconstant factors.

    • unit : ZMod64 p

      The leading-coefficient scalar unit pulled out of the polynomial.

    • factors : List (SquareFreeFactor p)

      The square-free factors together with their multiplicities.

    Instances For

      Detect the unit polynomial 1.

      Equations
      Instances For
        def Hex.FpPoly.pow {p : Nat} [ZMod64.Bounds p] (f : FpPoly p) (n : Nat) :

        Polynomial exponentiation uses square-and-multiply on the exponent bits.

        Equations
        Instances For
          @[irreducible]
          def Hex.FpPoly.pow.go {p : Nat} [ZMod64.Bounds p] (acc base : FpPoly p) (k : Nat) :
          Equations
          Instances For

            Multiply the factors in a square-free decomposition with their multiplicities.

            Equations
            Instances For

              Extract the formal p-th root by keeping exactly the coefficients whose degrees are multiples of p.

              Equations
              Instances For

                Nonzero executable FpPoly values have nonzero leading coefficient.

                The proof converts isZero = false to positive dense-polynomial size, then uses the invariant that the last stored coefficient of a positive-size dense polynomial is nonzero.

                Split off the leading coefficient so the recursive Yun loop can work on a monic input.

                Equations
                Instances For
                  @[irreducible]

                  Monic-normalized gcd: the canonical monic associate of DensePoly.gcd c w.

                  Handling the Yun square-free loop's gcd through this keeps every intermediate polynomial monic. A raw DensePoly.gcd of a coprime pair can be a non-trivial constant unit over F_p for p > 2 (e.g. gcd (x^2+1) (x+1) = 2 over F_5); emitting c / gcd c w then leaks that scalar into the square-free factor, breaking the exact reconstruction weightedProduct = f. The monic associate divides c and w exactly as the raw gcd does, so every reconstruction identity carries over, but the emitted quotient stays monic.

                  Equations
                  Instances For