Skip to content

Commit

Permalink
chore(data/list/perm): make perm_nil a simp lemma (#8191)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Jul 4, 2021
1 parent a9db7ce commit 7135c96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data/list/perm.lean
Expand Up @@ -116,9 +116,14 @@ eq_nil_of_length_eq_zero p.length_eq
theorem perm.nil_eq {l : list α} (p : [] ~ l) : [] = l :=
p.symm.eq_nil.symm

@[simp]
theorem perm_nil {l₁ : list α} : l₁ ~ [] ↔ l₁ = [] :=
⟨λ p, p.eq_nil, λ e, e ▸ perm.refl _⟩

@[simp]
theorem nil_perm {l₁ : list α} : [] ~ l₁ ↔ l₁ = [] :=
perm_comm.trans perm_nil

theorem not_perm_nil_cons (x : α) (l : list α) : ¬ [] ~ x::l
| p := by injection p.symm.eq_nil

Expand Down

0 comments on commit 7135c96

Please sign in to comment.