chore: move @[simp] attribute on length_eq_zero earlier (#4077)

Cleanup.
This commit is contained in:
Kim Morrison 2024-05-06 21:14:18 +10:00 committed by GitHub
parent 9e4c414f48
commit 35d9307df3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,7 @@ theorem eq_nil_of_length_eq_zero (_ : length l = 0) : l = [] := match l with | [
theorem ne_nil_of_length_eq_succ (_ : length l = succ n) : l ≠ [] := fun _ => nomatch l
theorem length_eq_zero : length l = 0 ↔ l = [] :=
@[simp] theorem length_eq_zero : length l = 0 ↔ l = [] :=
⟨eq_nil_of_length_eq_zero, fun h => h ▸ rfl⟩
/-! ### mem -/
@ -784,8 +784,6 @@ theorem exists_cons_of_length_succ :
∀ {l : List α}, l.length = n + 1 → ∃ h t, l = h :: t
| _::_, _ => ⟨_, _, rfl⟩
attribute [simp] length_eq_zero -- TODO: suggest to core
@[simp]
theorem length_pos {l : List α} : 0 < length l ↔ l ≠ [] :=
Nat.pos_iff_ne_zero.trans (not_congr length_eq_zero)