Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit f668be0

Browse files
committed
feat(data/list/zip): parameterize zip_append more generally (#5650)
zip_append should only require that each pair of lists is of the same type
1 parent f4128dc commit f668be0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/data/list/zip.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ lemma lt_length_right_of_zip {i : ℕ} {l : list α} {l' : list β} (h : i < (zi
6666
i < l'.length :=
6767
lt_length_right_of_zip_with h
6868

69-
theorem zip_append : ∀ {l₁ l₂ r₁ r₂ : list α} (h : length l₁ = length l₂),
69+
theorem zip_append : ∀ {l₁ r₁ : list α} {l₂ r₂ : list β} (h : length l₁ = length l₂),
7070
zip (l₁ ++ r₁) (l₂ ++ r₂) = zip l₁ l₂ ++ zip r₁ r₂
71-
| [] l₂ r₁ r₂ h := by simp only [eq_nil_of_length_eq_zero h.symm]; refl
72-
| l₁ [] r₁ r₂ h := by simp only [eq_nil_of_length_eq_zero h]; refl
73-
| (a::l₁) (b::l₂) r₁ r₂ h := by simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)];
71+
| [] r₁ l₂ r₂ h := by simp only [eq_nil_of_length_eq_zero h.symm]; refl
72+
| l₁ r₁ [] r₂ h := by simp only [eq_nil_of_length_eq_zero h]; refl
73+
| (a::l₁) r₁ (b::l₂) r₂ h := by simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)];
7474
split; refl
7575

7676
theorem zip_map (f : α → γ) (g : β → δ) : ∀ (l₁ : list α) (l₂ : list β),

0 commit comments

Comments
 (0)