Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RealRooted.lean
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public import RealRooted.Applications.EulerianVariations
public import RealRooted.Applications.EulerianVariations.CyclicPathDescents
public import RealRooted.Applications.EulerianVariations.TernaryRuns
public import RealRooted.Applications.EulerianVariations.TernaryRuns.Recurrence
public import RealRooted.Applications.OEIS.A114123
public import RealRooted.Applications.OEIS.A132885
public import RealRooted.Applications.OEIS.A272471.Recurrence
public import RealRooted.Applications.OEIS.InversePeaks
Expand Down Expand Up @@ -486,6 +487,7 @@ public import RealRooted.DerivativeRecurrence.Degree
public import RealRooted.DerivativeRecurrence.General
public import RealRooted.DerivativeRecurrence.GeneralizedLaguerre
public import RealRooted.DerivativeRecurrence.GeneralizedLaguerreInterlacing
public import RealRooted.DerivativeRecurrence.HalfDegree
public import RealRooted.DerivativeRecurrence.Interlacing
public import RealRooted.DerivativeRecurrence.LagDegree
public import RealRooted.DerivativeRecurrence.Linear
Expand Down
2 changes: 1 addition & 1 deletion RealRooted/Applications/OEIS/A056939.lean
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ theorem _root_.RealRooted.Hoggatt.normalized_three_eq_baxter (n : ℕ) :
/-- Strictness for the existing Baxter model: consecutive rows have no shared root. -/
theorem polynomial_isCoprime_succ (n : ℕ) :
IsCoprime (polynomial n) (polynomial (n + 1)) := by
have h := Hoggatt.baxter_interlaces (Nat.succ_ne_zero n)
have h := RealRooted.Hoggatt.baxter_interlaces_and_isCoprime (Nat.succ_ne_zero n)
simpa only [Hoggatt.normalized_three_eq_baxter] using h.2

end RealRooted.Applications.OEIS.A056939
95 changes: 95 additions & 0 deletions RealRooted/Applications/OEIS/A114123.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module

public import RealRooted.TotalPositivity.PFRiordan

/-!
# Pólya-frequency Riordan rows for OEIS A114123

The sequence-specific generating identities and root-location theorem.
-/

@[expose] public section

open Polynomial RealRooted.PFRiordan

noncomputable section

namespace RealRooted.Applications.OEIS.A114123

/-- Coefficients of `(1 + z)^2 / (1 - z)`, the `K`-series for A114123. -/
def kCoeff : ℕ → ℝ :=
rationalPFCoeff 1 0 [1, 1] [1]

/-- The A114123 `K`-series has the claimed finite rational factorization. -/
theorem mk_kCoeff_mul_one_sub :
PowerSeries.mk kCoeff * (1 - PowerSeries.X) =
(1 + PowerSeries.X) ^ 2 := by
rw [kCoeff, mk_rationalPFCoeff]
simpa [BrandenVecchi.supersymmetricNumeratorFactor, pow_two] using
BrandenVecchi.finiteSupersymmetricSeries_mul_denominators
([1, 1] : List ℝ) ([1] : List ℝ)

/-- The A114123 rows, equivalently
`[z^n] (1-z) / ((1-z)^2 - X z (1+z)^2)`. -/
def row (n : ℕ) : ℝ[X] :=
rowPolynomial geometricOneCoeff kCoeff n

/-- Exact generating-series identity
`((1-z)^2 - X z (1+z)^2) F(X,z) = 1-z` for the A114123 rows. -/
theorem denominator_mul_rowGeneratingSeries :
(BrandenLeite.polynomialLift ((1 - PowerSeries.X) ^ 2) -
PowerSeries.C X * BrandenLeite.polynomialLift
(PowerSeries.X * (1 + PowerSeries.X) ^ 2)) *
rowGeneratingSeries geometricOneCoeff kCoeff =
BrandenLeite.polynomialLift (1 - PowerSeries.X) := by
have hd :
(1 - PowerSeries.X) ^ 2 * PowerSeries.mk geometricOneCoeff =
1 - PowerSeries.X := by
calc
(1 - PowerSeries.X) ^ 2 * PowerSeries.mk geometricOneCoeff =
(1 - PowerSeries.X) *
(PowerSeries.mk geometricOneCoeff * (1 - PowerSeries.X)) := by ring
_ = 1 - PowerSeries.X := by rw [mk_geometricOneCoeff_mul_one_sub]; ring
have hK :
PowerSeries.X * (1 - PowerSeries.X) *
PowerSeries.mk kCoeff =
PowerSeries.X * (1 + PowerSeries.X) ^ 2 := by
calc
PowerSeries.X * (1 - PowerSeries.X) *
PowerSeries.mk kCoeff =
PowerSeries.X *
(PowerSeries.mk kCoeff * (1 - PowerSeries.X)) := by ring
_ = PowerSeries.X * (1 + PowerSeries.X) ^ 2 := by
rw [mk_kCoeff_mul_one_sub]
have hd' :
PowerSeries.mk
(fun n => PowerSeries.coeff n ((1 - PowerSeries.X) ^ 2)) *
PowerSeries.mk geometricOneCoeff =
PowerSeries.mk (fun n => PowerSeries.coeff n (1 - PowerSeries.X)) := by
simpa only [BrandenLeite.mk_coeff_eq] using hd
have hK' :
PowerSeries.X *
PowerSeries.mk (fun n => PowerSeries.coeff n (1 - PowerSeries.X)) *
PowerSeries.mk kCoeff =
PowerSeries.mk (fun n => PowerSeries.coeff n
(PowerSeries.X * (1 + PowerSeries.X) ^ 2)) := by
simpa only [BrandenLeite.mk_coeff_eq] using hK
simpa only [BrandenLeite.mk_coeff_eq] using
PFRiordan.denominator_mul_rowGeneratingSeries
(D₀ := fun n => PowerSeries.coeff n ((1 - PowerSeries.X) ^ 2))
(L := fun n => PowerSeries.coeff n
(PowerSeries.X * (1 + PowerSeries.X) ^ 2))
(N := fun n => PowerSeries.coeff n (1 - PowerSeries.X))
(d := geometricOneCoeff) (K := kCoeff) hd' hK'

/-- Every A114123 row splits and has only nonpositive roots. -/
theorem row_splits_and_roots_nonpos (n : ℕ) :
(row n).Splits ∧
∀ r ∈ (row n).roots, r ≤ 0 := by
apply rowPolynomial_splits_and_roots_nonpos
· exact rationalPFCoeff_isPolyaFreqSeq
(c := 1) (by norm_num) 0 (by simp) (by simp)
· exact rationalPFCoeff_isPolyaFreqSeq
(c := 1) (by norm_num) 0 (by simp) (by simp)

end RealRooted.Applications.OEIS.A114123
4 changes: 2 additions & 2 deletions RealRooted/BasisTransform/AppellRigidity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ theorem exists_diagonalPolynomial

/-- Repeated-root preservation at degree two forces the quadratic coefficient governing
the first lower basis diagonal to be nonnegative. -/
theorem two_mul_coeff_one_appellCoefficient_two_nonneg_of_shiftedPower_splits
theorem _root_.RealRooted.AppellCoefficient.two_mul_coeff_one_nonneg_of_shiftedPower_splits
{P : ℕ → ℝ[X]} (hPdeg : ∀ n, (P n).natDegree = n)
(hPmonic : ∀ n, (P n).Monic)
(hsplits : ∀ r : ℝ, 0 ≤ r → (shiftedPowerImage P 2 r).Splits) :
Expand Down Expand Up @@ -832,7 +832,7 @@ theorem two_mul_coeff_one_appellCoefficient_two_nonneg
(hpres : ∀ p : ℝ[X], p.Splits →
(∀ r ∈ p.roots, r ≤ 0) → (basisTransform P p).Splits) :
0 ≤ 2 * (appellCoefficient P 2).coeff 1 := by
exact two_mul_coeff_one_appellCoefficient_two_nonneg_of_shiftedPower_splits hPdeg hPmonic
exact RealRooted.AppellCoefficient.two_mul_coeff_one_nonneg_of_shiftedPower_splits hPdeg hPmonic
fun r hr => splits_shiftedPowerImage_of_preserves hPdeg hPmonic hpres 2 hr

/-- Under the explicit Appell expansion, root preservation makes the first
Expand Down
20 changes: 10 additions & 10 deletions RealRooted/BasisTransform/AppellTranslationRigidity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ theorem eq_sum_of_isAppellExpansion_of_natDegree_le

/-- An Appell expansion evaluates the associated basis transform as the
locally finite differential operator with coefficients `Q`. -/
theorem basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
theorem _root_.RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
{P Q : ℕ → ℝ[X]} (hPQ : IsAppellExpansion P Q)
(hPdeg : ∀ n, (P n).natDegree = n)
(hQdeg : ∀ k, (Q k).natDegree ≤ k / 2)
Expand Down Expand Up @@ -139,7 +139,7 @@ private theorem shiftedPowerImage_eq_of_commutes_translation

/-- The canonical Appell coefficients are constant exactly when the basis
transform commutes with every translation. -/
theorem forall_appellCoefficient_natDegree_eq_zero_iff_commutes_translation
theorem _root_.RealRooted.AppellCoefficient.forall_natDegree_eq_zero_iff_commutes_translation
(P : ℕ → ℝ[X]) (hPdeg : ∀ n, (P n).natDegree = n)
(hQdeg : ∀ k, (appellCoefficient P k).natDegree ≤ k / 2) :
(∀ k, (appellCoefficient P k).natDegree = 0) ↔
Expand All @@ -148,11 +148,11 @@ theorem forall_appellCoefficient_natDegree_eq_zero_iff_commutes_translation
(basisTransform P p).comp (X + C r) := by
constructor
· intro hconstant r p
rw [basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
rw [RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg
(p := p.comp (X + C r)) (N := p.natDegree) (by
rw [← taylor_apply, natDegree_taylor]),
basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg (p := p)
(N := p.natDegree) le_rfl]
rw [Polynomial.sum_comp]
Expand Down Expand Up @@ -217,11 +217,11 @@ private theorem derivative_appellCoefficient_eq_zero_of_basis_derivative
induction n using Nat.strong_induction_on with
| h n ih =>
have hexpand :=
basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg
(p := X ^ n) (N := n) (by simp)
have hexpandDer :=
basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg
(p := (X ^ n).derivative) (N := n)
(calc
Expand Down Expand Up @@ -281,10 +281,10 @@ theorem forall_appellCoefficient_natDegree_eq_zero_iff_derivative
· intro hconstant n
have hcomm (p : ℝ[X]) :
(basisTransform P p).derivative = basisTransform P p.derivative := by
rw [basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
rw [RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg (p := p)
(N := p.natDegree) le_rfl,
basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg
(p := p.derivative) (N := p.natDegree)
((natDegree_derivative_le (p := p)).trans (Nat.sub_le _ _))]
Expand Down Expand Up @@ -389,7 +389,7 @@ theorem appellTranslationRigidity_equivalences
have hbeta := two_mul_coeff_one_appellCoefficient_two_eq_zero_iff
hPdeg hPmonic hpres
exact ⟨hbeta,
hbeta.trans (forall_appellCoefficient_natDegree_eq_zero_iff_commutes_translation
hbeta.trans (RealRooted.AppellCoefficient.forall_natDegree_eq_zero_iff_commutes_translation
P hPdeg (appellCoefficient_natDegree_le hPdeg hPmonic hpres)),
hbeta.trans (forall_appellCoefficient_natDegree_eq_zero_iff_derivative
P hPdeg (appellCoefficient_natDegree_le hPdeg hPmonic hpres))⟩
Expand All @@ -408,7 +408,7 @@ theorem basisTransform_splits_of_quadraticCoefficient_eq_zero
appellCoefficient_natDegree_eq_zero_of_quadraticCoefficient_eq_zero
hPdeg hPmonic hpres hbeta
have hcomm :=
(forall_appellCoefficient_natDegree_eq_zero_iff_commutes_translation
(RealRooted.AppellCoefficient.forall_natDegree_eq_zero_iff_commutes_translation
P hPdeg (appellCoefficient_natDegree_le hPdeg hPmonic hpres)).mp hconstant
obtain ⟨r, hr⟩ := exists_root_upper_bound p
have hshiftSplits : (p.comp (X + C r)).Splits := hp.comp_X_add_C r
Expand Down
4 changes: 2 additions & 2 deletions RealRooted/BasisTransform/IntervalBasisMaps.lean
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ theorem rationalGeneratingSeries_iff_eventually_pureLag
(hNdeg.trans_le (by lia)) hgen
· rintro ⟨q, n₀, Q, hq, hQ0, hQdeg, hrec⟩
obtain ⟨M, hMdeg, hgen⟩ :=
exists_natDegree_lt_add_and_mul_generatingSeries_eq_of_pureLag_from
RealRooted.EndpointRecurrence.exists_natDegree_lt_and_mul_generatingSeries_eq_of_pureLag
P Q q n₀ hq hQ0 hQdeg.le hrec
exact ⟨q, n₀, Q, M, hq, hQ0, hQdeg, hMdeg, hgen⟩

Expand All @@ -776,7 +776,7 @@ theorem le_eventualOrder_of_coprime_mul_generatingSeries_eq
Q.coeff (j + 1) * P (n₀ + n + m - (j + 1))) :
q ≤ m := by
obtain ⟨M, -, hQgen⟩ :=
exists_natDegree_lt_add_and_mul_generatingSeries_eq_of_pureLag_from
RealRooted.EndpointRecurrence.exists_natDegree_lt_and_mul_generatingSeries_eq_of_pureLag
P Q m n₀ hm hQ0 hQdeg hrec
rw [← hDdeg]
exact (natDegree_le_of_coprime_mul_generatingSeries_eq
Expand Down
6 changes: 3 additions & 3 deletions RealRooted/BasisTransform/LimitingAppell.lean
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private theorem rescaledBasisPower_eq_sum_scaled
have hQdeg := appellCoefficient_natDegree_le hPdeg hPmonic hpres
have hinputdeg : ((X + C (s ^ 2)) ^ N : ℝ[X]).natDegree ≤ N := by
rw [natDegree_pow, natDegree_X_add_C, mul_one]
have hexpand := basisTransform_eq_sum_iterate_derivative_of_isAppellExpansion
have hexpand := RealRooted.IsAppellExpansion.basisTransform_eq_sum_iterate_derivative
(isAppellExpansion_appellCoefficient P) hPdeg hQdeg hinputdeg
rw [rescaledBasisPower]
change C ((s ^ N)⁻¹) *
Expand Down Expand Up @@ -984,7 +984,7 @@ theorem coeff_appellCoefficient_even_bounds

/-- Exponential coefficient data attain equality in the second coefficient
bound. -/
theorem limitingAppellCoefficient_two_eq_half_square_of_eq_pow_div_factorial
theorem _root_.RealRooted.LimitingAppell.coeff_two_eq_half_square_of_eq_pow_div_factorial
{d : ℕ → ℝ} {c : ℝ} (hd : ∀ j, d j = c ^ j / (j.factorial : ℝ)) :
d 2 = d 1 ^ 2 / 2 := by
rw [hd 2, hd 1]
Expand All @@ -1011,7 +1011,7 @@ private theorem coeff_zero_limitingAppellPolynomial_even

/-- Equality of every limiting polynomial with the Gaussian family is
equivalent to exponential coefficient data. -/
theorem forall_limitingAppellPolynomial_eq_iff_coeff_eq_pow_div_factorial
theorem _root_.RealRooted.LimitingAppell.forall_polynomial_eq_iff_coeff_eq_pow_div_factorial
(d : ℕ → ℝ) (c : ℝ) :
(∀ N, limitingAppellPolynomial d N =
limitingAppellPolynomial (fun j => c ^ j / (j.factorial : ℝ)) N) ↔
Expand Down
22 changes: 12 additions & 10 deletions RealRooted/BasisTransform/NewtonBasisPreservers.lean
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private theorem two_mul_appellCoefficient_two_nonneg_of_repeatedRootTestsUpTo
{N : ℕ} {c : ℕ → ℝ} (hN : 2 ≤ N)
(htest : NewtonRepeatedRootTestsUpTo N c) :
0 ≤ 2 * (appellCoefficient (newtonBasisPolynomial c) 2).coeff 1 := by
apply two_mul_coeff_one_appellCoefficient_two_nonneg_of_shiftedPower_splits
apply RealRooted.AppellCoefficient.two_mul_coeff_one_nonneg_of_shiftedPower_splits
(newtonBasisPolynomial_natDegree c) (newtonBasisPolynomial_monic c)
intro r hr
rw [splits_shiftedPowerImage_iff]
Expand Down Expand Up @@ -279,7 +279,7 @@ private theorem newtonBasisTransform_eq_rising_comp

/-- Arithmetic-progression Newton parameters preserve real-rootedness for all
inputs with only nonpositive roots. -/
theorem NewtonParametersAffine.preservesNonposRooted {c : ℕ → ℝ}
theorem _root_.RealRooted.NewtonPreservesNonposRooted.of_parametersAffine {c : ℕ → ℝ}
(hc : NewtonParametersAffine c) : NewtonPreservesNonposRooted c := by
obtain ⟨h, hh, hc⟩ := hc
intro p hp
Expand All @@ -298,7 +298,7 @@ theorem NewtonPreservesNonposRooted.repeatedRootTests {c : ℕ → ℝ}
/-- Arithmetic-progression parameters imply every repeated-root test. -/
theorem NewtonParametersAffine.repeatedRootTests {c : ℕ → ℝ}
(hc : NewtonParametersAffine c) : NewtonRepeatedRootTests c :=
hc.preservesNonposRooted.repeatedRootTests
(NewtonPreservesNonposRooted.of_parametersAffine hc).repeatedRootTests

/-- Repeated-root tests force the Newton parameters to form a nondecreasing
arithmetic progression. -/
Expand Down Expand Up @@ -336,15 +336,15 @@ progression Newton parameters. -/
theorem newtonPreservesNonposRooted_iff_parametersAffine (c : ℕ → ℝ) :
NewtonPreservesNonposRooted c ↔ NewtonParametersAffine c :=
⟨NewtonPreservesNonposRooted.parametersAffine,
NewtonParametersAffine.preservesNonposRooted⟩
RealRooted.NewtonPreservesNonposRooted.of_parametersAffine⟩

/-- Preservation, repeated-root tests, and arithmetic-progression parameters
are equivalent for a Newton basis. -/
theorem newtonBasis_preserver_equivalences (c : ℕ → ℝ) :
(NewtonPreservesNonposRooted c ↔ NewtonRepeatedRootTests c) ∧
(NewtonRepeatedRootTests c ↔ NewtonParametersAffine c) := by
exact ⟨⟨NewtonPreservesNonposRooted.repeatedRootTests,
fun htest => htest.parametersAffine.preservesNonposRooted⟩,
fun htest => NewtonPreservesNonposRooted.of_parametersAffine htest.parametersAffine⟩,
newtonRepeatedRootTests_iff_parametersAffine c⟩

/-- The finite preservation property implies the finite repeated-root tests. -/
Expand All @@ -366,7 +366,7 @@ theorem NewtonRepeatedRootTestsUpTo.parametersAffineUpTo

/-- An arithmetic progression through index `N - 1` preserves all admissible
inputs of degree at most `N`. -/
theorem NewtonParametersAffineUpTo.preservesNonposRootedUpTo
theorem _root_.RealRooted.NewtonPreservesNonposRootedUpTo.of_parametersAffineUpTo
{N : ℕ} {c : ℕ → ℝ} (hc : NewtonParametersAffineUpTo N c) :
NewtonPreservesNonposRootedUpTo N c := by
obtain ⟨h, hh, hc⟩ := hc
Expand All @@ -386,7 +386,8 @@ theorem NewtonParametersAffineUpTo.preservesNonposRootedUpTo
basisTransform (newtonBasisPolynomial d) p
exact basisTransform_eq_of_eq_on_support hbasis
rw [htransform]
exact (show NewtonParametersAffine d from ⟨h, hh, fun j => by simp [d]⟩).preservesNonposRooted
exact NewtonPreservesNonposRooted.of_parametersAffine
(show NewtonParametersAffine d from ⟨h, hh, fun j => by simp [d]⟩)
p hproots

/-- Through degree `N ≥ 2`, repeated-root tests are equivalent to affine
Expand All @@ -398,7 +399,7 @@ theorem newtonRepeatedRootTestsUpTo_iff_parametersAffineUpTo
· intro htest
exact htest.parametersAffineUpTo hN
· intro haffine
exact haffine.preservesNonposRootedUpTo.repeatedRootTestsUpTo
exact (NewtonPreservesNonposRootedUpTo.of_parametersAffineUpTo haffine).repeatedRootTestsUpTo

/-- Through degree `N ≥ 2`, preservation is equivalent to affine Newton
parameters through index `N - 1`. -/
Expand All @@ -408,7 +409,7 @@ theorem newtonPreservesNonposRootedUpTo_iff_parametersAffineUpTo
constructor
· intro hpres
exact hpres.repeatedRootTestsUpTo.parametersAffineUpTo hN
· exact NewtonParametersAffineUpTo.preservesNonposRootedUpTo
· exact RealRooted.NewtonPreservesNonposRootedUpTo.of_parametersAffineUpTo

/-- Through degree `N ≥ 2`, preservation, repeated-root tests, and affine
parameters through index `N - 1` are equivalent. -/
Expand All @@ -417,7 +418,8 @@ theorem newtonBasis_preserver_equivalencesUpTo
(NewtonPreservesNonposRootedUpTo N c ↔ NewtonRepeatedRootTestsUpTo N c) ∧
(NewtonRepeatedRootTestsUpTo N c ↔ NewtonParametersAffineUpTo N c) := by
exact ⟨⟨NewtonPreservesNonposRootedUpTo.repeatedRootTestsUpTo,
fun htest => (htest.parametersAffineUpTo hN).preservesNonposRootedUpTo⟩,
fun htest => NewtonPreservesNonposRootedUpTo.of_parametersAffineUpTo
(htest.parametersAffineUpTo hN)⟩,
newtonRepeatedRootTestsUpTo_iff_parametersAffineUpTo hN c⟩

end RealRooted
Loading
Loading