Formal power series #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines (multivariate) formal power series and develops the basic properties of these objects.
A formal power series is to a polynomial like an infinite sum is to a finite sum.
We provide the natural inclusion from polynomials to formal power series.
Generalities #
The file starts with setting up the (semi)ring structure on multivariate power series.
trunc n φ
truncates a formal power series to the polynomial
that has the same coefficients as φ
, for all m < n
, and 0
otherwise.
If the constant coefficient of a formal power series is invertible, then this formal power series is invertible.
Formal power series over a local ring form a local ring.
Formal power series in one variable #
We prove that if the ring of coefficients is an integral domain, then formal power series in one variable form an integral domain.
The order
of a formal power series φ
is the multiplicity of the variable X
in φ
.
If the coefficients form an integral domain, then order
is a valuation
(order_mul
, le_order_add
).
Implementation notes #
In this file we define multivariate formal power series with
variables indexed by σ
and coefficients in R
as
mv_power_series σ R := (σ →₀ ℕ) → R
.
Unfortunately there is not yet enough API to show that they are the completion
of the ring of multivariate polynomials. However, we provide most of the infrastructure
that is needed to do this. Once I-adic completion (topological or algebraic) is available
it should not be hard to fill in the details.
Formal power series in one variable are defined as
power_series R := mv_power_series unit R
.
This allows us to port a lot of proofs and properties
from the multivariate case to the single variable case.
However, it means that formal power series are indexed by unit →₀ ℕ
,
which is of course canonically isomorphic to ℕ
.
We then build some glue to treat formal power series as if they are indexed by ℕ
.
Occasionally this leads to proofs that are uglier than expected.
Multivariate formal power series, where σ
is the index set of the variables
and R
is the coefficient ring.
Equations
- mv_power_series σ R = ((σ →₀ ℕ) → R)
Instances for mv_power_series
- mv_power_series.inhabited
- mv_power_series.has_zero
- mv_power_series.add_monoid
- mv_power_series.add_group
- mv_power_series.add_comm_monoid
- mv_power_series.add_comm_group
- mv_power_series.nontrivial
- mv_power_series.module
- mv_power_series.is_scalar_tower
- mv_power_series.has_one
- mv_power_series.add_monoid_with_one
- mv_power_series.has_mul
- mv_power_series.semiring
- mv_power_series.comm_semiring
- mv_power_series.ring
- mv_power_series.comm_ring
- mv_power_series.algebra
- mv_power_series.local_ring
- mv_power_series.has_inv
- mv_power_series.inv_one_class
- mv_polynomial.coe_to_mv_power_series
- mv_power_series.algebra_mv_polynomial
- mv_power_series.algebra_mv_power_series
Equations
- mv_power_series.inhabited = {default := λ (_x : σ →₀ ℕ), inhabited.default}
Equations
Equations
Equations
Equations
The n
th monomial with coefficient a
as multivariate formal power series.
Equations
- mv_power_series.monomial R n = linear_map.std_basis R (λ (n : σ →₀ ℕ), R) n
The n
th coefficient of a multivariate formal power series.
Equations
Two multivariate formal power series are equal if all their coefficients are equal.
Two multivariate formal power series are equal if and only if all their coefficients are equal.
Equations
- mv_power_series.has_one = {one := ⇑(mv_power_series.monomial R 0) 1}
Equations
- mv_power_series.add_monoid_with_one = {nat_cast := λ (n : ℕ), ⇑(mv_power_series.monomial R 0) ↑n, add := add_monoid.add mv_power_series.add_monoid, add_assoc := _, zero := add_monoid.zero mv_power_series.add_monoid, zero_add := _, add_zero := _, nsmul := add_monoid.nsmul mv_power_series.add_monoid, nsmul_zero' := _, nsmul_succ' := _, one := 1, nat_cast_zero := _, nat_cast_succ := _}
Equations
- mv_power_series.has_mul = {mul := λ (φ ψ : mv_power_series σ R) (n : σ →₀ ℕ), n.antidiagonal.sum (λ (p : (σ →₀ ℕ) × (σ →₀ ℕ)), ⇑(mv_power_series.coeff R p.fst) φ * ⇑(mv_power_series.coeff R p.snd) ψ)}
Equations
- mv_power_series.semiring = {add := add_monoid_with_one.add mv_power_series.add_monoid_with_one, add_assoc := _, zero := add_monoid_with_one.zero mv_power_series.add_monoid_with_one, zero_add := _, add_zero := _, nsmul := add_monoid_with_one.nsmul mv_power_series.add_monoid_with_one, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := has_mul.mul mv_power_series.has_mul, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := add_monoid_with_one.one mv_power_series.add_monoid_with_one, one_mul := _, mul_one := _, nat_cast := add_monoid_with_one.nat_cast mv_power_series.add_monoid_with_one, nat_cast_zero := _, nat_cast_succ := _, npow := monoid_with_zero.npow._default add_monoid_with_one.one has_mul.mul mv_power_series.one_mul mv_power_series.mul_one, npow_zero' := _, npow_succ' := _}
Equations
- mv_power_series.comm_semiring = {add := semiring.add mv_power_series.semiring, add_assoc := _, zero := semiring.zero mv_power_series.semiring, zero_add := _, add_zero := _, nsmul := semiring.nsmul mv_power_series.semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul mv_power_series.semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one mv_power_series.semiring, one_mul := _, mul_one := _, nat_cast := semiring.nat_cast mv_power_series.semiring, nat_cast_zero := _, nat_cast_succ := _, npow := semiring.npow mv_power_series.semiring, npow_zero' := _, npow_succ' := _, mul_comm := _}
Equations
- mv_power_series.ring = {add := semiring.add mv_power_series.semiring, add_assoc := _, zero := semiring.zero mv_power_series.semiring, zero_add := _, add_zero := _, nsmul := semiring.nsmul mv_power_series.semiring, nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg mv_power_series.add_comm_group, sub := add_comm_group.sub mv_power_series.add_comm_group, sub_eq_add_neg := _, zsmul := add_comm_group.zsmul mv_power_series.add_comm_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := add_comm_group_with_one.int_cast._default semiring.nat_cast semiring.add mv_power_series.ring._proof_12 semiring.zero mv_power_series.ring._proof_13 mv_power_series.ring._proof_14 semiring.nsmul mv_power_series.ring._proof_15 mv_power_series.ring._proof_16 semiring.one mv_power_series.ring._proof_17 mv_power_series.ring._proof_18 add_comm_group.neg add_comm_group.sub mv_power_series.ring._proof_19 add_comm_group.zsmul mv_power_series.ring._proof_20 mv_power_series.ring._proof_21 mv_power_series.ring._proof_22 mv_power_series.ring._proof_23, nat_cast := semiring.nat_cast mv_power_series.semiring, one := semiring.one mv_power_series.semiring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := semiring.mul mv_power_series.semiring, mul_assoc := _, one_mul := _, mul_one := _, npow := semiring.npow mv_power_series.semiring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
Equations
- mv_power_series.comm_ring = {add := comm_semiring.add mv_power_series.comm_semiring, add_assoc := _, zero := comm_semiring.zero mv_power_series.comm_semiring, zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul mv_power_series.comm_semiring, nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg mv_power_series.add_comm_group, sub := add_comm_group.sub mv_power_series.add_comm_group, sub_eq_add_neg := _, zsmul := add_comm_group.zsmul mv_power_series.add_comm_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, int_cast := ring.int_cast._default comm_semiring.nat_cast comm_semiring.add mv_power_series.comm_ring._proof_12 comm_semiring.zero mv_power_series.comm_ring._proof_13 mv_power_series.comm_ring._proof_14 comm_semiring.nsmul mv_power_series.comm_ring._proof_15 mv_power_series.comm_ring._proof_16 comm_semiring.one mv_power_series.comm_ring._proof_17 mv_power_series.comm_ring._proof_18 add_comm_group.neg add_comm_group.sub mv_power_series.comm_ring._proof_19 add_comm_group.zsmul mv_power_series.comm_ring._proof_20 mv_power_series.comm_ring._proof_21 mv_power_series.comm_ring._proof_22 mv_power_series.comm_ring._proof_23, nat_cast := comm_semiring.nat_cast mv_power_series.comm_semiring, one := comm_semiring.one mv_power_series.comm_semiring, nat_cast_zero := _, nat_cast_succ := _, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _, mul := comm_semiring.mul mv_power_series.comm_semiring, mul_assoc := _, one_mul := _, mul_one := _, npow := comm_semiring.npow mv_power_series.comm_semiring, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
The constant multivariate formal power series.
Equations
- mv_power_series.C σ R = {to_fun := (mv_power_series.monomial R 0).to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
The variables of the multivariate formal power series ring.
Equations
- mv_power_series.X s = ⇑(mv_power_series.monomial R (finsupp.single s 1)) 1
The constant coefficient of a formal power series.
Equations
- mv_power_series.constant_coeff σ R = {to_fun := ⇑(mv_power_series.coeff R 0), map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
If a multivariate formal power series is invertible, then so is its constant coefficient.
The map between multivariate formal power series induced by a map on the coefficients.
Equations
- mv_power_series.map σ f = {to_fun := λ (φ : mv_power_series σ R) (n : σ →₀ ℕ), ⇑f (⇑(mv_power_series.coeff R n) φ), map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
Instances for mv_power_series.map
Equations
- mv_power_series.algebra = {to_has_smul := mul_action.to_has_smul distrib_mul_action.to_mul_action, to_ring_hom := (mv_power_series.map σ (algebra_map R A)).comp (mv_power_series.C σ R), commutes' := _, smul_def' := _}
Auxiliary definition for the truncation function.
Equations
- mv_power_series.trunc_fun n φ = (finset.Iio n).sum (λ (m : σ →₀ ℕ), ⇑(mv_polynomial.monomial m) (⇑(mv_power_series.coeff R m) φ))
The n
th truncation of a multivariate formal power series to a multivariate polynomial
Equations
- mv_power_series.trunc R n = {to_fun := mv_power_series.trunc_fun n, map_zero' := _, map_add' := _}
Auxiliary definition that unifies
the totalised inverse formal power series (_)⁻¹
and
the inverse formal power series that depends on
an inverse of the constant coefficient inv_of_unit
.
A multivariate formal power series is invertible if the constant coefficient is invertible.
Equations
- φ.inv_of_unit u = mv_power_series.inv.aux ↑u⁻¹ φ
Multivariate formal power series over a local ring form a local ring.
The map A[[X]] → B[[X]]
induced by a local ring hom A → B
is local
The inverse 1/f
of a multivariable power series f
over a field
Equations
- φ.inv = mv_power_series.inv.aux (⇑(mv_power_series.constant_coeff σ k) φ)⁻¹ φ
Equations
- mv_power_series.has_inv = {inv := mv_power_series.inv _inst_1}
Equations
- mv_power_series.inv_one_class = {one := 1, inv := has_inv.inv mv_power_series.has_inv, inv_one := _}
The natural inclusion from multivariate polynomials into multivariate formal power series.
Equations
- mv_polynomial.coe_to_mv_power_series = {coe := λ (φ : mv_polynomial σ R) (n : σ →₀ ℕ), mv_polynomial.coeff n φ}
The coercion from multivariable polynomials to multivariable power series as a ring homomorphism.
Equations
- mv_polynomial.coe_to_mv_power_series.ring_hom = {to_fun := coe coe_to_lift, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
The coercion from multivariable polynomials to multivariable power series as an algebra homomorphism.
Equations
- mv_polynomial.coe_to_mv_power_series.alg_hom A = {to_fun := ((mv_power_series.map σ (algebra_map R A)).comp mv_polynomial.coe_to_mv_power_series.ring_hom).to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _, commutes' := _}
Equations
Formal power series over the coefficient ring R
.
Equations
Instances for power_series
- power_series.algebra_polynomial'
- power_series.inhabited
- power_series.add_monoid
- power_series.add_group
- power_series.add_comm_monoid
- power_series.add_comm_group
- power_series.semiring
- power_series.comm_semiring
- power_series.ring
- power_series.comm_ring
- power_series.nontrivial
- power_series.module
- power_series.is_scalar_tower
- power_series.algebra
- power_series.no_zero_divisors
- power_series.is_domain
- power_series.local_ring
- power_series.has_inv
- power_series.inv_one_class
- polynomial.coe_to_power_series
- power_series.algebra_polynomial
- power_series.algebra_power_series
- laurent_series.has_coe
- laurent_series.algebra
Equations
Equations
Equations
Equations
Equations
Equations
Equations
The n
th coefficient of a formal power series.
Equations
The n
th monomial with coefficient a
as formal power series.
Equations
Two formal power series are equal if all their coefficients are equal.
Two formal power series are equal if all their coefficients are equal.
Constructor for formal power series.
Equations
- power_series.mk f = λ (s : unit →₀ ℕ), f (⇑s unit.star())
The constant coefficient of a formal power series.
Equations
The constant formal power series.
Equations
The variable of the formal power series ring.
Equations
If a formal power series is invertible, then so is its constant coefficient.
Split off the constant coefficient.
Split off the constant coefficient.
The ring homomorphism taking a power series f(X)
to f(aX)
.
Equations
- power_series.rescale a = {to_fun := λ (f : power_series R), power_series.mk (λ (n : ℕ), a ^ n * ⇑(power_series.coeff R n) f), map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
The n
th truncation of a formal power series to a polynomial
Equations
- power_series.trunc n φ = (finset.Ico 0 n).sum (λ (m : ℕ), ⇑(polynomial.monomial m) (⇑(power_series.coeff R m) φ))
Auxiliary function used for computing inverse of a power series
Equations
A formal power series is invertible if the constant coefficient is invertible.
Equations
- φ.inv_of_unit u = mv_power_series.inv_of_unit φ u
Two ways of removing the constant coefficient of a power series are the same.
The ring homomorphism taking a power series f(X)
to f(-X)
.
Equations
The ideal spanned by the variable in the power series ring over an integral domain is a prime ideal.
The variable of the power series ring over an integral domain is prime.
The inverse 1/f of a power series f defined over a field
Equations
Equations
- power_series.has_inv = {inv := power_series.inv _inst_1}
The order of a formal power series φ
is the greatest n : part_enat
such that X^n
divides φ
. The order is ⊤
if and only if φ = 0
.
If the order of a formal power series is finite, then the coefficient indexed by the order is nonzero.
If the n
th coefficient of a formal power series is nonzero,
then the order of the power series is less than or equal to n
.
The n
th coefficient of a formal power series is 0
if n
is strictly
smaller than the order of the power series.
The 0
power series is the unique power series with infinite order.
The order of a formal power series is exactly n
if the n
th coefficient is nonzero,
and the i
th coefficient is 0
for all i < n
.
The order of a formal power series is exactly n
if the n
th coefficient is nonzero,
and the i
th coefficient is 0
for all i < n
.
The order of the sum of two formal power series is at least the minimum of their orders.
If n
is strictly smaller than the order of ψ
, then the n
th coefficient of its product
with any other power series is 0
.
The order of the formal power series 1
is 0
.
The order of the formal power series X
is 1
.
The order of the formal power series X^n
is n
.
The natural inclusion from polynomials into formal power series.
Equations
- polynomial.coe_to_power_series = {coe := λ (φ : polynomial R), power_series.mk (λ (n : ℕ), φ.coeff n)}
The coercion from polynomials to power series as a ring homomorphism.
Equations
- polynomial.coe_to_power_series.ring_hom = {to_fun := coe coe_to_lift, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
The coercion from polynomials to power series as an algebra homomorphism.
Equations
- polynomial.coe_to_power_series.alg_hom A = {to_fun := ((power_series.map (algebra_map R A)).comp polynomial.coe_to_power_series.ring_hom).to_fun, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _, commutes' := _}