The coefficient of degree i in the product of two coefficient
functions.
Equations
- Hex.TSeries.convCoeff f g i = List.foldl (fun (acc : R) (j : Nat) => acc + f j * g (i - j)) 0 (List.range (i + 1))
Instances For
The zero truncated series.
Equations
- Hex.TSeries.zero = Hex.TSeries.ofFn fun (x : Nat) => 0
Instances For
The constant-one truncated series.
Equations
- Hex.TSeries.one = Hex.TSeries.ofFn fun (i : Nat) => if i = 0 then 1 else 0
Instances For
Equations
- Hex.TSeries.instZero = { zero := Hex.TSeries.zero }
Equations
- Hex.TSeries.instOneOfZero = { one := Hex.TSeries.one }
Equations
- Hex.TSeries.instAddOfZero = { add := Hex.TSeries.add }
Equations
- Hex.TSeries.instNegOfZero = { neg := Hex.TSeries.neg }
Equations
- Hex.TSeries.instSubOfZero = { sub := Hex.TSeries.sub }
The constant truncated series.
Equations
- Hex.TSeries.C c = Hex.TSeries.ofFn fun (i : Nat) => if i = 0 then c else 0
Instances For
The indeterminate x, which is zero at precisions zero and one.
Equations
- Hex.TSeries.X = Hex.TSeries.ofFn fun (i : Nat) => if i = 1 then 1 else 0
Instances For
Multiply only through degree m - 1, zeroing the remaining stored
coefficients.
Equations
- Hex.TSeries.mulUpTo m a b = Hex.TSeries.ofFn fun (i : Nat) => if i < m then Hex.TSeries.convCoeff a.coeff b.coeff i else 0
Instances For
Allocation-conscious implementation of mulUpTo. It writes only the
requested prefix into one uniquely owned zero buffer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compiled bounded multiplication uses the single-buffer implementation.
Every coefficient of the zero series is zero.
Coefficient extraction commutes with a left fold of series addition.
The indeterminate has zero constant coefficient at every precision.
Embedding one as a constant series agrees with the series one.
Embedding zero as a constant series agrees with the series zero.
Bounded multiplication agrees with multiplication below its work bound and is zero above it.
Natural casts are constant series.
Equations
- Hex.TSeries.instNatCast = { natCast := fun (k : Nat) => match k with | 0 => 0 | 1 => 1 | k.succ.succ => Hex.TSeries.C ↑(k + 2) }
Natural numerals are constant series.
Equations
- Hex.TSeries.instOfNat 0 = { ofNat := 0 }
- Hex.TSeries.instOfNat 1 = { ofNat := 1 }
- Hex.TSeries.instOfNat k_2.succ.succ = { ofNat := Hex.TSeries.C (OfNat.ofNat (k_2 + 2)) }
Natural scalar multiplication is multiplication by a constant series.
Equations
- Hex.TSeries.instNSMul = { smul := fun (k : Nat) (a : Hex.TSeries R n) => ↑k * a }
Integer casts are constant series.
Equations
- Hex.TSeries.instIntCast = { intCast := fun (i : Int) => match i with | Int.ofNat k => ↑k | Int.negSucc k => -↑(k + 1) }
Integer scalar multiplication uses the standard signed natural action.
Equations
- Hex.TSeries.instZSMul = { smul := fun (i : Int) (a : Hex.TSeries R n) => match i with | Int.ofNat k => k • a | Int.negSucc k => -((k + 1) • a) }
Zero is a right identity for truncated-series addition.
Truncated-series addition is commutative.
One is a right identity for truncated-series multiplication.
One is a left identity for truncated-series multiplication.
Zero annihilates truncated-series multiplication on the left.
Zero annihilates truncated-series multiplication on the right.
The zeroth power of a truncated series is one.
Direct-definition form of pow_zero, for bridges that also install a
second lawful power operation.
The first power of a truncated series is the series itself.
Successor numerals in truncated series agree with addition by one.
Natural numerals agree with the natural-cast operation.
Natural scalar multiplication is multiplication by the corresponding constant series.
Additive negation cancels a truncated series.
Subtraction agrees with addition of the negation.
Integer casts commute with negation.
Truncated-series multiplication is commutative.
Multiplication by X ^ k shifts coefficients upward by k, with
coefficients below that degree equal to zero.
Fixed-precision truncated series form a lightweight commutative ring.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Hex.TSeries.instCommRing = { toRing := Hex.TSeries.instRingOfCommRing, mul_comm := ⋯ }