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
3 changes: 3 additions & 0 deletions RealRooted.lean
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ public import RealRooted.Favard.Affine.RowSign
public import RealRooted.Favard.Orthogonality
public import RealRooted.Favard.PathEnvelope
public import RealRooted.Favard.Recurrence
public import RealRooted.FerrersHit.Basic
public import RealRooted.FerrersHit.Roots
public import RealRooted.FiniteFreeAdditive
public import RealRooted.FiniteFreeAdditive.HalfInteger
public import RealRooted.FiniteFreeAdditive.HalfIntegerConvolution
Expand Down Expand Up @@ -1711,6 +1713,7 @@ public import RealRooted.Transforms.BrandenE.Basic
public import RealRooted.Transforms.BrandenE.BasisImage
public import RealRooted.Transforms.BrandenE.Delannoy
public import RealRooted.Transforms.BrandenE.EvenBinomial
public import RealRooted.Transforms.BrandenE.IntegerFactors
public import RealRooted.Transforms.BrandenE.IntervalPreserver
public import RealRooted.Transforms.BrandenE.Inverse
public import RealRooted.Transforms.BrandenE.OrderedBell
Expand Down
27 changes: 24 additions & 3 deletions RealRooted/Challenges/Matrices/MonotoneColumnPermanent.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module

import RealRooted.FerrersHit.Roots
import RealRooted.Permanent.Basic
import RealRooted.Permanent.Ferrers
import RealRooted.Permanent.MonotoneColumn
Expand Down Expand Up @@ -88,6 +89,17 @@ label = "Monotone column permanent theorem: per(zJ + A) is real-rooted for monot
name = "RealRooted.Permanent.diagonalPermanent_coeff_card"
module = "RealRooted.Permanent.Basic"
label = "The leading coefficient of per(zJ + A) is n!"
[[definitions]]
name = "RealRooted.FerrersHit.hitPolynomial"
module = "RealRooted.FerrersHit.Basic"
label = "Standard rook-to-hit transform"

[[theorems]]
objects = ["Hit polynomials of Ferrers boards"]
property = "real-rooted"
name = "RealRooted.FerrersHit.hitPolynomial_ne_zero_and_splits"
module = "RealRooted.FerrersHit.Roots"
label = "Ferrers hit polynomials are nonzero and real-rooted"
-->

<!-- realrooted-catalog-content -->
Expand All @@ -114,9 +126,18 @@ deletion recurrence in terms of smaller Ferrers matrices.

## Use

For a zero-one matrix the permanent $\operatorname{per}(zJ+A)$ is a rook-type polynomial, so the
theorem contains the real-rootedness of many rook and hit polynomials. It is one of the main
applications of [real stability](rr:real-stability).
For a zero-one matrix the permanent $\operatorname{per}(zJ+A)$ is a rook-type polynomial.
The height-based rook-to-hit transform is also formalized directly: if
$0\le h_1\le\cdots\le h_n\le n$, we define $r_k$ by
$\sum_k r_k(x)_{n-k}=\prod_i(x+h_i-i+1)$ and set
$H(t)=\sum_k r_k(n-k)!(t-1)^k$. Then $H$ is nonzero and real-rooted
[@HaglundOnoWagner1999, Thm. 1]. This algebraic definition does not require a
rook-placement counting model.

The hit-polynomial proof uses the Brändén E transform of the factorial product,
integer level crossings, and endpoint multiplicity. It is independent of the
permanent counting identities. The E image has all its roots in $[-1,0]$;
bounded reversal and a shift yield $H$.

## Proof

Expand Down
121 changes: 121 additions & 0 deletions RealRooted/FerrersHit/Basic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
module

public import RealRooted.Mathlib.RingTheory.Polynomial.Pochhammer
public import RealRooted.Transforms.BrandenE.Inverse
public import RealRooted.Mathlib.Algebra.Polynomial.Reverse
import Mathlib.Tactic
import RealRooted.Mathlib.Algebra.Polynomial.Chow

/-!
# Ferrers rook numbers and the rook-to-hit transform

We use the algebraic normalization of the Goldman--Joichi--White factorization:
the rook numbers are the reversed coordinates of the column-height product in
the descending-Pochhammer basis. No counting model is assumed.

The hit transform is the one on page 2 of Haglund--Ono--Wagner,
*Theorems and conjectures involving rook polynomials with only real zeros*
(1999). Their Theorem 1 asserts real-rootedness for Ferrers boards.
-/

@[expose] public section

open Polynomial
open scoped BigOperators

namespace RealRooted.FerrersHit

noncomputable section

/-- Weakly increasing column heights of a board in the `n × n` square. -/
def IsFerrers {n : ℕ} (h : Fin n → ℕ) : Prop :=
Monotone h ∧ ∀ i, h i ≤ n

/-- The Goldman--Joichi--White column-height product, indexed from zero. -/
def factorialPolynomial {n : ℕ} (h : Fin n → ℕ) : ℝ[X] :=
∏ i, (X + C ((h i : ℝ) - (i : ℕ)))

/-- Algebraic rook numbers, defined by the falling-factorial coordinates.
For a Ferrers board these are the standard Goldman--Joichi--White rook numbers. -/
def rookNumber {n : ℕ} (h : Fin n → ℕ) (k : ℕ) : ℝ :=
if k ≤ n then (descPochhammerBasis ℝ).repr (factorialPolynomial h) (n - k) else 0

/-- The standard rook-to-hit transform. -/
def hitPolynomial {n : ℕ} (h : Fin n → ℕ) : ℝ[X] :=
∑ k ∈ Finset.range (n + 1),
C (rookNumber h k * ((n - k).factorial : ℝ)) * (X - 1) ^ k

/-- The height product is monic of degree `n`. -/
theorem factorialPolynomial_monic_natDegree {n : ℕ} (h : Fin n → ℕ) :
(factorialPolynomial h).Monic ∧ (factorialPolynomial h).natDegree = n := by
have hm : ∀ i : Fin n, (X + C ((h i : ℝ) - (i : ℕ))).Monic :=
fun _ => monic_X_add_C _
refine ⟨monic_prod_of_monic _ _ (fun i _ => hm i), ?_⟩
change (∏ i, (X + C ((h i : ℝ) - (i : ℕ)))).natDegree = n
rw [natDegree_prod_of_monic _ _ (fun i _ => hm i)]
simp only [natDegree_X_add_C]
simp

/-- The finite falling-factorial expansion of the column-height product. -/
theorem factorialPolynomial_eq_sum {n : ℕ} (h : Fin n → ℕ) :
factorialPolynomial h = ∑ j ∈ Finset.range (n + 1),
C ((descPochhammerBasis ℝ).repr (factorialPolynomial h) j) *
descPochhammer ℝ j := by
let b := descPochhammerBasis ℝ
have hbound : ∀ j, n < j → b.repr (factorialPolynomial h) j = 0 :=
natDegree_le_iff_repr_descPochhammerBasis.mp
(factorialPolynomial_monic_natDegree h).2.le
have hexp := b.linearCombination_repr (factorialPolynomial h)
rw [Finsupp.linearCombination_apply] at hexp
rw [Finsupp.sum_of_support_subset _ (s := Finset.range (n + 1))] at hexp
· simpa [b, smul_eq_C_mul] using hexp.symm
· intro j hj
have hjne := Finsupp.mem_support_iff.mp hj
simpa only [Finset.mem_range, Nat.lt_succ_iff] using
le_of_not_gt (fun hjgt => hjne (hbound j hjgt))
· intros
simp

/-- **Goldman--Joichi--White factorization**, with rook numbers defined by
the falling-factorial formula rather than by rook-placement bijections. -/
theorem sum_rookNumber_descPochhammer {n : ℕ} (h : Fin n → ℕ) :
(∑ k ∈ Finset.range (n + 1),
C (rookNumber h k) * descPochhammer ℝ (n - k)) =
∏ i, (X + C ((h i : ℝ) - (i : ℕ))) := by
rw [← factorialPolynomial, factorialPolynomial_eq_sum]
rw [← Finset.sum_range_reflect (fun j =>
C ((descPochhammerBasis ℝ).repr (factorialPolynomial h) j) *
descPochhammer ℝ j) (n + 1)]
apply Finset.sum_congr rfl
intro k hk
have hk' : k ≤ n := by simpa using hk
simp [rookNumber, hk']

/-- Brändén's E transform of the factorial product is the factorial-weighted,
reversed rook polynomial. -/
theorem brandenE_factorialPolynomial {n : ℕ} (h : Fin n → ℕ) :
brandenE (factorialPolynomial h) =
∑ j ∈ Finset.range (n + 1),
C ((descPochhammerBasis ℝ).repr (factorialPolynomial h) j *
(j.factorial : ℝ)) * X ^ j := by
conv_lhs => rw [factorialPolynomial_eq_sum]
rw [brandenE_finset_sum]
apply Finset.sum_congr rfl
intro j _
rw [brandenE_C_mul, brandenE_descPochhammer, ← mul_assoc, ← C_mul]

/-- The hit polynomial is a shift of a bounded reversal of the E transform. -/
theorem hitPolynomial_eq_reflect_comp {n : ℕ} (h : Fin n → ℕ) :
hitPolynomial h =
(reflect n (brandenE (factorialPolynomial h))).comp (X - 1) := by
rw [brandenE_factorialPolynomial, reflect_finset_sum_C_mul, sum_comp]
conv_rhs => rw [← Finset.sum_range_reflect]
apply Finset.sum_congr rfl
intro k hk
have hk' : k ≤ n := by simpa using hk
simp [rookNumber, hk', reflect_monomial,
revAt_le (Nat.sub_le n k), Nat.sub_sub_self hk']

end

end RealRooted.FerrersHit
202 changes: 202 additions & 0 deletions RealRooted/FerrersHit/Roots.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
module

public import RealRooted.FerrersHit.Basic
import RealRooted.Transforms.BrandenE.IntegerFactors
import TauCeti.Order.SuccPred.IntermediateValue
import Mathlib.Order.SuccPred.Int
import Mathlib.Tactic

/-!
# Real-rooted hit polynomials of Ferrers boards

This is Haglund--Ono--Wagner (1999), Theorem 1 (page 3). We use an algebraic
proof through the Goldman--Joichi--White product. Its integer parameters have
no gaps between their extrema: the first is nonnegative, the last is at most
one, and each downward step has size at most one. Tau Ceti's discrete
intermediate value theorem supplies the consecutive block. The E transform
is then rooted in `[-1, 0]`, by endpoint multiplicity. Reversal and a shift
give the standard rook-to-hit transform.
-/

public section

open Polynomial
open scoped BigOperators

namespace RealRooted.FerrersHit

noncomputable section

private def parameters {n : ℕ} (h : Fin n → ℕ) : Multiset ℤ :=
Finset.univ.val.map fun i => (h i : ℤ) - (i : ℕ)

private theorem mem_parameters {n : ℕ} (h : Fin n → ℕ) (c : ℤ) :
c ∈ parameters h ↔ ∃ i, (h i : ℤ) - (i : ℕ) = c := by
simp [parameters]

private theorem integerFactorProduct_parameters {n : ℕ} (h : Fin n → ℕ) :
integerFactorProduct (parameters h) = factorialPolynomial h := by
simp [integerFactorProduct, parameters, Function.comp_def,
factorialPolynomial, Finset.prod]

/-- A finite descending crossing of a level by the GJW parameters attains
that level: monotone heights permit downward jumps of size at most one. -/
private theorem parameter_crossing {n : ℕ} (h : Fin n → ℕ) (hh : Monotone h)
(i j : Fin n) (hij : i ≤ j) (c : ℤ)
(hi : c ≤ (h i : ℤ) - (i : ℕ)) (hj : (h j : ℤ) - (j : ℕ) ≤ c) :
c ∈ parameters h := by
let f : ℕ → ℤ := fun k => if hk : k < n then -((h ⟨k, hk⟩ : ℤ) - k) else 0
have hstep : ∀ k, (i : ℕ) ≤ k → k < (j : ℕ) → f (k + 1) ≤ Order.succ (f k) := by
intro k _ hk
have hk' : k < n := lt_trans hk j.isLt
have hks : k + 1 < n := by lia
have hmono := hh (show (⟨k, hk'⟩ : Fin n) ≤ ⟨k + 1, hks⟩ by simp)
have hmono' : (h ⟨k, hk'⟩ : ℤ) ≤ (h ⟨k + 1, hks⟩ : ℤ) := by
exact_mod_cast hmono
dsimp [f]
simp only [dite_eq_left hk', dite_eq_left hks]
change -((h ⟨k + 1, hks⟩ : ℤ) - (k + 1 : ℕ)) ≤
-((h ⟨k, hk'⟩ : ℤ) - k) + 1
push_cast
lia
obtain ⟨k, hk, heq⟩ := Nat.exists_mem_Icc_eq_of_le_succ
(f := f) (y := -c) hij hstep (by simpa [f, i.isLt] using neg_le_neg hi)
(by simpa [f, j.isLt] using neg_le_neg hj)
have hkn : k < n := lt_of_le_of_lt hk.2 j.isLt
apply (mem_parameters h c).mpr
refine ⟨⟨k, hkn⟩, ?_⟩
simpa [f, hkn] using congrArg Neg.neg heq

private theorem parameters_no_gaps {n : ℕ} (h : Fin n → ℕ) (hh : IsFerrers h)
(hn : n ≠ 0) (c : ℤ)
(hlo : ∃ i, (h i : ℤ) - (i : ℕ) ≤ c)
(hhi : ∃ i, c ≤ (h i : ℤ) - (i : ℕ)) :
c ∈ parameters h := by
let first : Fin n := ⟨0, Nat.pos_of_ne_zero hn⟩
let last : Fin n := ⟨n - 1, by lia⟩
by_cases hc : c ≤ 0
· obtain ⟨i, hi⟩ := hlo
exact parameter_crossing h hh.1 first i
(by change (0 : ℕ) ≤ (i : ℕ); exact Nat.zero_le _) c
(by dsimp [first]; simp only [sub_zero]; lia) hi
· obtain ⟨i, hi⟩ := hhi
apply parameter_crossing h hh.1 i last (by dsimp [last]; exact_mod_cast (by lia)) c hi
have hh_last := hh.2 last
have hc' : 1 ≤ c := by lia
dsimp [last] at hh_last ⊢
exact_mod_cast (show (h ⟨n - 1, by lia⟩ : ℤ) - (n - 1 : ℕ) ≤ c by
have hh' : (h ⟨n - 1, by lia⟩ : ℤ) ≤ (n : ℤ) := by exact_mod_cast hh_last
have hn' : ((n - 1 : ℕ) : ℤ) = (n : ℤ) - 1 := by lia
lia)

private theorem integerFactorInterval_nodup (m b : ℕ) :
(integerFactorInterval m b).Nodup := by
rw [integerFactorInterval, Multiset.nodup_add]
refine ⟨Multiset.Nodup.map (by intro i j hij; exact_mod_cast neg_injective hij)
(Multiset.nodup_range m),
Multiset.Nodup.map (by intro i j hij; exact_mod_cast (by lia : (i : ℤ) = j))
(Multiset.nodup_range b), ?_⟩
rw [Multiset.disjoint_left]
intro c hc hc'
obtain ⟨i, -, rfl⟩ := Multiset.mem_map.mp hc
obtain ⟨j, -, hji⟩ := Multiset.mem_map.mp hc'
lia

private theorem exists_parameter_block {n : ℕ} (h : Fin n → ℕ) (hh : IsFerrers h)
(hn : n ≠ 0) :
∃ m b : ℕ, integerFactorInterval m b ≤ parameters h ∧
∀ c ∈ parameters h, 1 - (m : ℤ) ≤ c ∧ c ≤ b := by
classical
let s := (parameters h).toFinset
have hne : s.Nonempty := by
refine ⟨(h ⟨0, Nat.pos_of_ne_zero hn⟩ : ℤ), ?_⟩
simpa [s, mem_parameters] using
(show ∃ i : Fin n, (h i : ℤ) - (i : ℕ) = h ⟨0, Nat.pos_of_ne_zero hn⟩ from
⟨⟨0, Nat.pos_of_ne_zero hn⟩, by simp⟩)
let l := s.min' hne
let u := s.max' hne
have hl : l ∈ parameters h := by simpa [s, l] using s.min'_mem hne
have hu : u ∈ parameters h := by simpa [s, u] using s.max'_mem hne
have hl_one : l ≤ 1 := by
have hm : (h ⟨n - 1, by lia⟩ : ℤ) - (n - 1 : ℕ) ∈ s := by
simp only [s, Multiset.mem_toFinset, mem_parameters]
exact ⟨⟨n - 1, by lia⟩, rfl⟩
have hmin := s.min'_le _ hm
have hb := hh.2 ⟨n - 1, by lia⟩
have hb' : (h ⟨n - 1, by lia⟩ : ℤ) ≤ (n : ℤ) := by exact_mod_cast hb
have hn' : ((n - 1 : ℕ) : ℤ) = (n : ℤ) - 1 := by lia
dsimp [l]
lia
have hu_zero : 0 ≤ u := by
have hm : (h ⟨0, Nat.pos_of_ne_zero hn⟩ : ℤ) ∈ s := by
simp only [s, Multiset.mem_toFinset, mem_parameters]
exact ⟨⟨0, Nat.pos_of_ne_zero hn⟩, by simp⟩
exact le_trans (by positivity) (s.le_max' _ hm)
let m := (1 - l).toNat
let b := u.toNat
have hm : (m : ℤ) = 1 - l := Int.toNat_of_nonneg (by lia)
have hb : (b : ℤ) = u := Int.toNat_of_nonneg hu_zero
refine ⟨m, b, ?_, ?_⟩
· apply (Multiset.le_iff_subset (integerFactorInterval_nodup m b)).mpr
intro c hc
have hc_bounds : l ≤ c ∧ c ≤ u := by
rw [integerFactorInterval, Multiset.mem_add] at hc
rcases hc with hc | hc
· obtain ⟨i, hi, rfl⟩ := Multiset.mem_map.mp hc
have hi' : i < m := Multiset.mem_range.mp hi
have hi'' : (i : ℤ) < m := by exact_mod_cast hi'
constructor <;> lia
· obtain ⟨i, hi, rfl⟩ := Multiset.mem_map.mp hc
have hi' : i < b := Multiset.mem_range.mp hi
have hi'' : (i : ℤ) < b := by exact_mod_cast hi'
constructor <;> lia
apply parameters_no_gaps h hh hn c
· obtain ⟨i, hi⟩ := (mem_parameters h l).mp hl
exact ⟨i, hi.symm ▸ hc_bounds.1⟩
· obtain ⟨i, hi⟩ := (mem_parameters h u).mp hu
exact ⟨i, hi.symm ▸ hc_bounds.2⟩
· intro c hc
have hc' : c ∈ s := Multiset.mem_toFinset.mpr hc
have hlo := s.min'_le c hc'
have hhi := s.le_max' c hc'
constructor <;> dsimp [l, u] at * <;> lia

/-- The E transform of the GJW product of a square Ferrers board is nonzero,
splits over the reals, and has all roots in `[-1, 0]`. -/
theorem brandenE_factorialPolynomial_roots_mem_Icc {n : ℕ} (h : Fin n → ℕ)
(hh : IsFerrers h) :
HasPosLeadingCoeff (brandenE (factorialPolynomial h)) ∧
(brandenE (factorialPolynomial h)).Splits ∧
∀ r ∈ (brandenE (factorialPolynomial h)).roots, r ∈ Set.Icc (-1 : ℝ) 0 := by
by_cases hn : n = 0
· subst n
simpa [factorialPolynomial, integerFactorProduct] using
brandenE_integerFactorProduct_roots_mem_Icc 0 0 0
(by simp [integerFactorInterval]) (by simp)
· obtain ⟨m, b, hblock, hbound⟩ := exists_parameter_block h hh hn
simpa [integerFactorProduct_parameters] using
brandenE_integerFactorProduct_roots_mem_Icc (parameters h) m b hblock hbound

/-- **Haglund--Ono--Wagner, Theorem 1 (1999).** The hit polynomial, defined
by the standard rook-to-hit transform of the GJW rook numbers of a Ferrers
board in the square, is nonzero and has only real zeros. -/
theorem hitPolynomial_ne_zero_and_splits {n : ℕ} (h : Fin n → ℕ)
(hh : IsFerrers h) : hitPolynomial h ≠ 0 ∧ (hitPolynomial h).Splits := by
obtain ⟨hlc, hs, -⟩ := brandenE_factorialPolynomial_roots_mem_Icc h hh
have hd : (brandenE (factorialPolynomial h)).natDegree ≤ n := by
change (basisTransform orderedBellPolynomial (factorialPolynomial h)).natDegree ≤ n
rw [basisTransform_natDegree_eq orderedBellPolynomial_natDegree
orderedBellPolynomial_ne_zero (factorialPolynomial_monic_natDegree h).1.ne_zero]
exact (factorialPolynomial_monic_natDegree h).2.le
rw [hitPolynomial_eq_reflect_comp]
refine ⟨?_, (hs.reflect hd).comp_X_sub_C 1⟩
intro hz
have hz' := congrArg (fun p : ℝ[X] => p.comp (X + 1)) hz
simp only [comp_assoc, zero_comp] at hz'
have hinv : (X - 1 : ℝ[X]).comp (X + 1) = X := by simp
rw [hinv, comp_X] at hz'
exact hlc.ne_zero (reflect_eq_zero_iff.mp hz')

end

end RealRooted.FerrersHit
Loading
Loading