Skip to content

Commit 9efe273

Browse files
committed
feat: superFactorial_dvd_vandermonde_det (#6893)
- [x] depends on: #6806 - [x] depends on: #6812 - [x] depends on: #6918 - [x] depends on: #6927 - [x] depends on: #6929 Co-authored-by: Moritz Firsching <firsching@google.com>
1 parent b8b86fa commit 9efe273

4 files changed

Lines changed: 84 additions & 1 deletion

File tree

Mathlib/Data/Nat/Factorial/SuperFactorial.lean

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ Authors: Moritz Firsching
55
-/
66
import Mathlib.Algebra.BigOperators.Intervals
77
import Mathlib.Data.Nat.Factorial.Basic
8+
import Mathlib.Data.Polynomial.Monic
89
import Mathlib.LinearAlgebra.Vandermonde
10+
import Mathlib.RingTheory.Polynomial.Pochhammer
911

1012
/-!
1113
# Superfactorial
1214
1315
This file defines the [superfactorial](https://en.wikipedia.org/wiki/Superfactorial)
14-
`sf n = 1! * 2! * 3! * ...* n!`.
16+
`sf n = 1! * 2! * 3! * ... * n!`.
1517
1618
## Main declarations
1719
@@ -64,6 +66,12 @@ theorem prod_range_factorial_succ : ∀ n : ℕ, ∏ x in range n, (x + 1)! = sf
6466
| n + 1 => by
6567
rw [Finset.prod_range_succ, prod_range_factorial_succ n, superFactorial, mul_comm, factorial]
6668

69+
@[simp]
70+
theorem prod_range_succ_factorial : ∀ n : ℕ, ∏ x in range (n + 1), x ! = sf n
71+
| 0 => rfl
72+
| n + 1 => by
73+
rw [prod_range_succ, prod_range_succ_factorial n, mul_comm, superFactorial]
74+
6775
variable {R : Type*} [CommRing R]
6876

6977
theorem det_vandermonde_id_eq_superFactorial (n : ℕ) :
@@ -79,6 +87,29 @@ theorem det_vandermonde_id_eq_superFactorial (n : ℕ) :
7987
· rw [Matrix.det_vandermonde] at hn
8088
simp [hn]
8189

90+
private theorem matrixOf_eval_descPochhammer_eq_mul_matrixOf_choose {n : ℕ} (v : Fin n → ℕ) :
91+
(Matrix.of (fun (i j : Fin n) => (descPochhammer ℤ j).eval (v i : ℤ))).det =
92+
(∏ i : Fin n, Nat.factorial i) *
93+
(Matrix.of (fun (i j : Fin n) => (Nat.choose (v i) (j : ℕ) : ℤ))).det := by
94+
convert Matrix.det_mul_row (fun (i : Fin n) => ((Nat.factorial (i : ℕ)):ℤ)) _
95+
· rw [Matrix.of_apply, descPochhammer_int_eq_descFactorial _ _]
96+
congr
97+
exact Nat.descFactorial_eq_factorial_mul_choose _ _
98+
· rw [Nat.cast_prod]
99+
100+
theorem superFactorial_dvd_vandermonde_det {n : ℕ} (v : Fin (n + 1) → ℤ) :
101+
↑(Nat.superFactorial n) ∣ (Matrix.vandermonde v).det := by
102+
let m := inf' univ ⟨0, mem_univ _⟩ v
103+
let w' := fun i ↦ (v i - m).toNat
104+
have hw' : ∀ i, (w' i : ℤ) = v i - m := fun i ↦ Int.toNat_sub_of_le (inf'_le _ (mem_univ _))
105+
have h := Matrix.det_eval_matrixOfPolynomials_eq_det_vandermonde (fun i ↦ ↑(w' i))
106+
(fun i => descPochhammer ℤ i)
107+
(fun i => descPochhammer_natDegree ℤ i)
108+
(fun i => monic_descPochhammer ℤ i)
109+
conv_lhs at h => simp only [hw', Matrix.det_vandermonde_sub]
110+
use (Matrix.of (fun (i j : Fin (n + 1)) => (Nat.choose (w' i) (j : ℕ) : ℤ))).det
111+
simp [h, matrixOf_eval_descPochhammer_eq_mul_matrixOf_choose w', Fin.prod_univ_eq_prod_range]
112+
82113
end SuperFactorial
83114

84115
end Nat

Mathlib/LinearAlgebra/Matrix/Block.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,22 @@ theorem det_of_lowerTriangular [LinearOrder m] (M : Matrix m m R) (h : M.BlockTr
269269
exact det_of_upperTriangular h.transpose
270270
#align matrix.det_of_lower_triangular Matrix.det_of_lowerTriangular
271271

272+
open Polynomial
273+
274+
theorem matrixOfPolynomials_blockTriangular {n : ℕ} (p : Fin n → R[X])
275+
(h_deg : ∀ i, (p i).natDegree ≤ i) :
276+
Matrix.BlockTriangular (Matrix.of (fun (i j : Fin n) => (p j).coeff i)) id :=
277+
fun _ j h => by
278+
exact coeff_eq_zero_of_natDegree_lt <| Nat.lt_of_le_of_lt (h_deg j) h
279+
280+
theorem det_matrixOfPolynomials {n : ℕ} (p : Fin n → R[X])
281+
(h_deg : ∀ i, (p i).natDegree = i) (h_monic : ∀ i, Monic <| p i) :
282+
(Matrix.of (fun (i j : Fin n) => (p j).coeff i)).det = 1 := by
283+
rw [Matrix.det_of_upperTriangular (Matrix.matrixOfPolynomials_blockTriangular p (fun i ↦
284+
Nat.le_of_eq (h_deg i)))]
285+
convert prod_const_one with x _
286+
rw [Matrix.of_apply, ← h_deg, coeff_natDegree, (h_monic x).leadingCoeff]
287+
272288
/-! ### Invertible -/
273289

274290

Mathlib/LinearAlgebra/Vandermonde.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Anne Baanen
55
-/
66
import Mathlib.Algebra.BigOperators.Fin
77
import Mathlib.Algebra.GeomSum
8+
import Mathlib.LinearAlgebra.Matrix.Block
89
import Mathlib.LinearAlgebra.Matrix.Determinant
910
import Mathlib.LinearAlgebra.Matrix.Nondegenerate
1011

@@ -185,4 +186,26 @@ theorem eq_zero_of_forall_pow_sum_mul_pow_eq_zero {R : Type*} [CommRing R] [IsDo
185186
eq_zero_of_vecMul_eq_zero (det_vandermonde_ne_zero_iff.mpr hf) (funext hfv)
186187
#align matrix.eq_zero_of_forall_pow_sum_mul_pow_eq_zero Matrix.eq_zero_of_forall_pow_sum_mul_pow_eq_zero
187188

189+
open Polynomial
190+
191+
theorem eval_matrixOfPolynomials_eq_vandermonde_mul_matrixOfPolynomials {n : ℕ}
192+
(v : Fin n → R) (p : Fin n → R[X]) (h_deg : ∀ i, (p i).natDegree ≤ i) :
193+
Matrix.of (fun i j => ((p j).eval (v i))) =
194+
(Matrix.vandermonde v) * (Matrix.of (fun (i j : Fin n) => (p j).coeff i)) := by
195+
ext i j
196+
rw [Matrix.mul_apply, eval, Matrix.of_apply, eval₂]
197+
simp only [eq_intCast, Int.cast_id, Matrix.vandermonde]
198+
have : (p j).support ⊆ range n := supp_subset_range <| Nat.lt_of_le_of_lt (h_deg j) <| Fin.prop j
199+
rw [sum_eq_of_subset _ (fun j => zero_mul ((v i) ^ j)) this, ← Fin.sum_univ_eq_sum_range]
200+
congr
201+
ext k
202+
rw [mul_comm, Matrix.of_apply, RingHom.id_apply]
203+
204+
theorem det_eval_matrixOfPolynomials_eq_det_vandermonde {n : ℕ} (v : Fin n → R) (p : Fin n → R[X])
205+
(h_deg : ∀ i, (p i).natDegree = i) (h_monic : ∀ i, Monic <| p i) :
206+
(Matrix.vandermonde v).det = (Matrix.of (fun i j => ((p j).eval (v i)))).det := by
207+
rw [Matrix.eval_matrixOfPolynomials_eq_vandermonde_mul_matrixOfPolynomials v p (fun i ↦
208+
Nat.le_of_eq (h_deg i)), Matrix.det_mul,
209+
Matrix.det_matrixOfPolynomials p h_deg h_monic, mul_one]
210+
188211
end Matrix

docs/references.bib

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,19 @@ @Book{ cassels1967algebraic
595595
mrclass = {00.04 (10.00)}
596596
}
597597

598+
@Article{ chapman1996,
599+
author = {Chapman, Robin},
600+
title = {A Polynomial Taking Integer Values},
601+
journal = {Math. Mag.},
602+
fjournal = {Mathematics Magazine},
603+
volume = {69},
604+
year = {1996},
605+
pages = {121--121},
606+
number = {2},
607+
publisher = {Taylor & Francis, Ltd. on behalf of the Mathematical
608+
Association of America}
609+
}
610+
598611
@InProceedings{ Chou1994,
599612
author = {Chou, Ching-Tsun},
600613
booktitle = {Higher Order Logic Theorem Proving and Its Applications},

0 commit comments

Comments
 (0)