Skip to content

Commit 603dcd5

Browse files
committed
chore(Algebra/BigOperators/Intervals): move Finset.prod_range_add_one_eq_factorial to Data/Nat/Factorial/BigOperators
1 parent a2df56f commit 603dcd5

5 files changed

Lines changed: 14 additions & 10 deletions

File tree

Mathlib/Algebra/BigOperators/Intervals.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ theorem prod_Ico_id_eq_factorial : ∀ n : ℕ, (∏ x ∈ Ico 1 (n + 1), x) = n
167167
rw [prod_Ico_succ_top <| Nat.succ_le_succ <| Nat.zero_le n, Nat.factorial_succ,
168168
prod_Ico_id_eq_factorial n, Nat.succ_eq_add_one, mul_comm]
169169

170-
@[simp]
171-
theorem prod_range_add_one_eq_factorial : ∀ n : ℕ, (∏ x ∈ range n, (x + 1)) = n !
172-
| 0 => rfl
173-
| n + 1 => by simp [factorial, Finset.range_add_one, prod_range_add_one_eq_factorial n]
174-
175170
section GaussSum
176171

177172
/-- Gauss' summation formula -/

Mathlib/Analysis/SpecificLimits/Basic.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Sébastien Gouëzel, Johannes Hölzl, Yury Kudryashov, Patrick Massot
55
-/
66
import Mathlib.Algebra.Field.GeomSum
7+
import Mathlib.Data.Nat.Factorial.BigOperators
78
import Mathlib.Order.Filter.AtTopBot.Archimedean
89
import Mathlib.Order.Iterate
910
import Mathlib.Topology.Algebra.Algebra
@@ -664,7 +665,7 @@ theorem tendsto_factorial_div_pow_self_atTop :
664665
(by
665666
refine (eventually_gt_atTop 0).mono fun n hn ↦ ?_
666667
rcases Nat.exists_eq_succ_of_ne_zero hn.ne.symm with ⟨k, rfl⟩
667-
rw [← prod_range_add_one_eq_factorial, pow_eq_prod_const, div_eq_mul_inv, ← inv_eq_one_div,
668+
rw [factorial_eq_prod_range_add_one, pow_eq_prod_const, div_eq_mul_inv, ← inv_eq_one_div,
668669
prod_natCast, Nat.cast_succ, ← Finset.prod_inv_distrib, ← prod_mul_distrib,
669670
Finset.prod_range_succ']
670671
simp only [one_mul, Nat.cast_add, zero_add, Nat.cast_one]

Mathlib/Data/Nat/Factorial/BigOperators.lean

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ theorem prod_factorial_dvd_factorial_sum : (∏ i ∈ s, (f i)!) ∣ (∑ i ∈
3434
rw [prod_cons, Finset.sum_cons]
3535
exact (mul_dvd_mul_left _ ih).trans (Nat.factorial_mul_factorial_dvd_factorial_add _ _)
3636

37+
theorem factorial_eq_prod_range_add_one : ∀ n, (n)! = ∏ i ∈ range n, (i + 1)
38+
| 0 => rfl
39+
| n + 1 => by rw [factorial, prod_range_succ_comm, factorial_eq_prod_range_add_one n]
40+
41+
@[simp]
42+
theorem _root_.Finset.prod_range_add_one_eq_factorial (n : ℕ) : ∏ i ∈ range n, (i + 1) = (n)! :=
43+
factorial_eq_prod_range_add_one _ |>.symm
44+
3745
theorem ascFactorial_eq_prod_range (n : ℕ) : ∀ k, n.ascFactorial k = ∏ i ∈ range k, (n + i)
3846
| 0 => rfl
39-
| k + 1 => by rw [ascFactorial, prod_range_succ, mul_comm, ascFactorial_eq_prod_range n k]
47+
| k + 1 => by rw [ascFactorial, prod_range_succ_comm, ascFactorial_eq_prod_range n k]
4048

4149
theorem descFactorial_eq_prod_range (n : ℕ) : ∀ k, n.descFactorial k = ∏ i ∈ range k, (n - i)
4250
| 0 => rfl
43-
| k + 1 => by rw [descFactorial, prod_range_succ, mul_comm, descFactorial_eq_prod_range n k]
51+
| k + 1 => by rw [descFactorial, prod_range_succ_comm, descFactorial_eq_prod_range n k]
4452

4553
/-- `k!` divides the product of any `k` consecutive integers. -/
4654
lemma factorial_coe_dvd_prod (k : ℕ) (n : ℤ) : (k ! : ℤ) ∣ ∏ i ∈ range k, (n + i) := by

Mathlib/Data/ZMod/Factorial.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2023 Moritz Firsching. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Moritz Firsching
55
-/
6-
import Mathlib.Algebra.BigOperators.Intervals
76
import Mathlib.Data.Nat.Factorial.BigOperators
87
import Mathlib.Data.ZMod.Basic
98

@@ -32,7 +31,7 @@ namespace ZMod
3231

3332
theorem cast_descFactorial {n p : ℕ} (h : n ≤ p) :
3433
(descFactorial (p - 1) n : ZMod p) = (-1) ^ n * n ! := by
35-
rw [descFactorial_eq_prod_range, ← prod_range_add_one_eq_factorial]
34+
rw [descFactorial_eq_prod_range, factorial_eq_prod_range_add_one]
3635
simp only [cast_prod]
3736
nth_rw 2 [← card_range n]
3837
rw [pow_card_mul_prod]

Mathlib/LinearAlgebra/Vandermonde.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Anne Baanen, Peter Nelson
55
-/
6+
import Mathlib.Data.Nat.Factorial.BigOperators
67
import Mathlib.Data.Nat.Factorial.SuperFactorial
78
import Mathlib.LinearAlgebra.Matrix.Block
89
import Mathlib.LinearAlgebra.Matrix.Nondegenerate

0 commit comments

Comments
 (0)