Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 0bba837

Browse files
committed
chore(data/nat/factorial): use n + 1 instead of n.succ in nat.factorial_succ (#9645)
1 parent 3d438ba commit 0bba837

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/data/nat/choose/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ lemma choose_mul_factorial_mul_factorial : ∀ {n k}, k ≤ n → choose n k * k
9393
| (n + 1) (succ k) hk :=
9494
begin
9595
cases lt_or_eq_of_le hk with hk₁ hk₁,
96-
{ have h : choose n k * k.succ! * (n-k)! = k.succ * n! :=
96+
{ have h : choose n k * k.succ! * (n-k)! = (k + 1) * n! :=
9797
by rw ← choose_mul_factorial_mul_factorial (le_of_succ_le_succ hk);
9898
simp [factorial_succ, mul_comm, mul_left_comm],
9999
have h₁ : (n - k)! = (n - k) * (n - k.succ)! :=
@@ -102,7 +102,7 @@ begin
102102
by rw ← choose_mul_factorial_mul_factorial (le_of_lt_succ hk₁);
103103
simp [factorial_succ, mul_comm, mul_left_comm, mul_assoc],
104104
have h₃ : k * n! ≤ n * n! := nat.mul_le_mul_right _ (le_of_succ_le_succ hk),
105-
rw [choose_succ_succ, add_mul, add_mul, succ_sub_succ, h, h₁, h₂, ← add_one, add_mul,
105+
rw [choose_succ_succ, add_mul, add_mul, succ_sub_succ, h, h₁, h₂, add_mul,
106106
nat.mul_sub_right_distrib, factorial_succ, ← nat.add_sub_assoc h₃, add_assoc, ← add_mul,
107107
nat.add_sub_cancel_left, add_comm] },
108108
{ simp [hk₁, mul_comm, choose, nat.sub_self] }

src/data/nat/factorial/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variables {m n : ℕ}
3535

3636
@[simp] theorem factorial_zero : 0! = 1 := rfl
3737

38-
@[simp] theorem factorial_succ (n : ℕ) : n.succ! = succ n * n! := rfl
38+
@[simp] theorem factorial_succ (n : ℕ) : n.succ! = (n + 1) * n! := rfl
3939

4040
@[simp] theorem factorial_one : 1! = 1 := rfl
4141

@@ -125,7 +125,7 @@ end
125125
lemma add_factorial_succ_lt_factorial_add_succ {i : ℕ} (n : ℕ) (hi : 2 ≤ i) :
126126
i + (n + 1)! < (i + n + 1)! :=
127127
begin
128-
rw [factorial_succ (i + _), succ_eq_add_one, add_mul, one_mul],
128+
rw [factorial_succ (i + _), add_mul, one_mul],
129129
have : i ≤ i + n := le.intro rfl,
130130
exact add_lt_add_of_lt_of_le (this.trans_lt ((lt_mul_iff_one_lt_right (zero_lt_two.trans_le
131131
(hi.trans this))).mpr (lt_iff_le_and_ne.mpr ⟨(i + n).factorial_pos, λ g,

src/number_theory/liouville/liouville_constant.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We prove that, for $m \in \mathbb{N}$ satisfying $2 \le m$, Liouville's constant
2323
is a transcendental number. Classically, the Liouville number for $m = 2$ is the one called
2424
``Liouville's constant''.
2525
26-
# Implementation notes
26+
## Implementation notes
2727
2828
The indexing $m$ is eventually a natural number satisfying $2 ≤ m$. However, we prove the first few
2929
lemmas for $m \in \mathbb{R}$.
@@ -159,7 +159,7 @@ begin
159159
{ norm_cast,
160160
rw [add_mul, one_mul, nat.factorial_succ,
161161
show k.succ * k! - k! = (k.succ - 1) * k!, by rw [nat.mul_sub_right_distrib, one_mul],
162-
nat.succ_sub_one, nat.succ_eq_add_one, add_mul, one_mul, pow_add],
162+
nat.succ_sub_one, add_mul, one_mul, pow_add],
163163
simp [mul_assoc] },
164164
refine mul_ne_zero_iff.mpr ⟨_, _⟩,
165165
all_goals { exact pow_ne_zero _ (nat.cast_ne_zero.mpr hm.ne.symm) } }

0 commit comments

Comments
 (0)