Implicit formal power series by coefficient recursion
DefinitionAnalyticCombinatorics_Ch1_Lagrange_ImplicitSeriesanalytic-combinatoricsformal-power-serieslagrange-inversionlean4
Over a commutative ring , let . The coefficient recursion starts with and sets for an arbitrary formal series . The resulting series is . The intermediate step operation also accepts an arbitrary supplied family of earlier coefficients and applies formal substitution; it does not assume that an arbitrary such family has zero constant coefficient. The definitions additionally include the series . These are formal constructions, without analytic convergence assumptions. The coefficient identities are stated separately for the constructed recursive series.
Definition code
import Mathlib
set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3
/-!
# Implicit formal power series
This file constructs, coefficient by coefficient, the unique formal power
series `T` with zero constant term satisfying `T = X * φ.subst T`.
-/
noncomputable section
namespace AnalyticCombinatorics.Ch1.Lagrange
open PowerSeries
variable {R : Type*} [CommRing R]
namespace ImplicitSeries
def partialSeries (a : ℕ → R) (n : ℕ) : R⟦X⟧ :=
PowerSeries.mk fun k => if k < n then a k else 0
def implicitStep (φ : R⟦X⟧) (n : ℕ) (rec : ∀ k, k < n → R) : R :=
match n with
| 0 => 0
| m + 1 =>
coeff m (φ.subst (partialSeries (fun k => if h : k < m + 1 then rec k h else 0) (m + 1)))
def implicitCoeff (φ : R⟦X⟧) : ℕ → R :=
Nat.strongRec (implicitStep φ)
def implicitSeries (φ : R⟦X⟧) : R⟦X⟧ :=
PowerSeries.mk (implicitCoeff φ)
section Sanity
def geometricTail : R⟦X⟧ :=
X * (PowerSeries.mk fun _ => (1 : R))
end Sanity
end ImplicitSeries
end AnalyticCombinatorics.Ch1.Lagrange
Source