Documentation

HexPoly.PseudoGcd

structure Hex.DensePoly.PseudoResult (R : Type u) [Zero R] [DecidableEq R] :

The multiplier, quotient and remainder of a pseudo-division.

Instances For

    The fixed leading-coefficient exponent, including the zero/smaller-input cases.

    Equations
    Instances For
      def Hex.DensePoly.pseudoDiv {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p q : DensePoly R) :

      Pseudo-division with its actual scalar multiplier. The quotient and remainder reuse pseudoDivMod. On a zero divisor or a smaller dividend the multiplier is one.

      Equations
      Instances For
        @[simp]
        theorem Hex.DensePoly.pseudoDiv_zero_right {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p : DensePoly R) :
        p.pseudoDiv 0 = { multiplier := 1, quotient := 0, remainder := p }
        theorem Hex.DensePoly.pseudoDiv_of_size_lt {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p q : DensePoly R) (h : p.size < q.size) :
        p.pseudoDiv q = { multiplier := 1, quotient := 0, remainder := p }

        An already smaller input requires no cancellation or scaling.

        def Hex.DensePoly.positivePseudoDiv {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] [Neg R] (sign : R → Int) (p q : DensePoly R) :

        Choose a positive multiplier by negating all three outputs together when necessary. The leading-coefficient sign and exponent parity determine the correction, avoiding a sign query on the larger computed power.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Hex.DensePoly.positivePseudoDiv_remainder_lt {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] [Neg R] (sign : R → Int) (p q : DensePoly R) (hq : q ≠ 0) :

          Sign correction cannot increase the stored remainder size, even before any interpretation or algebraic laws are supplied.

          @[irreducible]
          def Hex.DensePoly.pseudoGcd {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p q : DensePoly R) :

          Plain pseudo-gcd. Its recursion decreases the stored size of the second polynomial, with no user bound and no Bézout polynomials. Correctness over a domain is a fraction-field gcd statement, not a gcd statement in R[X].

          Equations
          Instances For
            @[simp]
            theorem Hex.DensePoly.pseudoGcd_zero_right {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p : DensePoly R) :
            p.pseudoGcd 0 = p
            theorem Hex.DensePoly.pseudoGcd_step {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p q : DensePoly R) (hq : q ≠ 0) :

            The recursive equation records an actual division step and its strict descent.

            @[simp]
            theorem Hex.DensePoly.pseudoGcd_zero_left {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (q : DensePoly R) :
            pseudoGcd 0 q = q
            theorem Hex.DensePoly.pseudoDiv_multiplier_ne_zero {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (hone : 1 ≠ 0) (hmul : ∀ (a b : R), a ≠ 0 → b ≠ 0 → a * b ≠ 0) (p q : DensePoly R) (hq : q ≠ 0) :

            A genuine coefficient domain has a nonzero pseudo-division multiplier; no division or field structure on the coefficient type is involved.

            theorem Hex.DensePoly.pseudoDiv_remainder_lt {R : Type u} [Zero R] [DecidableEq R] [One R] [Add R] [Sub R] [Mul R] (p q : DensePoly R) (hq : q ≠ 0) :

            The remainder bound holds without algebraic assumptions on stored coefficients.

            The recorded operation-only power agrees with the ring's natural power.

            Reconstruction uses exactly the multiplier returned by pseudoDiv, including zero dividends and dividends smaller than the divisor.