Divide by a monic divisor, through the dense representation: two
toDense and two ofDense conversions around DensePoly.divModMonic.
Equations
Instances For
Field-style division with remainder, through the dense representation.
Equations
Instances For
Euclidean gcd, through the dense representation: the dense cost at
the degree, whatever the term count. A caller with a two-term input of
degree 10^6 should expect this to cost what a dense gcd at degree
10^6 costs.
Instances For
Exact division by a monic divisor: divModMonic with a
zero-remainder test.
Equations
- s.divExactMonic? t ht = if (s.divModMonic t ht).snd = 0 then some (s.divModMonic t ht).fst else none
Instances For
Equations
- Hex.SparsePoly.instDivOfOneOfAddOfSubOfMul = { div := fun (s t : Hex.SparsePoly R) => (s.divMod t).fst }
Equations
- Hex.SparsePoly.instModOfOneOfAddOfSubOfMulOfDiv = { mod := fun (s t : Hex.SparsePoly R) => (s.divMod t).snd }
Divide by the monomial x^e, the one division that stays sparse:
none unless every stored exponent is at least e, and otherwise a
subtraction on each exponent, O(s) with no filtering.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multiplying back by the monomial undoes divMonomial?.
Divisibility transports back from the dense representation.
Divisibility transports to the dense representation.
The degree transports through ofDense.
The quotient and remainder reconstruct the dividend, transported
from DensePoly.DivModLaws.
The remainder degree drops below a positive divisor degree,
transported from DensePoly.DivModLaws.
The monic division satisfies the division identity. It carries
[Div S] and [DivModLaws S] even though divModMonic does not,
and that is not an oversight: the dense layer proves the monic identity
by routing through divMod, so there is no unconditional dense
statement to transport.
Exact monic division returns exactly the cofactors: the forward direction is the division identity with a zero remainder, the reverse is dense monic cancellation applied to the two reconstructions.
Exact monic division succeeds exactly on multiples. A monic divisor
is nonzero, so no t ≠ 0 side condition is needed.
The gcd divides the left argument, transported from
DensePoly.GcdLaws.
The gcd divides the right argument.
Common divisors divide the gcd.