Skip to content

Commit ecc9242

Browse files
committed
chore(Data/Vector): add grind to cons lemmas (leanprover-community#39098)
This PR affects `List.Vector.head_cons` and `List.Vector.tail_cons`. It moves the simp attribute assignment of these lemmas to the lemma declarations and also applies the `grind =` attribute.
1 parent 9e03908 commit ecc9242

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Mathlib/Data/Vector/Basic.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ namespace List.Vector
3030
@[inherit_doc]
3131
infixr:67 " ::ᵥ " => Vector.cons
3232

33-
attribute [simp] head_cons tail_cons
34-
3533
instance [Inhabited α] : Inhabited (Vector α n) :=
3634
⟨ofFn default⟩
3735

Mathlib/Data/Vector/Defs.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def head : Vector α (Nat.succ n) → α
6565
| ⟨a :: _, _⟩ => a
6666

6767
/-- The head of a vector obtained by prepending is the element prepended. -/
68+
@[simp, grind =]
6869
theorem head_cons (a : α) : ∀ v : Vector α n, head (cons a v) = a
6970
| ⟨_, _⟩ => rfl
7071

@@ -74,6 +75,7 @@ def tail : Vector α n → Vector α (n - 1)
7475
| ⟨_ :: v, h⟩ => ⟨v, congrArg pred h⟩
7576

7677
/-- The tail of a vector obtained by prepending is the vector prepended. to -/
78+
@[simp, grind =]
7779
theorem tail_cons (a : α) : ∀ v : Vector α n, tail (cons a v) = v
7880
| ⟨_, _⟩ => rfl
7981

0 commit comments

Comments
 (0)