Skip to content

Commit e5eea67

Browse files
authored
chore: reverse direction of List.tail_map (#5275)
1 parent 943dec4 commit e5eea67

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Init/Data/List/Lemmas.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,18 +1151,18 @@ theorem map_eq_foldr (f : α → β) (l : List α) : map f l = foldr (fun a bs =
11511151
@[simp] theorem head?_map (f : α → β) (l : List α) : head? (map f l) = (head? l).map f := by
11521152
cases l <;> rfl
11531153

1154-
@[simp] theorem tail?_map (f : α → β) (l : List α) : tail? (map f l) = (tail? l).map (map f) := by
1154+
@[simp] theorem map_tail? (f : α → β) (l : List α) : (tail? l).map (map f) = tail? (map f l) := by
11551155
cases l <;> rfl
11561156

1157-
@[simp] theorem tail_map (f : α → β) (l : List α) :
1158-
(map f l).tail = map f l.tail := by
1157+
@[simp] theorem map_tail (f : α → β) (l : List α) :
1158+
map f l.tail = (map f l).tail := by
11591159
cases l <;> simp_all
11601160

11611161
theorem headD_map (f : α → β) (l : List α) (a : α) : headD (map f l) (f a) = f (headD l a) := by
11621162
cases l <;> rfl
11631163

11641164
theorem tailD_map (f : α → β) (l : List α) (l' : List α) :
1165-
tailD (map f l) (map f l') = map f (tailD l l') := by simp
1165+
tailD (map f l) (map f l') = map f (tailD l l') := by simp [← map_tail?]
11661166

11671167
@[simp] theorem getLast_map (f : α → β) (l : List α) (h) :
11681168
getLast (map f l) h = f (getLast l (by simpa using h)) := by

0 commit comments

Comments
 (0)