Skip to content

Commit cf8960e

Browse files
committed
chore(Stirling): improve tactic clarity and proof readability
1 parent 3a2c161 commit cf8960e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

Mathlib/Combinatorics/Enumerative/Stirling.lean

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,16 @@ theorem stirlingFirst_eq_zero_of_lt : ∀ {n k : ℕ}, n < k → stirlingFirst n
8888
| n + 1, k + 1, hk => by
8989
have hnk : n < k := Nat.lt_of_succ_lt_succ hk
9090
have hnk1 : n < k + 1 := Nat.lt_of_succ_lt hk
91-
simp [stirlingFirst_succ_succ, stirlingFirst_eq_zero_of_lt hnk,
92-
stirlingFirst_eq_zero_of_lt hnk1]
91+
rw [stirlingFirst_succ_succ, stirlingFirst_eq_zero_of_lt hnk,
92+
stirlingFirst_eq_zero_of_lt hnk1, mul_zero]
9393

9494
theorem stirlingFirst_self (n : ℕ) : stirlingFirst n n = 1 := by
95-
induction n <;> simp [*, stirlingFirst, stirlingFirst_eq_zero_of_lt (Nat.lt_succ_self _)]
95+
induction n <;> simp only [*, stirlingFirst, stirlingFirst_eq_zero_of_lt (Nat.lt_succ_self _),
96+
mul_zero]
9697

9798
theorem stirlingFirst_succ_self_left (n : ℕ) : stirlingFirst (n + 1) n = (n + 1).choose 2 := by
9899
induction' n with n ih
99-
· simp
100+
· simp only [zero_add, stirlingFirst_succ_zero, choose_succ_self]
100101
· rw [stirlingFirst_succ_succ, ih, stirlingFirst_self, mul_one, Nat.choose_succ_succ (n + 1),
101102
Nat.choose_one_right]
102103

@@ -153,11 +154,12 @@ theorem stirlingSecond_eq_zero_of_lt : ∀ {n k : ℕ}, n < k → stirlingSecond
153154
| n + 1, k + 1, hk => by
154155
have hnk : n < k := Nat.lt_of_succ_lt_succ hk
155156
have hnk1 : n < k + 1 := Nat.lt_of_succ_lt hk
156-
simp [stirlingSecond_succ_succ, stirlingSecond_eq_zero_of_lt hnk,
157-
stirlingSecond_eq_zero_of_lt hnk1]
157+
simp only [stirlingSecond_succ_succ, stirlingSecond_eq_zero_of_lt hnk,
158+
stirlingSecond_eq_zero_of_lt hnk1, mul_zero]
158159

159160
theorem stirlingSecond_self (n : ℕ) : stirlingSecond n n = 1 := by
160-
induction n <;> simp [*, stirlingSecond, stirlingSecond_eq_zero_of_lt (lt_succ_self _)]
161+
induction n <;> simp only [*, stirlingSecond, stirlingSecond_eq_zero_of_lt (lt_succ_self _),
162+
mul_zero]
161163

162164
theorem stirlingSecond_one_right (n : ℕ) : stirlingSecond (n + 1) 1 = 1 := by
163165
induction' n with n ih
@@ -167,7 +169,7 @@ theorem stirlingSecond_one_right (n : ℕ) : stirlingSecond (n + 1) 1 = 1 := by
167169
theorem stirlingSecond_succ_self_left (n : ℕ) :
168170
stirlingSecond (n + 1) n = (n + 1).choose 2 := by
169171
induction' n with n ih
170-
· simp
172+
· simp only [zero_add, stirlingSecond_succ_zero, choose_succ_self]
171173
· rw [stirlingSecond_succ_succ, ih, stirlingSecond_self, mul_one,
172174
Nat.choose_succ_succ (n + 1), Nat.choose_one_right]
173175

0 commit comments

Comments
 (0)