Dense-polynomial negation is involutive.
Natural powers by binary exponentiation.
Equations
Instances For
Natural-number casts are constant polynomials, reusing zero and one.
Numerals are constant polynomials, reusing zero and one.
Equations
- Hex.DensePoly.instOfNat 0 = { ofNat := Zero.zero }
- Hex.DensePoly.instOfNat 1 = { ofNat := One.one }
- Hex.DensePoly.instOfNat n_2.succ.succ = { ofNat := Hex.DensePoly.C (OfNat.ofNat (n_2 + 2)) }
Natural scalar multiplication is multiplication by the cast constant.
Equations
- Hex.DensePoly.instNSMul = { smul := fun (n : Nat) (p : Hex.DensePoly R) => ↑n * p }
Natural powers of dense polynomials.
Equations
- Hex.DensePoly.instNPow = { hPow := Hex.DensePoly.natPow }
Integer casts are signed constant polynomials.
Equations
- Hex.DensePoly.instIntCast = { intCast := fun (i : Int) => match i with | Int.ofNat n => ↑n | Int.negSucc n => -↑(n + 1) }
Integer scalar multiplication is signed natural scalar multiplication.
Equations
- Hex.DensePoly.instZSMul = { smul := fun (i : Int) (p : Hex.DensePoly R) => match i with | Int.ofNat n => n • p | Int.negSucc n => -((n + 1) • p) }
A numeral polynomial stores its value in coefficient zero only.
A cast-natural polynomial stores its value in coefficient zero only.
Dense polynomials over a lightweight commutative ring form a lightweight semiring.
Equations
- One or more equations did not get rendered due to their size.
Dense polynomials over a lightweight commutative ring form a lightweight ring.
Equations
- One or more equations did not get rendered due to their size.
Dense polynomial multiplication is commutative when coefficient multiplication is.
Equations
- Hex.instGrindCommRingDensePoly = { toRing := Hex.instGrindRingDensePoly, mul_comm := ⋯ }