chore: swap ≠ in count_cons_of_ne (#7650)
This PR fixes the argument order in the inequality in `count_cons_of_ne` so that it is consistent and follows the convention of "the more variable argument goes on the left". This also allows for golfing the proof. [#lean4 > argument order in`count_cons_of_ne`](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/argument.20order.20in.60count_cons_of_ne.60)
This commit is contained in:
parent
608a5899dc
commit
1e40151e2c
1 changed files with 2 additions and 3 deletions
|
|
@ -257,9 +257,8 @@ variable [LawfulBEq α]
|
|||
@[simp] theorem count_cons_self (a : α) (l : List α) : count a (a :: l) = count a l + 1 := by
|
||||
simp [count_cons]
|
||||
|
||||
@[simp] theorem count_cons_of_ne (h : a ≠ b) (l : List α) : count a (b :: l) = count a l := by
|
||||
simp only [count_cons, cond_eq_if, beq_iff_eq]
|
||||
split <;> simp_all
|
||||
@[simp] theorem count_cons_of_ne (h : b ≠ a) (l : List α) : count a (b :: l) = count a l := by
|
||||
simp [count_cons, h]
|
||||
|
||||
theorem count_singleton_self (a : α) : count a [a] = 1 := by simp
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue