Skip to content

Commit

Permalink
fix: rm off-by-one error in finset.eventually_constant_prod (#7333)
Browse files Browse the repository at this point in the history
The hypothesis is that the function is trivial for all indices `\geq N`, and the original conclusion is that for `n \geq N` the product up to `n` is equal to the product up to `N` (namely `range N+1`), but we can strengthen this by removing the index `N` part.  This change is especially important for simplifying products and sums with only the initial term nontrivial.
  • Loading branch information
ScottCarnahan committed Sep 24, 2023
1 parent 7bb9c63 commit c2c14af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Algebra/BigOperators/Basic.lean
Expand Up @@ -1232,7 +1232,7 @@ theorem prod_range_succ' (f : ℕ → β) :

@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
(∏ k in range (n + 1), u k) = ∏ k in range (N + 1), u k := by
(∏ k in range n, u k) = ∏ k in range N, u k := by
obtain ⟨m, rfl : n = N + m⟩ := le_iff_exists_add.mp hn
clear hn
induction' m with m hm
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/Normed/Group/Basic.lean
Expand Up @@ -1990,9 +1990,9 @@ theorem cauchySeq_prod_of_eventually_eq {u v : ℕ → E} {N : ℕ} (huv : ∀ n
suffices ∀ n ≥ N, d n = d N by exact (tendsto_atTop_of_eventually_const this).cauchySeq.mul hv
intro n hn
dsimp
rw [eventually_constant_prod _ hn]
rw [eventually_constant_prod _ (add_le_add_right hn 1)]
intro m hm
simp [huv m hm]
simp [huv m (le_of_lt hm)]
#align cauchy_seq_prod_of_eventually_eq cauchySeq_prod_of_eventually_eq
#align cauchy_seq_sum_of_eventually_eq cauchySeq_sum_of_eventually_eq

Expand Down

0 comments on commit c2c14af

Please sign in to comment.