data.list.zip
⟷
Mathlib.Data.List.Zip
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
-import Data.List.BigOperators.Basic
+import Algebra.BigOperators.List.Basic
import Algebra.Order.Monoid.MinMax
#align_import data.list.zip from "leanprover-community/mathlib"@"be24ec5de6701447e5df5ca75400ffee19d65659"
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -118,20 +118,20 @@ theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
- | a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h ; simp [all₂_zip_with h]
+ | a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h; simp [all₂_zip_with h]
#align list.all₂_zip_with List.forall_zipWith
-/
#print List.lt_length_left_of_zipWith /-
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h ;
+ (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
-/
#print List.lt_length_right_of_zipWith /-
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h ;
+ (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
-/
@@ -240,8 +240,8 @@ theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l
theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
- | a :: as, b :: bs, h => by simp at h ; simp! [*]
- | a :: as, [], h => by simp at h ; contradiction
+ | a :: as, b :: bs, h => by simp at h; simp! [*]
+ | a :: as, [], h => by simp at h; contradiction
#align list.map_fst_zip List.map_fst_zip
-/
@@ -249,8 +249,8 @@ theorem map_fst_zip :
theorem map_snd_zip :
∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
| _, [], _ => by rw [zip_nil_right]; rfl
- | [], b :: bs, h => by simp at h ; contradiction
- | a :: as, b :: bs, h => by simp at h ; simp! [*]
+ | [], b :: bs, h => by simp at h; contradiction
+ | a :: as, b :: bs, h => by simp at h; simp! [*]
#align list.map_snd_zip List.map_snd_zip
-/
@@ -622,7 +622,7 @@ theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
simp [this]
· cases l'
· simpa using h
- · simp only [add_left_inj, length] at h
+ · simp only [add_left_inj, length] at h
simp [hl _ h]
#align list.zip_with_append List.zipWith_append
-/
@@ -635,7 +635,7 @@ theorem zipWith_distrib_reverse (h : l.length = l'.length) :
· simp
· cases' l' with hd' tl'
· simp
- · simp only [add_left_inj, length] at h
+ · simp only [add_left_inj, length] at h
have : tl.reverse.length = tl'.reverse.length := by simp [h]
simp [hl _ h, zip_with_append _ _ _ _ _ this]
#align list.zip_with_distrib_reverse List.zipWith_distrib_reverse
mathlib commit https://github.com/leanprover-community/mathlib/commit/3365b20c2ffa7c35e47e5209b89ba9abdddf3ffe
@@ -113,13 +113,13 @@ theorem length_zip :
#align list.length_zip List.length_zip
-/
-#print List.all₂_zipWith /-
-theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
+#print List.forall_zipWith /-
+theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
- All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
+ Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
| a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h ; simp [all₂_zip_with h]
-#align list.all₂_zip_with List.all₂_zipWith
+#align list.all₂_zip_with List.forall_zipWith
-/
#print List.lt_length_left_of_zipWith /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
-import Mathbin.Data.List.BigOperators.Basic
-import Mathbin.Algebra.Order.Monoid.MinMax
+import Data.List.BigOperators.Basic
+import Algebra.Order.Monoid.MinMax
#align_import data.list.zip from "leanprover-community/mathlib"@"be24ec5de6701447e5df5ca75400ffee19d65659"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-
-! This file was ported from Lean 3 source module data.list.zip
-! leanprover-community/mathlib commit be24ec5de6701447e5df5ca75400ffee19d65659
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.List.BigOperators.Basic
import Mathbin.Algebra.Order.Monoid.MinMax
+#align_import data.list.zip from "leanprover-community/mathlib"@"be24ec5de6701447e5df5ca75400ffee19d65659"
+
/-!
# zip & unzip
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -36,42 +36,57 @@ namespace List
variable {α : Type u} {β γ δ ε : Type _}
+#print List.zipWith_cons_cons /-
@[simp]
theorem zipWith_cons_cons (f : α → β → γ) (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
zipWith f (a :: l₁) (b :: l₂) = f a b :: zipWith f l₁ l₂ :=
rfl
#align list.zip_with_cons_cons List.zipWith_cons_cons
+-/
+#print List.zip_cons_cons /-
@[simp]
theorem zip_cons_cons (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
zip (a :: l₁) (b :: l₂) = (a, b) :: zip l₁ l₂ :=
rfl
#align list.zip_cons_cons List.zip_cons_cons
+-/
+#print List.zipWith_nil_left /-
@[simp]
theorem zipWith_nil_left (f : α → β → γ) (l) : zipWith f [] l = [] :=
rfl
#align list.zip_with_nil_left List.zipWith_nil_left
+-/
+#print List.zipWith_nil_right /-
@[simp]
theorem zipWith_nil_right (f : α → β → γ) (l) : zipWith f l [] = [] := by cases l <;> rfl
#align list.zip_with_nil_right List.zipWith_nil_right
+-/
+#print List.zipWith_eq_nil_iff /-
@[simp]
theorem zipWith_eq_nil_iff {f : α → β → γ} {l l'} : zipWith f l l' = [] ↔ l = [] ∨ l' = [] := by
cases l <;> cases l' <;> simp
#align list.zip_with_eq_nil_iff List.zipWith_eq_nil_iff
+-/
+#print List.zip_nil_left /-
@[simp]
theorem zip_nil_left (l : List α) : zip ([] : List β) l = [] :=
rfl
#align list.zip_nil_left List.zip_nil_left
+-/
+#print List.zip_nil_right /-
@[simp]
theorem zip_nil_right (l : List α) : zip l ([] : List β) = [] :=
zipWith_nil_right _ l
#align list.zip_nil_right List.zip_nil_right
+-/
+#print List.zip_swap /-
@[simp]
theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Prod.swap = zip l₂ l₁
| [], l₂ => (zip_nil_right _).symm
@@ -79,9 +94,11 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
| a :: l₁, b :: l₂ => by
simp only [zip_cons_cons, map_cons, zip_swap l₁ l₂, Prod.swap_prod_mk] <;> constructor <;> rfl
#align list.zip_swap List.zip_swap
+-/
/- warning: list.length_zip_with clashes with list.length_map₂ -> List.length_zipWith
Case conversion may be inaccurate. Consider using '#align list.length_zip_with List.length_zipWithₓ'. -/
+#print List.length_zipWith /-
@[simp]
theorem length_zipWith (f : α → β → γ) :
∀ (l₁ : List α) (l₂ : List β), length (zipWith f l₁ l₂) = min (length l₁) (length l₂)
@@ -89,40 +106,54 @@ theorem length_zipWith (f : α → β → γ) :
| l₁, [] => by simp only [length, min_zero, zip_with_nil_right]
| a :: l₁, b :: l₂ => by simp [length, zip_cons_cons, length_zip_with l₁ l₂, min_add_add_right]
#align list.length_zip_with List.length_zipWith
+-/
+#print List.length_zip /-
@[simp]
theorem length_zip :
∀ (l₁ : List α) (l₂ : List β), length (zip l₁ l₂) = min (length l₁) (length l₂) :=
length_zipWith _
#align list.length_zip List.length_zip
+-/
+#print List.all₂_zipWith /-
theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
| a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h ; simp [all₂_zip_with h]
#align list.all₂_zip_with List.all₂_zipWith
+-/
+#print List.lt_length_left_of_zipWith /-
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
(h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h ;
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
+-/
+#print List.lt_length_right_of_zipWith /-
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
(h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h ;
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
+-/
+#print List.lt_length_left_of_zip /-
theorem lt_length_left_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (zip l l').length) :
i < l.length :=
lt_length_left_of_zipWith h
#align list.lt_length_left_of_zip List.lt_length_left_of_zip
+-/
+#print List.lt_length_right_of_zip /-
theorem lt_length_right_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (zip l l').length) :
i < l'.length :=
lt_length_right_of_zipWith h
#align list.lt_length_right_of_zip List.lt_length_right_of_zip
+-/
+#print List.zip_append /-
theorem zip_append :
∀ {l₁ r₁ : List α} {l₂ r₂ : List β} (h : length l₁ = length l₂),
zip (l₁ ++ r₁) (l₂ ++ r₂) = zip l₁ l₂ ++ zip r₁ r₂
@@ -131,7 +162,9 @@ theorem zip_append :
| a :: l₁, r₁, b :: l₂, r₂, h => by
simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)] <;> constructor <;> rfl
#align list.zip_append List.zip_append
+-/
+#print List.zip_map /-
theorem zip_map (f : α → γ) (g : β → δ) :
∀ (l₁ : List α) (l₂ : List β), zip (l₁.map f) (l₂.map g) = (zip l₁ l₂).map (Prod.map f g)
| [], l₂ => rfl
@@ -139,15 +172,21 @@ theorem zip_map (f : α → γ) (g : β → δ) :
| a :: l₁, b :: l₂ => by
simp only [map, zip_cons_cons, zip_map l₁ l₂, Prod.map] <;> constructor <;> rfl
#align list.zip_map List.zip_map
+-/
+#print List.zip_map_left /-
theorem zip_map_left (f : α → γ) (l₁ : List α) (l₂ : List β) :
zip (l₁.map f) l₂ = (zip l₁ l₂).map (Prod.map f id) := by rw [← zip_map, map_id]
#align list.zip_map_left List.zip_map_left
+-/
+#print List.zip_map_right /-
theorem zip_map_right (f : β → γ) (l₁ : List α) (l₂ : List β) :
zip l₁ (l₂.map f) = (zip l₁ l₂).map (Prod.map id f) := by rw [← zip_map, map_id]
#align list.zip_map_right List.zip_map_right
+-/
+#print List.zipWith_map /-
@[simp]
theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ) (as : List α) (bs : List β) :
zipWith f (as.map g) (bs.map h) = zipWith (fun a b => f (g a) (h b)) as bs :=
@@ -156,23 +195,31 @@ theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ)
· simp
· cases bs <;> simp [*]
#align list.zip_with_map List.zipWith_map
+-/
+#print List.zipWith_map_left /-
theorem zipWith_map_left (f : α → β → γ) (g : δ → α) (l : List δ) (l' : List β) :
zipWith f (l.map g) l' = zipWith (f ∘ g) l l' := by convert zip_with_map f g id l l';
exact Eq.symm (List.map_id _)
#align list.zip_with_map_left List.zipWith_map_left
+-/
+#print List.zipWith_map_right /-
theorem zipWith_map_right (f : α → β → γ) (l : List α) (g : δ → β) (l' : List δ) :
zipWith f l (l'.map g) = zipWith (fun x => f x ∘ g) l l' := by
convert List.zipWith_map f id g l l'; exact Eq.symm (List.map_id _)
#align list.zip_with_map_right List.zipWith_map_right
+-/
+#print List.zip_map' /-
theorem zip_map' (f : α → β) (g : α → γ) :
∀ l : List α, zip (l.map f) (l.map g) = l.map fun a => (f a, g a)
| [] => rfl
| a :: l => by simp only [map, zip_cons_cons, zip_map' l] <;> constructor <;> rfl
#align list.zip_map' List.zip_map'
+-/
+#print List.map_zipWith /-
theorem map_zipWith {δ : Type _} (f : α → β) (g : γ → δ → α) (l : List γ) (l' : List δ) :
map f (zipWith g l l') = zipWith (fun x y => f (g x y)) l l' :=
by
@@ -182,58 +229,80 @@ theorem map_zipWith {δ : Type _} (f : α → β) (g : γ → δ → α) (l : Li
· simp
· simp [hl]
#align list.map_zip_with List.map_zipWith
+-/
+#print List.mem_zip /-
theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l₁ l₂ → a ∈ l₁ ∧ b ∈ l₂
| _ :: l₁, _ :: l₂, Or.inl rfl => ⟨Or.inl rfl, Or.inl rfl⟩
| a' :: l₁, b' :: l₂, Or.inr h => by
constructor <;> simp only [mem_cons_iff, or_true_iff, mem_zip h]
#align list.mem_zip List.mem_zip
+-/
+#print List.map_fst_zip /-
theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
| a :: as, b :: bs, h => by simp at h ; simp! [*]
| a :: as, [], h => by simp at h ; contradiction
#align list.map_fst_zip List.map_fst_zip
+-/
+#print List.map_snd_zip /-
theorem map_snd_zip :
∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
| _, [], _ => by rw [zip_nil_right]; rfl
| [], b :: bs, h => by simp at h ; contradiction
| a :: as, b :: bs, h => by simp at h ; simp! [*]
#align list.map_snd_zip List.map_snd_zip
+-/
+#print List.unzip_nil /-
@[simp]
theorem unzip_nil : unzip (@nil (α × β)) = ([], []) :=
rfl
#align list.unzip_nil List.unzip_nil
+-/
+#print List.unzip_cons /-
@[simp]
theorem unzip_cons (a : α) (b : β) (l : List (α × β)) :
unzip ((a, b) :: l) = (a :: (unzip l).1, b :: (unzip l).2) := by
rw [unzip] <;> cases unzip l <;> rfl
#align list.unzip_cons List.unzip_cons
+-/
+#print List.unzip_eq_map /-
theorem unzip_eq_map : ∀ l : List (α × β), unzip l = (l.map Prod.fst, l.map Prod.snd)
| [] => rfl
| (a, b) :: l => by simp only [unzip_cons, map_cons, unzip_eq_map l]
#align list.unzip_eq_map List.unzip_eq_map
+-/
+#print List.unzip_left /-
theorem unzip_left (l : List (α × β)) : (unzip l).1 = l.map Prod.fst := by simp only [unzip_eq_map]
#align list.unzip_left List.unzip_left
+-/
+#print List.unzip_right /-
theorem unzip_right (l : List (α × β)) : (unzip l).2 = l.map Prod.snd := by simp only [unzip_eq_map]
#align list.unzip_right List.unzip_right
+-/
+#print List.unzip_swap /-
theorem unzip_swap (l : List (α × β)) : unzip (l.map Prod.swap) = (unzip l).symm := by
simp only [unzip_eq_map, map_map] <;> constructor <;> rfl
#align list.unzip_swap List.unzip_swap
+-/
+#print List.zip_unzip /-
theorem zip_unzip : ∀ l : List (α × β), zip (unzip l).1 (unzip l).2 = l
| [] => rfl
| (a, b) :: l => by simp only [unzip_cons, zip_cons_cons, zip_unzip l] <;> constructor <;> rfl
#align list.zip_unzip List.zip_unzip
+-/
+#print List.unzip_zip_left /-
theorem unzip_zip_left :
∀ {l₁ : List α} {l₂ : List β}, length l₁ ≤ length l₂ → (unzip (zip l₁ l₂)).1 = l₁
| [], l₂, h => rfl
@@ -242,37 +311,51 @@ theorem unzip_zip_left :
simp only [zip_cons_cons, unzip_cons, unzip_zip_left (le_of_succ_le_succ h)] <;> constructor <;>
rfl
#align list.unzip_zip_left List.unzip_zip_left
+-/
+#print List.unzip_zip_right /-
theorem unzip_zip_right {l₁ : List α} {l₂ : List β} (h : length l₂ ≤ length l₁) :
(unzip (zip l₁ l₂)).2 = l₂ := by rw [← zip_swap, unzip_swap] <;> exact unzip_zip_left h
#align list.unzip_zip_right List.unzip_zip_right
+-/
+#print List.unzip_zip /-
theorem unzip_zip {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂) :
unzip (zip l₁ l₂) = (l₁, l₂) := by
rw [← @Prod.mk.eta _ _ (unzip (zip l₁ l₂)), unzip_zip_left (le_of_eq h),
unzip_zip_right (ge_of_eq h)]
#align list.unzip_zip List.unzip_zip
+-/
+#print List.zip_of_prod /-
theorem zip_of_prod {l : List α} {l' : List β} {lp : List (α × β)} (hl : lp.map Prod.fst = l)
(hr : lp.map Prod.snd = l') : lp = l.zip l' := by
rw [← hl, ← hr, ← zip_unzip lp, ← unzip_left, ← unzip_right, zip_unzip, zip_unzip]
#align list.zip_of_prod List.zip_of_prod
+-/
+#print List.map_prod_left_eq_zip /-
theorem map_prod_left_eq_zip {l : List α} (f : α → β) :
(l.map fun x => (x, f x)) = l.zip (l.map f) := by rw [← zip_map']; congr; exact map_id _
#align list.map_prod_left_eq_zip List.map_prod_left_eq_zip
+-/
+#print List.map_prod_right_eq_zip /-
theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
(l.map fun x => (f x, x)) = (l.map f).zip l := by rw [← zip_map']; congr; exact map_id _
#align list.map_prod_right_eq_zip List.map_prod_right_eq_zip
+-/
+#print List.zipWith_comm /-
theorem zipWith_comm (f : α → β → γ) :
∀ (la : List α) (lb : List β), zipWith f la lb = zipWith (fun b a => f a b) lb la
| [], _ => (List.zipWith_nil_right _ _).symm
| a :: as, [] => rfl
| a :: as, b :: bs => congr_arg _ (zip_with_comm as bs)
#align list.zip_with_comm List.zipWith_comm
+-/
+#print List.zipWith_congr /-
@[congr]
theorem zipWith_congr (f g : α → β → γ) (la : List α) (lb : List β)
(h : List.Forall₂ (fun a b => f a b = g a b) la lb) : zipWith f la lb = zipWith g la lb :=
@@ -281,17 +364,23 @@ theorem zipWith_congr (f g : α → β → γ) (la : List α) (lb : List β)
· rfl
· exact congr_arg₂ _ hfg ih
#align list.zip_with_congr List.zipWith_congr
+-/
+#print List.zipWith_comm_of_comm /-
theorem zipWith_comm_of_comm (f : α → α → β) (comm : ∀ x y : α, f x y = f y x) (l l' : List α) :
zipWith f l l' = zipWith f l' l := by rw [zip_with_comm]; simp only [comm]
#align list.zip_with_comm_of_comm List.zipWith_comm_of_comm
+-/
+#print List.zipWith_same /-
@[simp]
theorem zipWith_same (f : α → α → δ) : ∀ l : List α, zipWith f l l = l.map fun a => f a a
| [] => rfl
| x :: xs => congr_arg _ (zip_with_same xs)
#align list.zip_with_same List.zipWith_same
+-/
+#print List.zipWith_zipWith_left /-
theorem zipWith_zipWith_left (f : δ → γ → ε) (g : α → β → δ) :
∀ (la : List α) (lb : List β) (lc : List γ),
zipWith f (zipWith g la lb) lc = zipWith3 (fun a b c => f (g a b) c) la lb lc
@@ -300,7 +389,9 @@ theorem zipWith_zipWith_left (f : δ → γ → ε) (g : α → β → δ) :
| a :: as, b :: bs, [] => rfl
| a :: as, b :: bs, c :: cs => congr_arg (cons _) <| zip_with_zip_with_left as bs cs
#align list.zip_with_zip_with_left List.zipWith_zipWith_left
+-/
+#print List.zipWith_zipWith_right /-
theorem zipWith_zipWith_right (f : α → δ → ε) (g : β → γ → δ) :
∀ (la : List α) (lb : List β) (lc : List γ),
zipWith f la (zipWith g lb lc) = zipWith3 (fun a b c => f a (g b c)) la lb lc
@@ -309,7 +400,9 @@ theorem zipWith_zipWith_right (f : α → δ → ε) (g : β → γ → δ) :
| a :: as, b :: bs, [] => rfl
| a :: as, b :: bs, c :: cs => congr_arg (cons _) <| zip_with_zip_with_right as bs cs
#align list.zip_with_zip_with_right List.zipWith_zipWith_right
+-/
+#print List.zipWith3_same_left /-
@[simp]
theorem zipWith3_same_left (f : α → α → β → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la la lb = zipWith (fun a b => f a a b) la lb
@@ -317,7 +410,9 @@ theorem zipWith3_same_left (f : α → α → β → γ) :
| a :: as, [] => rfl
| a :: as, b :: bs => congr_arg (cons _) <| zip_with3_same_left as bs
#align list.zip_with3_same_left List.zipWith3_same_left
+-/
+#print List.zipWith3_same_mid /-
@[simp]
theorem zipWith3_same_mid (f : α → β → α → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la lb la = zipWith (fun a b => f a b a) la lb
@@ -325,7 +420,9 @@ theorem zipWith3_same_mid (f : α → β → α → γ) :
| a :: as, [] => rfl
| a :: as, b :: bs => congr_arg (cons _) <| zip_with3_same_mid as bs
#align list.zip_with3_same_mid List.zipWith3_same_mid
+-/
+#print List.zipWith3_same_right /-
@[simp]
theorem zipWith3_same_right (f : α → β → β → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la lb lb = zipWith (fun a b => f a b b) la lb
@@ -333,6 +430,7 @@ theorem zipWith3_same_right (f : α → β → β → γ) :
| a :: as, [] => rfl
| a :: as, b :: bs => congr_arg (cons _) <| zip_with3_same_right as bs
#align list.zip_with3_same_right List.zipWith3_same_right
+-/
instance (f : α → α → β) [IsSymmOp α β f] : IsSymmOp (List α) (List β) (zipWith f) :=
⟨zipWith_comm_of_comm f IsSymmOp.symm_op⟩
@@ -376,6 +474,7 @@ theorem revzip_swap (l : List α) : (revzip l).map Prod.swap = revzip l.reverse
#align list.revzip_swap List.revzip_swap
-/
+#print List.get?_zip_with /-
theorem get?_zip_with (f : α → β → γ) (l₁ : List α) (l₂ : List β) (i : ℕ) :
(zipWith f l₁ l₂).get? i = ((l₁.get? i).map f).bind fun g => (l₂.get? i).map g :=
by
@@ -385,7 +484,9 @@ theorem get?_zip_with (f : α → β → γ) (l₁ : List α) (l₂ : List β) (
· cases (l₁_hd :: l₁_tl).get? i <;> rfl
· cases i <;> simp only [Option.map_some', nth, Option.some_bind', *]
#align list.nth_zip_with List.get?_zip_with
+-/
+#print List.get?_zip_with_eq_some /-
theorem get?_zip_with_eq_some {α β γ} (f : α → β → γ) (l₁ : List α) (l₂ : List β) (z : γ) (i : ℕ) :
(zipWith f l₁ l₂).get? i = some z ↔
∃ x y, l₁.get? i = some x ∧ l₂.get? i = some y ∧ f x y = z :=
@@ -395,7 +496,9 @@ theorem get?_zip_with_eq_some {α β γ} (f : α → β → γ) (l₁ : List α)
· cases l₂ <;> simp only [zip_with, nth, exists_false, and_false_iff, false_and_iff]
cases i <;> simp [*]
#align list.nth_zip_with_eq_some List.get?_zip_with_eq_some
+-/
+#print List.get?_zip_eq_some /-
theorem get?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i : ℕ) :
(zip l₁ l₂).get? i = some z ↔ l₁.get? i = some z.1 ∧ l₂.get? i = some z.2 :=
by
@@ -404,7 +507,9 @@ theorem get?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i :
· rintro ⟨x, y, h₀, h₁, h₂⟩; cc
· rintro ⟨h₀, h₁⟩; exact ⟨_, _, h₀, h₁, rfl⟩
#align list.nth_zip_eq_some List.get?_zip_eq_some
+-/
+#print List.nthLe_zipWith /-
@[simp]
theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i : ℕ}
{h : i < (zipWith f l l').length} :
@@ -417,13 +522,16 @@ theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i :
nth_le_nth _, _⟩
simp only [← nth_le_nth, eq_self_iff_true, and_self_iff]
#align list.nth_le_zip_with List.nthLe_zipWith
+-/
+#print List.nthLe_zip /-
@[simp]
theorem nthLe_zip {l : List α} {l' : List β} {i : ℕ} {h : i < (zip l l').length} :
(zip l l').nthLe i h =
(l.nthLe i (lt_length_left_of_zip h), l'.nthLe i (lt_length_right_of_zip h)) :=
nthLe_zipWith
#align list.nth_le_zip List.nthLe_zip
+-/
#print List.mem_zip_inits_tails /-
theorem mem_zip_inits_tails {l : List α} {init tail : List α} :
@@ -444,6 +552,7 @@ theorem mem_zip_inits_tails {l : List α} {init tail : List α} :
#align list.mem_zip_inits_tails List.mem_zip_inits_tails
-/
+#print List.map_uncurry_zip_eq_zipWith /-
theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : List β) :
map (Function.uncurry f) (l.zip l') = zipWith f l l' :=
by
@@ -453,7 +562,9 @@ theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : Li
· simp
· simp [hl]
#align list.map_uncurry_zip_eq_zip_with List.map_uncurry_zip_eq_zipWith
+-/
+#print List.sum_zipWith_distrib_left /-
@[simp]
theorem sum_zipWith_distrib_left {γ : Type _} [Semiring γ] (f : α → β → γ) (n : γ) (l : List α)
(l' : List β) : (l.zipWith (fun x y => n * f x y) l').Sum = n * (l.zipWith f l').Sum :=
@@ -464,6 +575,7 @@ theorem sum_zipWith_distrib_left {γ : Type _} [Semiring γ] (f : α → β →
· simp
· simp [hl, mul_add]
#align list.sum_zip_with_distrib_left List.sum_zipWith_distrib_left
+-/
section Distrib
@@ -472,6 +584,7 @@ section Distrib
variable (f : α → β → γ) (l : List α) (l' : List β) (n : ℕ)
+#print List.zipWith_distrib_take /-
theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l'.take n) :=
by
induction' l with hd tl hl generalizing l' n
@@ -482,7 +595,9 @@ theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l
· simp
· simp [hl]
#align list.zip_with_distrib_take List.zipWith_distrib_take
+-/
+#print List.zipWith_distrib_drop /-
theorem zipWith_distrib_drop : (zipWith f l l').drop n = zipWith f (l.drop n) (l'.drop n) :=
by
induction' l with hd tl hl generalizing l' n
@@ -493,11 +608,15 @@ theorem zipWith_distrib_drop : (zipWith f l l').drop n = zipWith f (l.drop n) (l
· simp
· simp [hl]
#align list.zip_with_distrib_drop List.zipWith_distrib_drop
+-/
+#print List.zipWith_distrib_tail /-
theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail := by
simp_rw [← drop_one, zip_with_distrib_drop]
#align list.zip_with_distrib_tail List.zipWith_distrib_tail
+-/
+#print List.zipWith_append /-
theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β) (h : l.length = l'.length) :
zipWith f (l ++ la) (l' ++ lb) = zipWith f l l' ++ zipWith f la lb :=
by
@@ -509,7 +628,9 @@ theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
· simp only [add_left_inj, length] at h
simp [hl _ h]
#align list.zip_with_append List.zipWith_append
+-/
+#print List.zipWith_distrib_reverse /-
theorem zipWith_distrib_reverse (h : l.length = l'.length) :
(zipWith f l l').reverse = zipWith f l.reverse l'.reverse :=
by
@@ -521,6 +642,7 @@ theorem zipWith_distrib_reverse (h : l.length = l'.length) :
have : tl.reverse.length = tl'.reverse.length := by simp [h]
simp [hl _ h, zip_with_append _ _ _ _ _ this]
#align list.zip_with_distrib_reverse List.zipWith_distrib_reverse
+-/
end Distrib
@@ -528,6 +650,7 @@ section CommMonoid
variable [CommMonoid α]
+#print List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop /-
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
∀ L L' : List α,
@@ -543,13 +666,16 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
mul_assoc]
#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
#align list.sum_add_sum_eq_sum_zip_with_add_sum_drop List.sum_add_sum_eq_sum_zipWith_add_sum_drop
+-/
+#print List.prod_mul_prod_eq_prod_zipWith_of_length_eq /-
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
L.Prod * L'.Prod = (zipWith (· * ·) L L').Prod :=
(prod_mul_prod_eq_prod_zipWith_mul_prod_drop L L').trans (by simp [h])
#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eq
#align list.sum_add_sum_eq_sum_zip_with_of_length_eq List.sum_add_sum_eq_sum_zipWith_of_length_eq
+-/
end CommMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -100,16 +100,16 @@ theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
- | a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h; simp [all₂_zip_with h]
+ | a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h ; simp [all₂_zip_with h]
#align list.all₂_zip_with List.all₂_zipWith
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h;
+ (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h ;
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h;
+ (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h ;
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
@@ -192,15 +192,15 @@ theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l
theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
- | a :: as, b :: bs, h => by simp at h; simp! [*]
- | a :: as, [], h => by simp at h; contradiction
+ | a :: as, b :: bs, h => by simp at h ; simp! [*]
+ | a :: as, [], h => by simp at h ; contradiction
#align list.map_fst_zip List.map_fst_zip
theorem map_snd_zip :
∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
| _, [], _ => by rw [zip_nil_right]; rfl
- | [], b :: bs, h => by simp at h; contradiction
- | a :: as, b :: bs, h => by simp at h; simp! [*]
+ | [], b :: bs, h => by simp at h ; contradiction
+ | a :: as, b :: bs, h => by simp at h ; simp! [*]
#align list.map_snd_zip List.map_snd_zip
@[simp]
@@ -259,11 +259,11 @@ theorem zip_of_prod {l : List α} {l' : List β} {lp : List (α × β)} (hl : lp
#align list.zip_of_prod List.zip_of_prod
theorem map_prod_left_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (x, f x)) = l.zip (l.map f) := by rw [← zip_map']; congr ; exact map_id _
+ (l.map fun x => (x, f x)) = l.zip (l.map f) := by rw [← zip_map']; congr; exact map_id _
#align list.map_prod_left_eq_zip List.map_prod_left_eq_zip
theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (f x, x)) = (l.map f).zip l := by rw [← zip_map']; congr ; exact map_id _
+ (l.map fun x => (f x, x)) = (l.map f).zip l := by rw [← zip_map']; congr; exact map_id _
#align list.map_prod_right_eq_zip List.map_prod_right_eq_zip
theorem zipWith_comm (f : α → β → γ) :
@@ -506,7 +506,7 @@ theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
simp [this]
· cases l'
· simpa using h
- · simp only [add_left_inj, length] at h
+ · simp only [add_left_inj, length] at h
simp [hl _ h]
#align list.zip_with_append List.zipWith_append
@@ -517,7 +517,7 @@ theorem zipWith_distrib_reverse (h : l.length = l'.length) :
· simp
· cases' l' with hd' tl'
· simp
- · simp only [add_left_inj, length] at h
+ · simp only [add_left_inj, length] at h
have : tl.reverse.length = tl'.reverse.length := by simp [h]
simp [hl _ h, zip_with_append _ _ _ _ _ this]
#align list.zip_with_distrib_reverse List.zipWith_distrib_reverse
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -36,90 +36,42 @@ namespace List
variable {α : Type u} {β γ δ ε : Type _}
-/- warning: list.zip_with_cons_cons -> List.zipWith_cons_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : β) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f (List.cons.{u1} α a l₁) (List.cons.{u2} β b l₂)) (List.cons.{u3} γ (f a b) (List.zipWith.{u1, u2, u3} α β γ f l₁ l₂))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (a : α) (b : β) (l₁ : List.{u3} α) (l₂ : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f (List.cons.{u3} α a l₁) (List.cons.{u2} β b l₂)) (List.cons.{u1} γ (f a b) (List.zipWith.{u3, u2, u1} α β γ f l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_cons_cons List.zipWith_cons_consₓ'. -/
@[simp]
theorem zipWith_cons_cons (f : α → β → γ) (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
zipWith f (a :: l₁) (b :: l₂) = f a b :: zipWith f l₁ l₂ :=
rfl
#align list.zip_with_cons_cons List.zipWith_cons_cons
-/- warning: list.zip_cons_cons -> List.zip_cons_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (a : α) (b : β) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.zip.{u1, u2} α β (List.cons.{u1} α a l₁) (List.cons.{u2} β b l₂)) (List.cons.{max u1 u2} (Prod.{u1, u2} α β) (Prod.mk.{u1, u2} α β a b) (List.zip.{u1, u2} α β l₁ l₂))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (a : α) (b : β) (l₁ : List.{u2} α) (l₂ : List.{u1} β), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.zip.{u2, u1} α β (List.cons.{u2} α a l₁) (List.cons.{u1} β b l₂)) (List.cons.{max u1 u2} (Prod.{u2, u1} α β) (Prod.mk.{u2, u1} α β a b) (List.zip.{u2, u1} α β l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.zip_cons_cons List.zip_cons_consₓ'. -/
@[simp]
theorem zip_cons_cons (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
zip (a :: l₁) (b :: l₂) = (a, b) :: zip l₁ l₂ :=
rfl
#align list.zip_cons_cons List.zip_cons_cons
-/- warning: list.zip_with_nil_left -> List.zipWith_nil_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f (List.nil.{u1} α) l) (List.nil.{u3} γ)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f (List.nil.{u3} α) l) (List.nil.{u1} γ)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_nil_left List.zipWith_nil_leftₓ'. -/
@[simp]
theorem zipWith_nil_left (f : α → β → γ) (l) : zipWith f [] l = [] :=
rfl
#align list.zip_with_nil_left List.zipWith_nil_left
-/- warning: list.zip_with_nil_right -> List.zipWith_nil_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f l (List.nil.{u2} β)) (List.nil.{u3} γ)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (l : List.{u3} α), Eq.{succ u2} (List.{u2} γ) (List.zipWith.{u3, u1, u2} α β γ f l (List.nil.{u1} β)) (List.nil.{u2} γ)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_nil_right List.zipWith_nil_rightₓ'. -/
@[simp]
theorem zipWith_nil_right (f : α → β → γ) (l) : zipWith f l [] = [] := by cases l <;> rfl
#align list.zip_with_nil_right List.zipWith_nil_right
-/- warning: list.zip_with_eq_nil_iff -> List.zipWith_eq_nil_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {l : List.{u1} α} {l' : List.{u2} β}, Iff (Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f l l') (List.nil.{u3} γ)) (Or (Eq.{succ u1} (List.{u1} α) l (List.nil.{u1} α)) (Eq.{succ u2} (List.{u2} β) l' (List.nil.{u2} β)))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {l : List.{u3} α} {l' : List.{u2} β}, Iff (Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f l l') (List.nil.{u1} γ)) (Or (Eq.{succ u3} (List.{u3} α) l (List.nil.{u3} α)) (Eq.{succ u2} (List.{u2} β) l' (List.nil.{u2} β)))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_eq_nil_iff List.zipWith_eq_nil_iffₓ'. -/
@[simp]
theorem zipWith_eq_nil_iff {f : α → β → γ} {l l'} : zipWith f l l' = [] ↔ l = [] ∨ l' = [] := by
cases l <;> cases l' <;> simp
#align list.zip_with_eq_nil_iff List.zipWith_eq_nil_iff
-/- warning: list.zip_nil_left -> List.zip_nil_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{u1} α), Eq.{succ (max u2 u1)} (List.{max u2 u1} (Prod.{u2, u1} β α)) (List.zip.{u2, u1} β α (List.nil.{u2} β) l) (List.nil.{max u2 u1} (Prod.{u2, u1} β α))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{u2} α), Eq.{max (succ u2) (succ u1)} (List.{max u2 u1} (Prod.{u1, u2} β α)) (List.zip.{u1, u2} β α (List.nil.{u1} β) l) (List.nil.{max u2 u1} (Prod.{u1, u2} β α))
-Case conversion may be inaccurate. Consider using '#align list.zip_nil_left List.zip_nil_leftₓ'. -/
@[simp]
theorem zip_nil_left (l : List α) : zip ([] : List β) l = [] :=
rfl
#align list.zip_nil_left List.zip_nil_left
-/- warning: list.zip_nil_right -> List.zip_nil_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{u1} α), Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.zip.{u1, u2} α β l (List.nil.{u2} β)) (List.nil.{max u1 u2} (Prod.{u1, u2} α β))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{u2} α), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.zip.{u2, u1} α β l (List.nil.{u1} β)) (List.nil.{max u2 u1} (Prod.{u2, u1} α β))
-Case conversion may be inaccurate. Consider using '#align list.zip_nil_right List.zip_nil_rightₓ'. -/
@[simp]
theorem zip_nil_right (l : List α) : zip l ([] : List β) = [] :=
zipWith_nil_right _ l
#align list.zip_nil_right List.zip_nil_right
-/- warning: list.zip_swap -> List.zip_swap is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ (max u2 u1)} (List.{max u2 u1} (Prod.{u2, u1} β α)) (List.map.{max u1 u2, max u2 u1} (Prod.{u1, u2} α β) (Prod.{u2, u1} β α) (Prod.swap.{u1, u2} α β) (List.zip.{u1, u2} α β l₁ l₂)) (List.zip.{u2, u1} β α l₂ l₁)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l₁ : List.{u2} α) (l₂ : List.{u1} β), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u1, u2} β α)) (List.map.{max u1 u2, max u1 u2} (Prod.{u2, u1} α β) (Prod.{u1, u2} β α) (Prod.swap.{u2, u1} α β) (List.zip.{u2, u1} α β l₁ l₂)) (List.zip.{u1, u2} β α l₂ l₁)
-Case conversion may be inaccurate. Consider using '#align list.zip_swap List.zip_swapₓ'. -/
@[simp]
theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Prod.swap = zip l₂ l₁
| [], l₂ => (zip_nil_right _).symm
@@ -129,11 +81,6 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
#align list.zip_swap List.zip_swap
/- warning: list.length_zip_with clashes with list.length_map₂ -> List.length_zipWith
-warning: list.length_zip_with -> List.length_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{1} Nat (List.length.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l₁ l₂)) (LinearOrder.min.{0} Nat Nat.linearOrder (List.length.{u1} α l₁) (List.length.{u2} β l₂))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l₁ : List.{u3} α) (l₂ : List.{u2} β), Eq.{1} Nat (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l₁ l₂)) (Min.min.{0} Nat instMinNat (List.length.{u3} α l₁) (List.length.{u2} β l₂))
Case conversion may be inaccurate. Consider using '#align list.length_zip_with List.length_zipWithₓ'. -/
@[simp]
theorem length_zipWith (f : α → β → γ) :
@@ -143,24 +90,12 @@ theorem length_zipWith (f : α → β → γ) :
| a :: l₁, b :: l₂ => by simp [length, zip_cons_cons, length_zip_with l₁ l₂, min_add_add_right]
#align list.length_zip_with List.length_zipWith
-/- warning: list.length_zip -> List.length_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{1} Nat (List.length.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l₁ l₂)) (LinearOrder.min.{0} Nat Nat.linearOrder (List.length.{u1} α l₁) (List.length.{u2} β l₂))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l₁ : List.{u2} α) (l₂ : List.{u1} β), Eq.{1} Nat (List.length.{max u1 u2} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l₁ l₂)) (Min.min.{0} Nat instMinNat (List.length.{u2} α l₁) (List.length.{u1} β l₂))
-Case conversion may be inaccurate. Consider using '#align list.length_zip List.length_zipₓ'. -/
@[simp]
theorem length_zip :
∀ (l₁ : List α) (l₂ : List β), length (zip l₁ l₂) = min (length l₁) (length l₂) :=
length_zipWith _
#align list.length_zip List.length_zip
-/- warning: list.all₂_zip_with -> List.all₂_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {p : γ -> Prop} {l₁ : List.{u1} α} {l₂ : List.{u2} β}, (Eq.{1} Nat (List.length.{u1} α l₁) (List.length.{u2} β l₂)) -> (Iff (List.All₂.{u3} γ p (List.zipWith.{u1, u2, u3} α β γ f l₁ l₂)) (List.Forall₂.{u1, u2} α β (fun (x : α) (y : β) => p (f x y)) l₁ l₂))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {p : γ -> Prop} {l₁ : List.{u3} α} {l₂ : List.{u2} β}, (Eq.{1} Nat (List.length.{u3} α l₁) (List.length.{u2} β l₂)) -> (Iff (List.All₂.{u1} γ p (List.zipWith.{u3, u2, u1} α β γ f l₁ l₂)) (List.Forall₂.{u3, u2} α β (fun (x : α) (y : β) => p (f x y)) l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.all₂_zip_with List.all₂_zipWithₓ'. -/
theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
@@ -168,56 +103,26 @@ theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
| a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h; simp [all₂_zip_with h]
#align list.all₂_zip_with List.all₂_zipWith
-/- warning: list.lt_length_left_of_zip_with -> List.lt_length_left_of_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {i : Nat} {l : List.{u1} α} {l' : List.{u2} β}, (LT.lt.{0} Nat Nat.hasLt i (List.length.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l'))) -> (LT.lt.{0} Nat Nat.hasLt i (List.length.{u1} α l))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {i : Nat} {l : List.{u3} α} {l' : List.{u2} β}, (LT.lt.{0} Nat instLTNat i (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u3} α l))
-Case conversion may be inaccurate. Consider using '#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWithₓ'. -/
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
(h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
-/- warning: list.lt_length_right_of_zip_with -> List.lt_length_right_of_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {i : Nat} {l : List.{u1} α} {l' : List.{u2} β}, (LT.lt.{0} Nat Nat.hasLt i (List.length.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l'))) -> (LT.lt.{0} Nat Nat.hasLt i (List.length.{u2} β l'))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {i : Nat} {l : List.{u3} α} {l' : List.{u2} β}, (LT.lt.{0} Nat instLTNat i (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u2} β l'))
-Case conversion may be inaccurate. Consider using '#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWithₓ'. -/
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
(h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
-/- warning: list.lt_length_left_of_zip -> List.lt_length_left_of_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {i : Nat} {l : List.{u1} α} {l' : List.{u2} β}, (LT.lt.{0} Nat Nat.hasLt i (List.length.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l l'))) -> (LT.lt.{0} Nat Nat.hasLt i (List.length.{u1} α l))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {i : Nat} {l : List.{u2} α} {l' : List.{u1} β}, (LT.lt.{0} Nat instLTNat i (List.length.{max u2 u1} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u2} α l))
-Case conversion may be inaccurate. Consider using '#align list.lt_length_left_of_zip List.lt_length_left_of_zipₓ'. -/
theorem lt_length_left_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (zip l l').length) :
i < l.length :=
lt_length_left_of_zipWith h
#align list.lt_length_left_of_zip List.lt_length_left_of_zip
-/- warning: list.lt_length_right_of_zip -> List.lt_length_right_of_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {i : Nat} {l : List.{u1} α} {l' : List.{u2} β}, (LT.lt.{0} Nat Nat.hasLt i (List.length.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l l'))) -> (LT.lt.{0} Nat Nat.hasLt i (List.length.{u2} β l'))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {i : Nat} {l : List.{u2} α} {l' : List.{u1} β}, (LT.lt.{0} Nat instLTNat i (List.length.{max u2 u1} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u1} β l'))
-Case conversion may be inaccurate. Consider using '#align list.lt_length_right_of_zip List.lt_length_right_of_zipₓ'. -/
theorem lt_length_right_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (zip l l').length) :
i < l'.length :=
lt_length_right_of_zipWith h
#align list.lt_length_right_of_zip List.lt_length_right_of_zip
-/- warning: list.zip_append -> List.zip_append is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l₁ : List.{u1} α} {r₁ : List.{u1} α} {l₂ : List.{u2} β} {r₂ : List.{u2} β}, (Eq.{1} Nat (List.length.{u1} α l₁) (List.length.{u2} β l₂)) -> (Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.zip.{u1, u2} α β (Append.append.{u1} (List.{u1} α) (List.hasAppend.{u1} α) l₁ r₁) (Append.append.{u2} (List.{u2} β) (List.hasAppend.{u2} β) l₂ r₂)) (Append.append.{max u1 u2} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.hasAppend.{max u1 u2} (Prod.{u1, u2} α β)) (List.zip.{u1, u2} α β l₁ l₂) (List.zip.{u1, u2} α β r₁ r₂)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l₁ : List.{u2} α} {r₁ : List.{u2} α} {l₂ : List.{u1} β} {r₂ : List.{u1} β}, (Eq.{1} Nat (List.length.{u2} α l₁) (List.length.{u1} β l₂)) -> (Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.zip.{u2, u1} α β (HAppend.hAppend.{u2, u2, u2} (List.{u2} α) (List.{u2} α) (List.{u2} α) (instHAppend.{u2} (List.{u2} α) (List.instAppendList.{u2} α)) l₁ r₁) (HAppend.hAppend.{u1, u1, u1} (List.{u1} β) (List.{u1} β) (List.{u1} β) (instHAppend.{u1} (List.{u1} β) (List.instAppendList.{u1} β)) l₂ r₂)) (HAppend.hAppend.{max u2 u1, max u2 u1, max u2 u1} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.{max u1 u2} (Prod.{u2, u1} α β)) (instHAppend.{max u2 u1} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.instAppendList.{max u2 u1} (Prod.{u2, u1} α β))) (List.zip.{u2, u1} α β l₁ l₂) (List.zip.{u2, u1} α β r₁ r₂)))
-Case conversion may be inaccurate. Consider using '#align list.zip_append List.zip_appendₓ'. -/
theorem zip_append :
∀ {l₁ r₁ : List α} {l₂ r₂ : List β} (h : length l₁ = length l₂),
zip (l₁ ++ r₁) (l₂ ++ r₂) = zip l₁ l₂ ++ zip r₁ r₂
@@ -227,12 +132,6 @@ theorem zip_append :
simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)] <;> constructor <;> rfl
#align list.zip_append List.zip_append
-/- warning: list.zip_map -> List.zip_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} (f : α -> γ) (g : β -> δ) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ (max u3 u4)} (List.{max u3 u4} (Prod.{u3, u4} γ δ)) (List.zip.{u3, u4} γ δ (List.map.{u1, u3} α γ f l₁) (List.map.{u2, u4} β δ g l₂)) (List.map.{max u1 u2, max u3 u4} (Prod.{u1, u2} α β) (Prod.{u3, u4} γ δ) (Prod.map.{u1, u3, u2, u4} α γ β δ f g) (List.zip.{u1, u2} α β l₁ l₂))
-but is expected to have type
- forall {α : Type.{u4}} {β : Type.{u3}} {γ : Type.{u2}} {δ : Type.{u1}} (f : α -> γ) (g : β -> δ) (l₁ : List.{u4} α) (l₂ : List.{u3} β), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} γ δ)) (List.zip.{u2, u1} γ δ (List.map.{u4, u2} α γ f l₁) (List.map.{u3, u1} β δ g l₂)) (List.map.{max u3 u4, max u1 u2} (Prod.{u4, u3} α β) (Prod.{u2, u1} γ δ) (Prod.map.{u4, u2, u3, u1} α γ β δ f g) (List.zip.{u4, u3} α β l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.zip_map List.zip_mapₓ'. -/
theorem zip_map (f : α → γ) (g : β → δ) :
∀ (l₁ : List α) (l₂ : List β), zip (l₁.map f) (l₂.map g) = (zip l₁ l₂).map (Prod.map f g)
| [], l₂ => rfl
@@ -241,32 +140,14 @@ theorem zip_map (f : α → γ) (g : β → δ) :
simp only [map, zip_cons_cons, zip_map l₁ l₂, Prod.map] <;> constructor <;> rfl
#align list.zip_map List.zip_map
-/- warning: list.zip_map_left -> List.zip_map_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> γ) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ (max u3 u2)} (List.{max u3 u2} (Prod.{u3, u2} γ β)) (List.zip.{u3, u2} γ β (List.map.{u1, u3} α γ f l₁) l₂) (List.map.{max u1 u2, max u3 u2} (Prod.{u1, u2} α β) (Prod.{u3, u2} γ β) (Prod.map.{u1, u3, u2, u2} α γ β β f (id.{succ u2} β)) (List.zip.{u1, u2} α β l₁ l₂))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> γ) (l₁ : List.{u3} α) (l₂ : List.{u2} β), Eq.{max (succ u2) (succ u1)} (List.{max u2 u1} (Prod.{u1, u2} γ β)) (List.zip.{u1, u2} γ β (List.map.{u3, u1} α γ f l₁) l₂) (List.map.{max u2 u3, max u2 u1} (Prod.{u3, u2} α β) (Prod.{u1, u2} γ β) (Prod.map.{u3, u1, u2, u2} α γ β β f (id.{succ u2} β)) (List.zip.{u3, u2} α β l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.zip_map_left List.zip_map_leftₓ'. -/
theorem zip_map_left (f : α → γ) (l₁ : List α) (l₂ : List β) :
zip (l₁.map f) l₂ = (zip l₁ l₂).map (Prod.map f id) := by rw [← zip_map, map_id]
#align list.zip_map_left List.zip_map_left
-/- warning: list.zip_map_right -> List.zip_map_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : β -> γ) (l₁ : List.{u1} α) (l₂ : List.{u2} β), Eq.{succ (max u1 u3)} (List.{max u1 u3} (Prod.{u1, u3} α γ)) (List.zip.{u1, u3} α γ l₁ (List.map.{u2, u3} β γ f l₂)) (List.map.{max u1 u2, max u1 u3} (Prod.{u1, u2} α β) (Prod.{u1, u3} α γ) (Prod.map.{u1, u1, u2, u3} α α β γ (id.{succ u1} α) f) (List.zip.{u1, u2} α β l₁ l₂))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : β -> γ) (l₁ : List.{u3} α) (l₂ : List.{u2} β), Eq.{max (succ u3) (succ u1)} (List.{max u1 u3} (Prod.{u3, u1} α γ)) (List.zip.{u3, u1} α γ l₁ (List.map.{u2, u1} β γ f l₂)) (List.map.{max u2 u3, max u1 u3} (Prod.{u3, u2} α β) (Prod.{u3, u1} α γ) (Prod.map.{u3, u3, u2, u1} α α β γ (id.{succ u3} α) f) (List.zip.{u3, u2} α β l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.zip_map_right List.zip_map_rightₓ'. -/
theorem zip_map_right (f : β → γ) (l₁ : List α) (l₂ : List β) :
zip l₁ (l₂.map f) = (zip l₁ l₂).map (Prod.map id f) := by rw [← zip_map, map_id]
#align list.zip_map_right List.zip_map_right
-/- warning: list.zip_with_map -> List.zipWith_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {μ : Type.{u5}} (f : γ -> δ -> μ) (g : α -> γ) (h : β -> δ) (as : List.{u1} α) (bs : List.{u2} β), Eq.{succ u5} (List.{u5} μ) (List.zipWith.{u3, u4, u5} γ δ μ f (List.map.{u1, u3} α γ g as) (List.map.{u2, u4} β δ h bs)) (List.zipWith.{u1, u2, u5} α β μ (fun (a : α) (b : β) => f (g a) (h b)) as bs)
-but is expected to have type
- forall {α : Type.{u5}} {β : Type.{u3}} {γ : Type.{u2}} {δ : Type.{u1}} {μ : Type.{u4}} (f : γ -> δ -> μ) (g : α -> γ) (h : β -> δ) (as : List.{u5} α) (bs : List.{u3} β), Eq.{succ u4} (List.{u4} μ) (List.zipWith.{u2, u1, u4} γ δ μ f (List.map.{u5, u2} α γ g as) (List.map.{u3, u1} β δ h bs)) (List.zipWith.{u5, u3, u4} α β μ (fun (a : α) (b : β) => f (g a) (h b)) as bs)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_map List.zipWith_mapₓ'. -/
@[simp]
theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ) (as : List α) (bs : List β) :
zipWith f (as.map g) (bs.map h) = zipWith (fun a b => f (g a) (h b)) as bs :=
@@ -276,46 +157,22 @@ theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ)
· cases bs <;> simp [*]
#align list.zip_with_map List.zipWith_map
-/- warning: list.zip_with_map_left -> List.zipWith_map_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} (f : α -> β -> γ) (g : δ -> α) (l : List.{u4} δ) (l' : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f (List.map.{u4, u1} δ α g l) l') (List.zipWith.{u4, u2, u3} δ β γ (Function.comp.{succ u4, succ u1, max (succ u2) (succ u3)} δ α (β -> γ) f g) l l')
-but is expected to have type
- forall {α : Type.{u4}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Type.{u3}} (f : α -> β -> γ) (g : δ -> α) (l : List.{u3} δ) (l' : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u4, u2, u1} α β γ f (List.map.{u3, u4} δ α g l) l') (List.zipWith.{u3, u2, u1} δ β γ (Function.comp.{succ u3, succ u4, max (succ u1) (succ u2)} δ α (β -> γ) f g) l l')
-Case conversion may be inaccurate. Consider using '#align list.zip_with_map_left List.zipWith_map_leftₓ'. -/
theorem zipWith_map_left (f : α → β → γ) (g : δ → α) (l : List δ) (l' : List β) :
zipWith f (l.map g) l' = zipWith (f ∘ g) l l' := by convert zip_with_map f g id l l';
exact Eq.symm (List.map_id _)
#align list.zip_with_map_left List.zipWith_map_left
-/- warning: list.zip_with_map_right -> List.zipWith_map_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} (f : α -> β -> γ) (l : List.{u1} α) (g : δ -> β) (l' : List.{u4} δ), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f l (List.map.{u4, u2} δ β g l')) (List.zipWith.{u1, u4, u3} α δ γ (fun (x : α) => Function.comp.{succ u4, succ u2, succ u3} δ β γ (f x) g) l l')
-but is expected to have type
- forall {α : Type.{u4}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Type.{u3}} (f : α -> β -> γ) (l : List.{u4} α) (g : δ -> β) (l' : List.{u3} δ), Eq.{succ u2} (List.{u2} γ) (List.zipWith.{u4, u1, u2} α β γ f l (List.map.{u3, u1} δ β g l')) (List.zipWith.{u4, u3, u2} α δ γ (fun (x : α) => Function.comp.{succ u3, succ u1, succ u2} δ β γ (f x) g) l l')
-Case conversion may be inaccurate. Consider using '#align list.zip_with_map_right List.zipWith_map_rightₓ'. -/
theorem zipWith_map_right (f : α → β → γ) (l : List α) (g : δ → β) (l' : List δ) :
zipWith f l (l'.map g) = zipWith (fun x => f x ∘ g) l l' := by
convert List.zipWith_map f id g l l'; exact Eq.symm (List.map_id _)
#align list.zip_with_map_right List.zipWith_map_right
-/- warning: list.zip_map' -> List.zip_map' is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β) (g : α -> γ) (l : List.{u1} α), Eq.{succ (max u2 u3)} (List.{max u2 u3} (Prod.{u2, u3} β γ)) (List.zip.{u2, u3} β γ (List.map.{u1, u2} α β f l) (List.map.{u1, u3} α γ g l)) (List.map.{u1, max u2 u3} α (Prod.{u2, u3} β γ) (fun (a : α) => Prod.mk.{u2, u3} β γ (f a) (g a)) l)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β) (g : α -> γ) (l : List.{u3} α), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} β γ)) (List.zip.{u2, u1} β γ (List.map.{u3, u2} α β f l) (List.map.{u3, u1} α γ g l)) (List.map.{u3, max u1 u2} α (Prod.{u2, u1} β γ) (fun (a : α) => Prod.mk.{u2, u1} β γ (f a) (g a)) l)
-Case conversion may be inaccurate. Consider using '#align list.zip_map' List.zip_map'ₓ'. -/
theorem zip_map' (f : α → β) (g : α → γ) :
∀ l : List α, zip (l.map f) (l.map g) = l.map fun a => (f a, g a)
| [] => rfl
| a :: l => by simp only [map, zip_cons_cons, zip_map' l] <;> constructor <;> rfl
#align list.zip_map' List.zip_map'
-/- warning: list.map_zip_with -> List.map_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} (f : α -> β) (g : γ -> δ -> α) (l : List.{u3} γ) (l' : List.{u4} δ), Eq.{succ u2} (List.{u2} β) (List.map.{u1, u2} α β f (List.zipWith.{u3, u4, u1} γ δ α g l l')) (List.zipWith.{u3, u4, u2} γ δ β (fun (x : γ) (y : δ) => f (g x y)) l l')
-but is expected to have type
- forall {α : Type.{u4}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Type.{u3}} (f : α -> β) (g : γ -> δ -> α) (l : List.{u2} γ) (l' : List.{u3} δ), Eq.{succ u1} (List.{u1} β) (List.map.{u4, u1} α β f (List.zipWith.{u2, u3, u4} γ δ α g l l')) (List.zipWith.{u2, u3, u1} γ δ β (fun (x : γ) (y : δ) => f (g x y)) l l')
-Case conversion may be inaccurate. Consider using '#align list.map_zip_with List.map_zipWithₓ'. -/
theorem map_zipWith {δ : Type _} (f : α → β) (g : γ → δ → α) (l : List γ) (l' : List δ) :
map f (zipWith g l l') = zipWith (fun x y => f (g x y)) l l' :=
by
@@ -326,24 +183,12 @@ theorem map_zipWith {δ : Type _} (f : α → β) (g : γ → δ → α) (l : Li
· simp [hl]
#align list.map_zip_with List.map_zipWith
-/- warning: list.mem_zip -> List.mem_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {a : α} {b : β} {l₁ : List.{u1} α} {l₂ : List.{u2} β}, (Membership.Mem.{max u1 u2, max u1 u2} (Prod.{u1, u2} α β) (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.hasMem.{max u1 u2} (Prod.{u1, u2} α β)) (Prod.mk.{u1, u2} α β a b) (List.zip.{u1, u2} α β l₁ l₂)) -> (And (Membership.Mem.{u1, u1} α (List.{u1} α) (List.hasMem.{u1} α) a l₁) (Membership.Mem.{u2, u2} β (List.{u2} β) (List.hasMem.{u2} β) b l₂))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {a : α} {b : β} {l₁ : List.{u2} α} {l₂ : List.{u1} β}, (Membership.mem.{max u1 u2, max u1 u2} (Prod.{u2, u1} α β) (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.instMembershipList.{max u1 u2} (Prod.{u2, u1} α β)) (Prod.mk.{u2, u1} α β a b) (List.zip.{u2, u1} α β l₁ l₂)) -> (And (Membership.mem.{u2, u2} α (List.{u2} α) (List.instMembershipList.{u2} α) a l₁) (Membership.mem.{u1, u1} β (List.{u1} β) (List.instMembershipList.{u1} β) b l₂))
-Case conversion may be inaccurate. Consider using '#align list.mem_zip List.mem_zipₓ'. -/
theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l₁ l₂ → a ∈ l₁ ∧ b ∈ l₂
| _ :: l₁, _ :: l₂, Or.inl rfl => ⟨Or.inl rfl, Or.inl rfl⟩
| a' :: l₁, b' :: l₂, Or.inr h => by
constructor <;> simp only [mem_cons_iff, or_true_iff, mem_zip h]
#align list.mem_zip List.mem_zip
-/- warning: list.map_fst_zip -> List.map_fst_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l₁ : List.{u1} α) (l₂ : List.{u2} β), (LE.le.{0} Nat Nat.hasLe (List.length.{u1} α l₁) (List.length.{u2} β l₂)) -> (Eq.{succ u1} (List.{u1} α) (List.map.{max u1 u2, u1} (Prod.{u1, u2} α β) α (Prod.fst.{u1, u2} α β) (List.zip.{u1, u2} α β l₁ l₂)) l₁)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l₁ : List.{u2} α) (l₂ : List.{u1} β), (LE.le.{0} Nat instLENat (List.length.{u2} α l₁) (List.length.{u1} β l₂)) -> (Eq.{succ u2} (List.{u2} α) (List.map.{max u1 u2, u2} (Prod.{u2, u1} α β) α (Prod.fst.{u2, u1} α β) (List.zip.{u2, u1} α β l₁ l₂)) l₁)
-Case conversion may be inaccurate. Consider using '#align list.map_fst_zip List.map_fst_zipₓ'. -/
theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
@@ -351,12 +196,6 @@ theorem map_fst_zip :
| a :: as, [], h => by simp at h; contradiction
#align list.map_fst_zip List.map_fst_zip
-/- warning: list.map_snd_zip -> List.map_snd_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l₁ : List.{u1} α) (l₂ : List.{u2} β), (LE.le.{0} Nat Nat.hasLe (List.length.{u2} β l₂) (List.length.{u1} α l₁)) -> (Eq.{succ u2} (List.{u2} β) (List.map.{max u1 u2, u2} (Prod.{u1, u2} α β) β (Prod.snd.{u1, u2} α β) (List.zip.{u1, u2} α β l₁ l₂)) l₂)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l₁ : List.{u2} α) (l₂ : List.{u1} β), (LE.le.{0} Nat instLENat (List.length.{u1} β l₂) (List.length.{u2} α l₁)) -> (Eq.{succ u1} (List.{u1} β) (List.map.{max u1 u2, u1} (Prod.{u2, u1} α β) β (Prod.snd.{u2, u1} α β) (List.zip.{u2, u1} α β l₁ l₂)) l₂)
-Case conversion may be inaccurate. Consider using '#align list.map_snd_zip List.map_snd_zipₓ'. -/
theorem map_snd_zip :
∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
| _, [], _ => by rw [zip_nil_right]; rfl
@@ -364,85 +203,37 @@ theorem map_snd_zip :
| a :: as, b :: bs, h => by simp at h; simp! [*]
#align list.map_snd_zip List.map_snd_zip
-/- warning: list.unzip_nil -> List.unzip_nil is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}}, Eq.{max (succ u1) (succ u2)} (Prod.{u1, u2} (List.{u1} α) (List.{u2} β)) (List.unzip.{u1, u2} α β (List.nil.{max u1 u2} (Prod.{u1, u2} α β))) (Prod.mk.{u1, u2} (List.{u1} α) (List.{u2} β) (List.nil.{u1} α) (List.nil.{u2} β))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}}, Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} (List.{u2} α) (List.{u1} β)) (List.unzip.{u2, u1} α β (List.nil.{max u1 u2} (Prod.{u2, u1} α β))) (Prod.mk.{u2, u1} (List.{u2} α) (List.{u1} β) (List.nil.{u2} α) (List.nil.{u1} β))
-Case conversion may be inaccurate. Consider using '#align list.unzip_nil List.unzip_nilₓ'. -/
@[simp]
theorem unzip_nil : unzip (@nil (α × β)) = ([], []) :=
rfl
#align list.unzip_nil List.unzip_nil
-/- warning: list.unzip_cons -> List.unzip_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (a : α) (b : β) (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{max (succ u1) (succ u2)} (Prod.{u1, u2} (List.{u1} α) (List.{u2} β)) (List.unzip.{u1, u2} α β (List.cons.{max u1 u2} (Prod.{u1, u2} α β) (Prod.mk.{u1, u2} α β a b) l)) (Prod.mk.{u1, u2} (List.{u1} α) (List.{u2} β) (List.cons.{u1} α a (Prod.fst.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l))) (List.cons.{u2} β b (Prod.snd.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (a : α) (b : β) (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} (List.{u2} α) (List.{u1} β)) (List.unzip.{u2, u1} α β (List.cons.{max u1 u2} (Prod.{u2, u1} α β) (Prod.mk.{u2, u1} α β a b) l)) (Prod.mk.{u2, u1} (List.{u2} α) (List.{u1} β) (List.cons.{u2} α a (Prod.fst.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l))) (List.cons.{u1} β b (Prod.snd.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l))))
-Case conversion may be inaccurate. Consider using '#align list.unzip_cons List.unzip_consₓ'. -/
@[simp]
theorem unzip_cons (a : α) (b : β) (l : List (α × β)) :
unzip ((a, b) :: l) = (a :: (unzip l).1, b :: (unzip l).2) := by
rw [unzip] <;> cases unzip l <;> rfl
#align list.unzip_cons List.unzip_cons
-/- warning: list.unzip_eq_map -> List.unzip_eq_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{max (succ u1) (succ u2)} (Prod.{u1, u2} (List.{u1} α) (List.{u2} β)) (List.unzip.{u1, u2} α β l) (Prod.mk.{u1, u2} (List.{u1} α) (List.{u2} β) (List.map.{max u1 u2, u1} (Prod.{u1, u2} α β) α (Prod.fst.{u1, u2} α β) l) (List.map.{max u1 u2, u2} (Prod.{u1, u2} α β) β (Prod.snd.{u1, u2} α β) l))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} (List.{u2} α) (List.{u1} β)) (List.unzip.{u2, u1} α β l) (Prod.mk.{u2, u1} (List.{u2} α) (List.{u1} β) (List.map.{max u1 u2, u2} (Prod.{u2, u1} α β) α (Prod.fst.{u2, u1} α β) l) (List.map.{max u1 u2, u1} (Prod.{u2, u1} α β) β (Prod.snd.{u2, u1} α β) l))
-Case conversion may be inaccurate. Consider using '#align list.unzip_eq_map List.unzip_eq_mapₓ'. -/
theorem unzip_eq_map : ∀ l : List (α × β), unzip l = (l.map Prod.fst, l.map Prod.snd)
| [] => rfl
| (a, b) :: l => by simp only [unzip_cons, map_cons, unzip_eq_map l]
#align list.unzip_eq_map List.unzip_eq_map
-/- warning: list.unzip_left -> List.unzip_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{succ u1} (List.{u1} α) (Prod.fst.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l)) (List.map.{max u1 u2, u1} (Prod.{u1, u2} α β) α (Prod.fst.{u1, u2} α β) l)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{succ u2} (List.{u2} α) (Prod.fst.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l)) (List.map.{max u1 u2, u2} (Prod.{u2, u1} α β) α (Prod.fst.{u2, u1} α β) l)
-Case conversion may be inaccurate. Consider using '#align list.unzip_left List.unzip_leftₓ'. -/
theorem unzip_left (l : List (α × β)) : (unzip l).1 = l.map Prod.fst := by simp only [unzip_eq_map]
#align list.unzip_left List.unzip_left
-/- warning: list.unzip_right -> List.unzip_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{succ u2} (List.{u2} β) (Prod.snd.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l)) (List.map.{max u1 u2, u2} (Prod.{u1, u2} α β) β (Prod.snd.{u1, u2} α β) l)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{succ u1} (List.{u1} β) (Prod.snd.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l)) (List.map.{max u1 u2, u1} (Prod.{u2, u1} α β) β (Prod.snd.{u2, u1} α β) l)
-Case conversion may be inaccurate. Consider using '#align list.unzip_right List.unzip_rightₓ'. -/
theorem unzip_right (l : List (α × β)) : (unzip l).2 = l.map Prod.snd := by simp only [unzip_eq_map]
#align list.unzip_right List.unzip_right
-/- warning: list.unzip_swap -> List.unzip_swap is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} (List.{u2} β) (List.{u1} α)) (List.unzip.{u2, u1} β α (List.map.{max u1 u2, max u2 u1} (Prod.{u1, u2} α β) (Prod.{u2, u1} β α) (Prod.swap.{u1, u2} α β) l)) (Prod.swap.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{max (succ u2) (succ u1)} (Prod.{u1, u2} (List.{u1} β) (List.{u2} α)) (List.unzip.{u1, u2} β α (List.map.{max u1 u2, max u2 u1} (Prod.{u2, u1} α β) (Prod.{u1, u2} β α) (Prod.swap.{u2, u1} α β) l)) (Prod.swap.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l))
-Case conversion may be inaccurate. Consider using '#align list.unzip_swap List.unzip_swapₓ'. -/
theorem unzip_swap (l : List (α × β)) : unzip (l.map Prod.swap) = (unzip l).symm := by
simp only [unzip_eq_map, map_map] <;> constructor <;> rfl
#align list.unzip_swap List.unzip_swap
-/- warning: list.zip_unzip -> List.zip_unzip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l : List.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.zip.{u1, u2} α β (Prod.fst.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l)) (Prod.snd.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β l))) l
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l : List.{max u1 u2} (Prod.{u2, u1} α β)), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.zip.{u2, u1} α β (Prod.fst.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l)) (Prod.snd.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β l))) l
-Case conversion may be inaccurate. Consider using '#align list.zip_unzip List.zip_unzipₓ'. -/
theorem zip_unzip : ∀ l : List (α × β), zip (unzip l).1 (unzip l).2 = l
| [] => rfl
| (a, b) :: l => by simp only [unzip_cons, zip_cons_cons, zip_unzip l] <;> constructor <;> rfl
#align list.zip_unzip List.zip_unzip
-/- warning: list.unzip_zip_left -> List.unzip_zip_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l₁ : List.{u1} α} {l₂ : List.{u2} β}, (LE.le.{0} Nat Nat.hasLe (List.length.{u1} α l₁) (List.length.{u2} β l₂)) -> (Eq.{succ u1} (List.{u1} α) (Prod.fst.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β (List.zip.{u1, u2} α β l₁ l₂))) l₁)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l₁ : List.{u2} α} {l₂ : List.{u1} β}, (LE.le.{0} Nat instLENat (List.length.{u2} α l₁) (List.length.{u1} β l₂)) -> (Eq.{succ u2} (List.{u2} α) (Prod.fst.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β (List.zip.{u2, u1} α β l₁ l₂))) l₁)
-Case conversion may be inaccurate. Consider using '#align list.unzip_zip_left List.unzip_zip_leftₓ'. -/
theorem unzip_zip_left :
∀ {l₁ : List α} {l₂ : List β}, length l₁ ≤ length l₂ → (unzip (zip l₁ l₂)).1 = l₁
| [], l₂, h => rfl
@@ -452,65 +243,29 @@ theorem unzip_zip_left :
rfl
#align list.unzip_zip_left List.unzip_zip_left
-/- warning: list.unzip_zip_right -> List.unzip_zip_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l₁ : List.{u1} α} {l₂ : List.{u2} β}, (LE.le.{0} Nat Nat.hasLe (List.length.{u2} β l₂) (List.length.{u1} α l₁)) -> (Eq.{succ u2} (List.{u2} β) (Prod.snd.{u1, u2} (List.{u1} α) (List.{u2} β) (List.unzip.{u1, u2} α β (List.zip.{u1, u2} α β l₁ l₂))) l₂)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l₁ : List.{u2} α} {l₂ : List.{u1} β}, (LE.le.{0} Nat instLENat (List.length.{u1} β l₂) (List.length.{u2} α l₁)) -> (Eq.{succ u1} (List.{u1} β) (Prod.snd.{u2, u1} (List.{u2} α) (List.{u1} β) (List.unzip.{u2, u1} α β (List.zip.{u2, u1} α β l₁ l₂))) l₂)
-Case conversion may be inaccurate. Consider using '#align list.unzip_zip_right List.unzip_zip_rightₓ'. -/
theorem unzip_zip_right {l₁ : List α} {l₂ : List β} (h : length l₂ ≤ length l₁) :
(unzip (zip l₁ l₂)).2 = l₂ := by rw [← zip_swap, unzip_swap] <;> exact unzip_zip_left h
#align list.unzip_zip_right List.unzip_zip_right
-/- warning: list.unzip_zip -> List.unzip_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l₁ : List.{u1} α} {l₂ : List.{u2} β}, (Eq.{1} Nat (List.length.{u1} α l₁) (List.length.{u2} β l₂)) -> (Eq.{max (succ u1) (succ u2)} (Prod.{u1, u2} (List.{u1} α) (List.{u2} β)) (List.unzip.{u1, u2} α β (List.zip.{u1, u2} α β l₁ l₂)) (Prod.mk.{u1, u2} (List.{u1} α) (List.{u2} β) l₁ l₂))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l₁ : List.{u2} α} {l₂ : List.{u1} β}, (Eq.{1} Nat (List.length.{u2} α l₁) (List.length.{u1} β l₂)) -> (Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} (List.{u2} α) (List.{u1} β)) (List.unzip.{u2, u1} α β (List.zip.{u2, u1} α β l₁ l₂)) (Prod.mk.{u2, u1} (List.{u2} α) (List.{u1} β) l₁ l₂))
-Case conversion may be inaccurate. Consider using '#align list.unzip_zip List.unzip_zipₓ'. -/
theorem unzip_zip {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂) :
unzip (zip l₁ l₂) = (l₁, l₂) := by
rw [← @Prod.mk.eta _ _ (unzip (zip l₁ l₂)), unzip_zip_left (le_of_eq h),
unzip_zip_right (ge_of_eq h)]
#align list.unzip_zip List.unzip_zip
-/- warning: list.zip_of_prod -> List.zip_of_prod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l : List.{u1} α} {l' : List.{u2} β} {lp : List.{max u1 u2} (Prod.{u1, u2} α β)}, (Eq.{succ u1} (List.{u1} α) (List.map.{max u1 u2, u1} (Prod.{u1, u2} α β) α (Prod.fst.{u1, u2} α β) lp) l) -> (Eq.{succ u2} (List.{u2} β) (List.map.{max u1 u2, u2} (Prod.{u1, u2} α β) β (Prod.snd.{u1, u2} α β) lp) l') -> (Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) lp (List.zip.{u1, u2} α β l l'))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} {l' : List.{u1} β} {lp : List.{max u1 u2} (Prod.{u2, u1} α β)}, (Eq.{succ u2} (List.{u2} α) (List.map.{max u1 u2, u2} (Prod.{u2, u1} α β) α (Prod.fst.{u2, u1} α β) lp) l) -> (Eq.{succ u1} (List.{u1} β) (List.map.{max u1 u2, u1} (Prod.{u2, u1} α β) β (Prod.snd.{u2, u1} α β) lp) l') -> (Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) lp (List.zip.{u2, u1} α β l l'))
-Case conversion may be inaccurate. Consider using '#align list.zip_of_prod List.zip_of_prodₓ'. -/
theorem zip_of_prod {l : List α} {l' : List β} {lp : List (α × β)} (hl : lp.map Prod.fst = l)
(hr : lp.map Prod.snd = l') : lp = l.zip l' := by
rw [← hl, ← hr, ← zip_unzip lp, ← unzip_left, ← unzip_right, zip_unzip, zip_unzip]
#align list.zip_of_prod List.zip_of_prod
-/- warning: list.map_prod_left_eq_zip -> List.map_prod_left_eq_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l : List.{u1} α} (f : α -> β), Eq.{succ (max u1 u2)} (List.{max u1 u2} (Prod.{u1, u2} α β)) (List.map.{u1, max u1 u2} α (Prod.{u1, u2} α β) (fun (x : α) => Prod.mk.{u1, u2} α β x (f x)) l) (List.zip.{u1, u2} α β l (List.map.{u1, u2} α β f l))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} (f : α -> β), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.map.{u2, max u1 u2} α (Prod.{u2, u1} α β) (fun (x : α) => Prod.mk.{u2, u1} α β x (f x)) l) (List.zip.{u2, u1} α β l (List.map.{u2, u1} α β f l))
-Case conversion may be inaccurate. Consider using '#align list.map_prod_left_eq_zip List.map_prod_left_eq_zipₓ'. -/
theorem map_prod_left_eq_zip {l : List α} (f : α → β) :
(l.map fun x => (x, f x)) = l.zip (l.map f) := by rw [← zip_map']; congr ; exact map_id _
#align list.map_prod_left_eq_zip List.map_prod_left_eq_zip
-/- warning: list.map_prod_right_eq_zip -> List.map_prod_right_eq_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l : List.{u1} α} (f : α -> β), Eq.{succ (max u2 u1)} (List.{max u2 u1} (Prod.{u2, u1} β α)) (List.map.{u1, max u2 u1} α (Prod.{u2, u1} β α) (fun (x : α) => Prod.mk.{u2, u1} β α (f x) x) l) (List.zip.{u2, u1} β α (List.map.{u1, u2} α β f l) l)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} (f : α -> β), Eq.{max (succ u2) (succ u1)} (List.{max u2 u1} (Prod.{u1, u2} β α)) (List.map.{u2, max u2 u1} α (Prod.{u1, u2} β α) (fun (x : α) => Prod.mk.{u1, u2} β α (f x) x) l) (List.zip.{u1, u2} β α (List.map.{u2, u1} α β f l) l)
-Case conversion may be inaccurate. Consider using '#align list.map_prod_right_eq_zip List.map_prod_right_eq_zipₓ'. -/
theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
(l.map fun x => (f x, x)) = (l.map f).zip l := by rw [← zip_map']; congr ; exact map_id _
#align list.map_prod_right_eq_zip List.map_prod_right_eq_zip
-/- warning: list.zip_with_comm -> List.zipWith_comm is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (la : List.{u1} α) (lb : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f la lb) (List.zipWith.{u2, u1, u3} β α γ (fun (b : β) (a : α) => f a b) lb la)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (la : List.{u3} α) (lb : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f la lb) (List.zipWith.{u2, u3, u1} β α γ (fun (b : β) (a : α) => f a b) lb la)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_comm List.zipWith_commₓ'. -/
theorem zipWith_comm (f : α → β → γ) :
∀ (la : List α) (lb : List β), zipWith f la lb = zipWith (fun b a => f a b) lb la
| [], _ => (List.zipWith_nil_right _ _).symm
@@ -518,12 +273,6 @@ theorem zipWith_comm (f : α → β → γ) :
| a :: as, b :: bs => congr_arg _ (zip_with_comm as bs)
#align list.zip_with_comm List.zipWith_comm
-/- warning: list.zip_with_congr -> List.zipWith_congr is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (g : α -> β -> γ) (la : List.{u1} α) (lb : List.{u2} β), (List.Forall₂.{u1, u2} α β (fun (a : α) (b : β) => Eq.{succ u3} γ (f a b) (g a b)) la lb) -> (Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f la lb) (List.zipWith.{u1, u2, u3} α β γ g la lb))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (g : α -> β -> γ) (la : List.{u3} α) (lb : List.{u2} β), (List.Forall₂.{u3, u2} α β (fun (a : α) (b : β) => Eq.{succ u1} γ (f a b) (g a b)) la lb) -> (Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f la lb) (List.zipWith.{u3, u2, u1} α β γ g la lb))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_congr List.zipWith_congrₓ'. -/
@[congr]
theorem zipWith_congr (f g : α → β → γ) (la : List α) (lb : List β)
(h : List.Forall₂ (fun a b => f a b = g a b) la lb) : zipWith f la lb = zipWith g la lb :=
@@ -533,34 +282,16 @@ theorem zipWith_congr (f g : α → β → γ) (la : List α) (lb : List β)
· exact congr_arg₂ _ hfg ih
#align list.zip_with_congr List.zipWith_congr
-/- warning: list.zip_with_comm_of_comm -> List.zipWith_comm_of_comm is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (f : α -> α -> β), (forall (x : α) (y : α), Eq.{succ u2} β (f x y) (f y x)) -> (forall (l : List.{u1} α) (l' : List.{u1} α), Eq.{succ u2} (List.{u2} β) (List.zipWith.{u1, u1, u2} α α β f l l') (List.zipWith.{u1, u1, u2} α α β f l' l))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> α -> β), (forall (x : α) (y : α), Eq.{succ u1} β (f x y) (f y x)) -> (forall (l : List.{u2} α) (l' : List.{u2} α), Eq.{succ u1} (List.{u1} β) (List.zipWith.{u2, u2, u1} α α β f l l') (List.zipWith.{u2, u2, u1} α α β f l' l))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_comm_of_comm List.zipWith_comm_of_commₓ'. -/
theorem zipWith_comm_of_comm (f : α → α → β) (comm : ∀ x y : α, f x y = f y x) (l l' : List α) :
zipWith f l l' = zipWith f l' l := by rw [zip_with_comm]; simp only [comm]
#align list.zip_with_comm_of_comm List.zipWith_comm_of_comm
-/- warning: list.zip_with_same -> List.zipWith_same is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {δ : Type.{u2}} (f : α -> α -> δ) (l : List.{u1} α), Eq.{succ u2} (List.{u2} δ) (List.zipWith.{u1, u1, u2} α α δ f l l) (List.map.{u1, u2} α δ (fun (a : α) => f a a) l)
-but is expected to have type
- forall {α : Type.{u2}} {δ : Type.{u1}} (f : α -> α -> δ) (l : List.{u2} α), Eq.{succ u1} (List.{u1} δ) (List.zipWith.{u2, u2, u1} α α δ f l l) (List.map.{u2, u1} α δ (fun (a : α) => f a a) l)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_same List.zipWith_sameₓ'. -/
@[simp]
theorem zipWith_same (f : α → α → δ) : ∀ l : List α, zipWith f l l = l.map fun a => f a a
| [] => rfl
| x :: xs => congr_arg _ (zip_with_same xs)
#align list.zip_with_same List.zipWith_same
-/- warning: list.zip_with_zip_with_left -> List.zipWith_zipWith_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} (f : δ -> γ -> ε) (g : α -> β -> δ) (la : List.{u1} α) (lb : List.{u2} β) (lc : List.{u3} γ), Eq.{succ u5} (List.{u5} ε) (List.zipWith.{u4, u3, u5} δ γ ε f (List.zipWith.{u1, u2, u4} α β δ g la lb) lc) (List.zipWith3.{u1, u2, u3, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f (g a b) c) la lb lc)
-but is expected to have type
- forall {α : Type.{u5}} {β : Type.{u4}} {γ : Type.{u3}} {δ : Type.{u1}} {ε : Type.{u2}} (f : δ -> γ -> ε) (g : α -> β -> δ) (la : List.{u5} α) (lb : List.{u4} β) (lc : List.{u3} γ), Eq.{succ u2} (List.{u2} ε) (List.zipWith.{u1, u3, u2} δ γ ε f (List.zipWith.{u5, u4, u1} α β δ g la lb) lc) (List.zipWith3.{u5, u4, u3, u2} α β γ ε (fun (a : α) (b : β) (c : γ) => f (g a b) c) la lb lc)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_zip_with_left List.zipWith_zipWith_leftₓ'. -/
theorem zipWith_zipWith_left (f : δ → γ → ε) (g : α → β → δ) :
∀ (la : List α) (lb : List β) (lc : List γ),
zipWith f (zipWith g la lb) lc = zipWith3 (fun a b c => f (g a b) c) la lb lc
@@ -570,12 +301,6 @@ theorem zipWith_zipWith_left (f : δ → γ → ε) (g : α → β → δ) :
| a :: as, b :: bs, c :: cs => congr_arg (cons _) <| zip_with_zip_with_left as bs cs
#align list.zip_with_zip_with_left List.zipWith_zipWith_left
-/- warning: list.zip_with_zip_with_right -> List.zipWith_zipWith_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} (f : α -> δ -> ε) (g : β -> γ -> δ) (la : List.{u1} α) (lb : List.{u2} β) (lc : List.{u3} γ), Eq.{succ u5} (List.{u5} ε) (List.zipWith.{u1, u4, u5} α δ ε f la (List.zipWith.{u2, u3, u4} β γ δ g lb lc)) (List.zipWith3.{u1, u2, u3, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f a (g b c)) la lb lc)
-but is expected to have type
- forall {α : Type.{u5}} {β : Type.{u4}} {γ : Type.{u3}} {δ : Type.{u1}} {ε : Type.{u2}} (f : α -> δ -> ε) (g : β -> γ -> δ) (la : List.{u5} α) (lb : List.{u4} β) (lc : List.{u3} γ), Eq.{succ u2} (List.{u2} ε) (List.zipWith.{u5, u1, u2} α δ ε f la (List.zipWith.{u4, u3, u1} β γ δ g lb lc)) (List.zipWith3.{u5, u4, u3, u2} α β γ ε (fun (a : α) (b : β) (c : γ) => f a (g b c)) la lb lc)
-Case conversion may be inaccurate. Consider using '#align list.zip_with_zip_with_right List.zipWith_zipWith_rightₓ'. -/
theorem zipWith_zipWith_right (f : α → δ → ε) (g : β → γ → δ) :
∀ (la : List α) (lb : List β) (lc : List γ),
zipWith f la (zipWith g lb lc) = zipWith3 (fun a b c => f a (g b c)) la lb lc
@@ -585,12 +310,6 @@ theorem zipWith_zipWith_right (f : α → δ → ε) (g : β → γ → δ) :
| a :: as, b :: bs, c :: cs => congr_arg (cons _) <| zip_with_zip_with_right as bs cs
#align list.zip_with_zip_with_right List.zipWith_zipWith_right
-/- warning: list.zip_with3_same_left -> List.zipWith3_same_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> α -> β -> γ) (la : List.{u1} α) (lb : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith3.{u1, u1, u2, u3} α α β γ f la la lb) (List.zipWith.{u1, u2, u3} α β γ (fun (a : α) (b : β) => f a a b) la lb)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> α -> β -> γ) (la : List.{u3} α) (lb : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith3.{u3, u3, u2, u1} α α β γ f la la lb) (List.zipWith.{u3, u2, u1} α β γ (fun (a : α) (b : β) => f a a b) la lb)
-Case conversion may be inaccurate. Consider using '#align list.zip_with3_same_left List.zipWith3_same_leftₓ'. -/
@[simp]
theorem zipWith3_same_left (f : α → α → β → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la la lb = zipWith (fun a b => f a a b) la lb
@@ -599,12 +318,6 @@ theorem zipWith3_same_left (f : α → α → β → γ) :
| a :: as, b :: bs => congr_arg (cons _) <| zip_with3_same_left as bs
#align list.zip_with3_same_left List.zipWith3_same_left
-/- warning: list.zip_with3_same_mid -> List.zipWith3_same_mid is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> α -> γ) (la : List.{u1} α) (lb : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith3.{u1, u2, u1, u3} α β α γ f la lb la) (List.zipWith.{u1, u2, u3} α β γ (fun (a : α) (b : β) => f a b a) la lb)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> α -> γ) (la : List.{u3} α) (lb : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith3.{u3, u2, u3, u1} α β α γ f la lb la) (List.zipWith.{u3, u2, u1} α β γ (fun (a : α) (b : β) => f a b a) la lb)
-Case conversion may be inaccurate. Consider using '#align list.zip_with3_same_mid List.zipWith3_same_midₓ'. -/
@[simp]
theorem zipWith3_same_mid (f : α → β → α → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la lb la = zipWith (fun a b => f a b a) la lb
@@ -613,12 +326,6 @@ theorem zipWith3_same_mid (f : α → β → α → γ) :
| a :: as, b :: bs => congr_arg (cons _) <| zip_with3_same_mid as bs
#align list.zip_with3_same_mid List.zipWith3_same_mid
-/- warning: list.zip_with3_same_right -> List.zipWith3_same_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> β -> γ) (la : List.{u1} α) (lb : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.zipWith3.{u1, u2, u2, u3} α β β γ f la lb lb) (List.zipWith.{u1, u2, u3} α β γ (fun (a : α) (b : β) => f a b b) la lb)
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> β -> γ) (la : List.{u3} α) (lb : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith3.{u3, u2, u2, u1} α β β γ f la lb lb) (List.zipWith.{u3, u2, u1} α β γ (fun (a : α) (b : β) => f a b b) la lb)
-Case conversion may be inaccurate. Consider using '#align list.zip_with3_same_right List.zipWith3_same_rightₓ'. -/
@[simp]
theorem zipWith3_same_right (f : α → β → β → γ) :
∀ (la : List α) (lb : List β), zipWith3 f la lb lb = zipWith (fun a b => f a b b) la lb
@@ -669,12 +376,6 @@ theorem revzip_swap (l : List α) : (revzip l).map Prod.swap = revzip l.reverse
#align list.revzip_swap List.revzip_swap
-/
-/- warning: list.nth_zip_with -> List.get?_zip_with is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l₁ : List.{u1} α) (l₂ : List.{u2} β) (i : Nat), Eq.{succ u3} (Option.{u3} γ) (List.get?.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l₁ l₂) i) (Option.bind.{max u2 u3, u3} (β -> γ) γ (Option.map.{u1, max u2 u3} α (β -> γ) f (List.get?.{u1} α l₁ i)) (fun (g : β -> γ) => Option.map.{u2, u3} β γ g (List.get?.{u2} β l₂ i)))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l₁ : List.{u3} α) (l₂ : List.{u2} β) (i : Nat), Eq.{succ u1} (Option.{u1} γ) (List.get?.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l₁ l₂) i) (Option.bind.{max u2 u1, u1} (β -> γ) γ (Option.map.{u3, max u2 u1} α (β -> γ) f (List.get?.{u3} α l₁ i)) (fun (g : β -> γ) => Option.map.{u2, u1} β γ g (List.get?.{u2} β l₂ i)))
-Case conversion may be inaccurate. Consider using '#align list.nth_zip_with List.get?_zip_withₓ'. -/
theorem get?_zip_with (f : α → β → γ) (l₁ : List α) (l₂ : List β) (i : ℕ) :
(zipWith f l₁ l₂).get? i = ((l₁.get? i).map f).bind fun g => (l₂.get? i).map g :=
by
@@ -685,12 +386,6 @@ theorem get?_zip_with (f : α → β → γ) (l₁ : List α) (l₂ : List β) (
· cases i <;> simp only [Option.map_some', nth, Option.some_bind', *]
#align list.nth_zip_with List.get?_zip_with
-/- warning: list.nth_zip_with_eq_some -> List.get?_zip_with_eq_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l₁ : List.{u1} α) (l₂ : List.{u2} β) (z : γ) (i : Nat), Iff (Eq.{succ u3} (Option.{u3} γ) (List.get?.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l₁ l₂) i) (Option.some.{u3} γ z)) (Exists.{succ u1} α (fun (x : α) => Exists.{succ u2} β (fun (y : β) => And (Eq.{succ u1} (Option.{u1} α) (List.get?.{u1} α l₁ i) (Option.some.{u1} α x)) (And (Eq.{succ u2} (Option.{u2} β) (List.get?.{u2} β l₂ i) (Option.some.{u2} β y)) (Eq.{succ u3} γ (f x y) z)))))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l₁ : List.{u3} α) (l₂ : List.{u2} β) (z : γ) (i : Nat), Iff (Eq.{succ u1} (Option.{u1} γ) (List.get?.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l₁ l₂) i) (Option.some.{u1} γ z)) (Exists.{succ u3} α (fun (x : α) => Exists.{succ u2} β (fun (y : β) => And (Eq.{succ u3} (Option.{u3} α) (List.get?.{u3} α l₁ i) (Option.some.{u3} α x)) (And (Eq.{succ u2} (Option.{u2} β) (List.get?.{u2} β l₂ i) (Option.some.{u2} β y)) (Eq.{succ u1} γ (f x y) z)))))
-Case conversion may be inaccurate. Consider using '#align list.nth_zip_with_eq_some List.get?_zip_with_eq_someₓ'. -/
theorem get?_zip_with_eq_some {α β γ} (f : α → β → γ) (l₁ : List α) (l₂ : List β) (z : γ) (i : ℕ) :
(zipWith f l₁ l₂).get? i = some z ↔
∃ x y, l₁.get? i = some x ∧ l₂.get? i = some y ∧ f x y = z :=
@@ -701,12 +396,6 @@ theorem get?_zip_with_eq_some {α β γ} (f : α → β → γ) (l₁ : List α)
cases i <;> simp [*]
#align list.nth_zip_with_eq_some List.get?_zip_with_eq_some
-/- warning: list.nth_zip_eq_some -> List.get?_zip_eq_some is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} (l₁ : List.{u1} α) (l₂ : List.{u2} β) (z : Prod.{u1, u2} α β) (i : Nat), Iff (Eq.{succ (max u1 u2)} (Option.{max u1 u2} (Prod.{u1, u2} α β)) (List.get?.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l₁ l₂) i) (Option.some.{max u1 u2} (Prod.{u1, u2} α β) z)) (And (Eq.{succ u1} (Option.{u1} α) (List.get?.{u1} α l₁ i) (Option.some.{u1} α (Prod.fst.{u1, u2} α β z))) (Eq.{succ u2} (Option.{u2} β) (List.get?.{u2} β l₂ i) (Option.some.{u2} β (Prod.snd.{u1, u2} α β z))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} (l₁ : List.{u2} α) (l₂ : List.{u1} β) (z : Prod.{u2, u1} α β) (i : Nat), Iff (Eq.{max (succ u2) (succ u1)} (Option.{max u2 u1} (Prod.{u2, u1} α β)) (List.get?.{max u2 u1} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l₁ l₂) i) (Option.some.{max u2 u1} (Prod.{u2, u1} α β) z)) (And (Eq.{succ u2} (Option.{u2} α) (List.get?.{u2} α l₁ i) (Option.some.{u2} α (Prod.fst.{u2, u1} α β z))) (Eq.{succ u1} (Option.{u1} β) (List.get?.{u1} β l₂ i) (Option.some.{u1} β (Prod.snd.{u2, u1} α β z))))
-Case conversion may be inaccurate. Consider using '#align list.nth_zip_eq_some List.get?_zip_eq_someₓ'. -/
theorem get?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i : ℕ) :
(zip l₁ l₂).get? i = some z ↔ l₁.get? i = some z.1 ∧ l₂.get? i = some z.2 :=
by
@@ -716,12 +405,6 @@ theorem get?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i :
· rintro ⟨h₀, h₁⟩; exact ⟨_, _, h₀, h₁, rfl⟩
#align list.nth_zip_eq_some List.get?_zip_eq_some
-/- warning: list.nth_le_zip_with -> List.nthLe_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {l : List.{u1} α} {l' : List.{u2} β} {i : Nat} {h : LT.lt.{0} Nat Nat.hasLt i (List.length.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l'))}, Eq.{succ u3} γ (List.nthLe.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l') i h) (f (List.nthLe.{u1} α l i (List.lt_length_left_of_zipWith.{u1, u2, u3} α β γ f i l l' h)) (List.nthLe.{u2} β l' i (List.lt_length_right_of_zipWith.{u1, u2, u3} α β γ f i l l' h)))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {l : List.{u3} α} {l' : List.{u2} β} {i : Nat} {h : LT.lt.{0} Nat instLTNat i (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l'))}, Eq.{succ u1} γ (List.nthLe.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l') i h) (f (List.nthLe.{u3} α l i (List.lt_length_left_of_zipWith.{u1, u2, u3} α β γ f i l l' h)) (List.nthLe.{u2} β l' i (List.lt_length_right_of_zipWith.{u1, u2, u3} α β γ f i l l' h)))
-Case conversion may be inaccurate. Consider using '#align list.nth_le_zip_with List.nthLe_zipWithₓ'. -/
@[simp]
theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i : ℕ}
{h : i < (zipWith f l l').length} :
@@ -735,12 +418,6 @@ theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i :
simp only [← nth_le_nth, eq_self_iff_true, and_self_iff]
#align list.nth_le_zip_with List.nthLe_zipWith
-/- warning: list.nth_le_zip -> List.nthLe_zip is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {l : List.{u1} α} {l' : List.{u2} β} {i : Nat} {h : LT.lt.{0} Nat Nat.hasLt i (List.length.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l l'))}, Eq.{max (succ u1) (succ u2)} (Prod.{u1, u2} α β) (List.nthLe.{max u1 u2} (Prod.{u1, u2} α β) (List.zip.{u1, u2} α β l l') i h) (Prod.mk.{u1, u2} α β (List.nthLe.{u1} α l i (List.lt_length_left_of_zip.{u1, u2} α β i l l' h)) (List.nthLe.{u2} β l' i (List.lt_length_right_of_zip.{u1, u2} α β i l l' h)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} {l' : List.{u1} β} {i : Nat} {h : LT.lt.{0} Nat instLTNat i (List.length.{max u2 u1} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l l'))}, Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} α β) (List.nthLe.{max u2 u1} (Prod.{u2, u1} α β) (List.zip.{u2, u1} α β l l') i h) (Prod.mk.{u2, u1} α β (List.nthLe.{u2} α l i (List.lt_length_left_of_zip.{u1, u2} α β i l l' h)) (List.nthLe.{u1} β l' i (List.lt_length_right_of_zip.{u1, u2} α β i l l' h)))
-Case conversion may be inaccurate. Consider using '#align list.nth_le_zip List.nthLe_zipₓ'. -/
@[simp]
theorem nthLe_zip {l : List α} {l' : List β} {i : ℕ} {h : i < (zip l l').length} :
(zip l l').nthLe i h =
@@ -767,12 +444,6 @@ theorem mem_zip_inits_tails {l : List α} {init tail : List α} :
#align list.mem_zip_inits_tails List.mem_zip_inits_tails
-/
-/- warning: list.map_uncurry_zip_eq_zip_with -> List.map_uncurry_zip_eq_zipWith is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (l' : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.map.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (Function.uncurry.{u1, u2, u3} α β γ f) (List.zip.{u1, u2} α β l l')) (List.zipWith.{u1, u2, u3} α β γ f l l')
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l : List.{u3} α) (l' : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.map.{max u2 u3, u1} (Prod.{u3, u2} α β) γ (Function.uncurry.{u3, u2, u1} α β γ f) (List.zip.{u3, u2} α β l l')) (List.zipWith.{u3, u2, u1} α β γ f l l')
-Case conversion may be inaccurate. Consider using '#align list.map_uncurry_zip_eq_zip_with List.map_uncurry_zip_eq_zipWithₓ'. -/
theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : List β) :
map (Function.uncurry f) (l.zip l') = zipWith f l l' :=
by
@@ -783,12 +454,6 @@ theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : Li
· simp [hl]
#align list.map_uncurry_zip_eq_zip_with List.map_uncurry_zip_eq_zipWith
-/- warning: list.sum_zip_with_distrib_left -> List.sum_zipWith_distrib_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : Semiring.{u3} γ] (f : α -> β -> γ) (n : γ) (l : List.{u1} α) (l' : List.{u2} β), Eq.{succ u3} γ (List.sum.{u3} γ (Distrib.toHasAdd.{u3} γ (NonUnitalNonAssocSemiring.toDistrib.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1)))) (MulZeroClass.toHasZero.{u3} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1)))) (List.zipWith.{u1, u2, u3} α β γ (fun (x : α) (y : β) => HMul.hMul.{u3, u3, u3} γ γ γ (instHMul.{u3} γ (Distrib.toHasMul.{u3} γ (NonUnitalNonAssocSemiring.toDistrib.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1))))) n (f x y)) l l')) (HMul.hMul.{u3, u3, u3} γ γ γ (instHMul.{u3} γ (Distrib.toHasMul.{u3} γ (NonUnitalNonAssocSemiring.toDistrib.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1))))) n (List.sum.{u3} γ (Distrib.toHasAdd.{u3} γ (NonUnitalNonAssocSemiring.toDistrib.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1)))) (MulZeroClass.toHasZero.{u3} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ _inst_1)))) (List.zipWith.{u1, u2, u3} α β γ f l l')))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u2} γ] (f : α -> β -> γ) (n : γ) (l : List.{u3} α) (l' : List.{u1} β), Eq.{succ u2} γ (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_1)))) (MonoidWithZero.toZero.{u2} γ (Semiring.toMonoidWithZero.{u2} γ _inst_1)) (List.zipWith.{u3, u1, u2} α β γ (fun (x : α) (y : β) => HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_1)))) n (f x y)) l l')) (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_1)))) n (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_1)))) (MonoidWithZero.toZero.{u2} γ (Semiring.toMonoidWithZero.{u2} γ _inst_1)) (List.zipWith.{u3, u1, u2} α β γ f l l')))
-Case conversion may be inaccurate. Consider using '#align list.sum_zip_with_distrib_left List.sum_zipWith_distrib_leftₓ'. -/
@[simp]
theorem sum_zipWith_distrib_left {γ : Type _} [Semiring γ] (f : α → β → γ) (n : γ) (l : List α)
(l' : List β) : (l.zipWith (fun x y => n * f x y) l').Sum = n * (l.zipWith f l').Sum :=
@@ -807,12 +472,6 @@ section Distrib
variable (f : α → β → γ) (l : List α) (l' : List β) (n : ℕ)
-/- warning: list.zip_with_distrib_take -> List.zipWith_distrib_take is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (l' : List.{u2} β) (n : Nat), Eq.{succ u3} (List.{u3} γ) (List.take.{u3} γ n (List.zipWith.{u1, u2, u3} α β γ f l l')) (List.zipWith.{u1, u2, u3} α β γ f (List.take.{u1} α n l) (List.take.{u2} β n l'))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (l : List.{u3} α) (l' : List.{u1} β) (n : Nat), Eq.{succ u2} (List.{u2} γ) (List.take.{u2} γ n (List.zipWith.{u3, u1, u2} α β γ f l l')) (List.zipWith.{u3, u1, u2} α β γ f (List.take.{u3} α n l) (List.take.{u1} β n l'))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_distrib_take List.zipWith_distrib_takeₓ'. -/
theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l'.take n) :=
by
induction' l with hd tl hl generalizing l' n
@@ -824,12 +483,6 @@ theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l
· simp [hl]
#align list.zip_with_distrib_take List.zipWith_distrib_take
-/- warning: list.zip_with_distrib_drop -> List.zipWith_distrib_drop is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (l' : List.{u2} β) (n : Nat), Eq.{succ u3} (List.{u3} γ) (List.drop.{u3} γ n (List.zipWith.{u1, u2, u3} α β γ f l l')) (List.zipWith.{u1, u2, u3} α β γ f (List.drop.{u1} α n l) (List.drop.{u2} β n l'))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (l : List.{u3} α) (l' : List.{u1} β) (n : Nat), Eq.{succ u2} (List.{u2} γ) (List.drop.{u2} γ n (List.zipWith.{u3, u1, u2} α β γ f l l')) (List.zipWith.{u3, u1, u2} α β γ f (List.drop.{u3} α n l) (List.drop.{u1} β n l'))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_distrib_drop List.zipWith_distrib_dropₓ'. -/
theorem zipWith_distrib_drop : (zipWith f l l').drop n = zipWith f (l.drop n) (l'.drop n) :=
by
induction' l with hd tl hl generalizing l' n
@@ -841,22 +494,10 @@ theorem zipWith_distrib_drop : (zipWith f l l').drop n = zipWith f (l.drop n) (l
· simp [hl]
#align list.zip_with_distrib_drop List.zipWith_distrib_drop
-/- warning: list.zip_with_distrib_tail -> List.zipWith_distrib_tail is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (l' : List.{u2} β), Eq.{succ u3} (List.{u3} γ) (List.tail.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l')) (List.zipWith.{u1, u2, u3} α β γ f (List.tail.{u1} α l) (List.tail.{u2} β l'))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (l : List.{u3} α) (l' : List.{u1} β), Eq.{succ u2} (List.{u2} γ) (List.tail.{u2} γ (List.zipWith.{u3, u1, u2} α β γ f l l')) (List.zipWith.{u3, u1, u2} α β γ f (List.tail.{u3} α l) (List.tail.{u1} β l'))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_distrib_tail List.zipWith_distrib_tailₓ'. -/
theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail := by
simp_rw [← drop_one, zip_with_distrib_drop]
#align list.zip_with_distrib_tail List.zipWith_distrib_tail
-/- warning: list.zip_with_append -> List.zipWith_append is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (la : List.{u1} α) (l' : List.{u2} β) (lb : List.{u2} β), (Eq.{1} Nat (List.length.{u1} α l) (List.length.{u2} β l')) -> (Eq.{succ u3} (List.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f (Append.append.{u1} (List.{u1} α) (List.hasAppend.{u1} α) l la) (Append.append.{u2} (List.{u2} β) (List.hasAppend.{u2} β) l' lb)) (Append.append.{u3} (List.{u3} γ) (List.hasAppend.{u3} γ) (List.zipWith.{u1, u2, u3} α β γ f l l') (List.zipWith.{u1, u2, u3} α β γ f la lb)))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l : List.{u3} α) (la : List.{u3} α) (l' : List.{u2} β) (lb : List.{u2} β), (Eq.{1} Nat (List.length.{u3} α l) (List.length.{u2} β l')) -> (Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u3, u2, u1} α β γ f (HAppend.hAppend.{u3, u3, u3} (List.{u3} α) (List.{u3} α) (List.{u3} α) (instHAppend.{u3} (List.{u3} α) (List.instAppendList.{u3} α)) l la) (HAppend.hAppend.{u2, u2, u2} (List.{u2} β) (List.{u2} β) (List.{u2} β) (instHAppend.{u2} (List.{u2} β) (List.instAppendList.{u2} β)) l' lb)) (HAppend.hAppend.{u1, u1, u1} (List.{u1} γ) (List.{u1} γ) (List.{u1} γ) (instHAppend.{u1} (List.{u1} γ) (List.instAppendList.{u1} γ)) (List.zipWith.{u3, u2, u1} α β γ f l l') (List.zipWith.{u3, u2, u1} α β γ f la lb)))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_append List.zipWith_appendₓ'. -/
theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β) (h : l.length = l'.length) :
zipWith f (l ++ la) (l' ++ lb) = zipWith f l l' ++ zipWith f la lb :=
by
@@ -869,12 +510,6 @@ theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
simp [hl _ h]
#align list.zip_with_append List.zipWith_append
-/- warning: list.zip_with_distrib_reverse -> List.zipWith_distrib_reverse is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (l : List.{u1} α) (l' : List.{u2} β), (Eq.{1} Nat (List.length.{u1} α l) (List.length.{u2} β l')) -> (Eq.{succ u3} (List.{u3} γ) (List.reverse.{u3} γ (List.zipWith.{u1, u2, u3} α β γ f l l')) (List.zipWith.{u1, u2, u3} α β γ f (List.reverse.{u1} α l) (List.reverse.{u2} β l')))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (l : List.{u3} α) (l' : List.{u2} β), (Eq.{1} Nat (List.length.{u3} α l) (List.length.{u2} β l')) -> (Eq.{succ u1} (List.{u1} γ) (List.reverse.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l')) (List.zipWith.{u3, u2, u1} α β γ f (List.reverse.{u3} α l) (List.reverse.{u2} β l')))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_distrib_reverse List.zipWith_distrib_reverseₓ'. -/
theorem zipWith_distrib_reverse (h : l.length = l'.length) :
(zipWith f l l').reverse = zipWith f l.reverse l'.reverse :=
by
@@ -893,12 +528,6 @@ section CommMonoid
variable [CommMonoid α]
-/- warning: list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop -> List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L) L')))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6918 : α) (x._@.Mathlib.Data.List.Zip._hyg.6920 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6918 x._@.Mathlib.Data.List.Zip._hyg.6920) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
-Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_dropₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
∀ L L' : List α,
@@ -915,12 +544,6 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
#align list.sum_add_sum_eq_sum_zip_with_add_sum_drop List.sum_add_sum_eq_sum_zipWith_add_sum_drop
-/- warning: list.prod_mul_prod_eq_prod_zip_with_of_length_eq -> List.prod_mul_prod_eq_prod_zipWith_of_length_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7118 : α) (x._@.Mathlib.Data.List.Zip._hyg.7120 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7118 x._@.Mathlib.Data.List.Zip._hyg.7120) L L')))
-Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eqₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
L.Prod * L'.Prod = (zipWith (· * ·) L L').Prod :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -165,9 +165,7 @@ theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (h : length l₁ = length l₂),
All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
- | a :: l₁, b :: l₂, h => by
- simp only [length_cons, add_left_inj] at h
- simp [all₂_zip_with h]
+ | a :: l₁, b :: l₂, h => by simp only [length_cons, add_left_inj] at h; simp [all₂_zip_with h]
#align list.all₂_zip_with List.all₂_zipWith
/- warning: list.lt_length_left_of_zip_with -> List.lt_length_left_of_zipWith is a dubious translation:
@@ -177,9 +175,7 @@ but is expected to have type
forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {i : Nat} {l : List.{u3} α} {l' : List.{u2} β}, (LT.lt.{0} Nat instLTNat i (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u3} α l))
Case conversion may be inaccurate. Consider using '#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWithₓ'. -/
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l.length :=
- by
- rw [length_zip_with, lt_min_iff] at h
+ (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
@@ -190,9 +186,7 @@ but is expected to have type
forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {i : Nat} {l : List.{u3} α} {l' : List.{u2} β}, (LT.lt.{0} Nat instLTNat i (List.length.{u1} γ (List.zipWith.{u3, u2, u1} α β γ f l l'))) -> (LT.lt.{0} Nat instLTNat i (List.length.{u2} β l'))
Case conversion may be inaccurate. Consider using '#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWithₓ'. -/
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l'.length :=
- by
- rw [length_zip_with, lt_min_iff] at h
+ (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zip_with, lt_min_iff] at h;
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
@@ -289,9 +283,7 @@ but is expected to have type
forall {α : Type.{u4}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Type.{u3}} (f : α -> β -> γ) (g : δ -> α) (l : List.{u3} δ) (l' : List.{u2} β), Eq.{succ u1} (List.{u1} γ) (List.zipWith.{u4, u2, u1} α β γ f (List.map.{u3, u4} δ α g l) l') (List.zipWith.{u3, u2, u1} δ β γ (Function.comp.{succ u3, succ u4, max (succ u1) (succ u2)} δ α (β -> γ) f g) l l')
Case conversion may be inaccurate. Consider using '#align list.zip_with_map_left List.zipWith_map_leftₓ'. -/
theorem zipWith_map_left (f : α → β → γ) (g : δ → α) (l : List δ) (l' : List β) :
- zipWith f (l.map g) l' = zipWith (f ∘ g) l l' :=
- by
- convert zip_with_map f g id l l'
+ zipWith f (l.map g) l' = zipWith (f ∘ g) l l' := by convert zip_with_map f g id l l';
exact Eq.symm (List.map_id _)
#align list.zip_with_map_left List.zipWith_map_left
@@ -302,10 +294,8 @@ but is expected to have type
forall {α : Type.{u4}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Type.{u3}} (f : α -> β -> γ) (l : List.{u4} α) (g : δ -> β) (l' : List.{u3} δ), Eq.{succ u2} (List.{u2} γ) (List.zipWith.{u4, u1, u2} α β γ f l (List.map.{u3, u1} δ β g l')) (List.zipWith.{u4, u3, u2} α δ γ (fun (x : α) => Function.comp.{succ u3, succ u1, succ u2} δ β γ (f x) g) l l')
Case conversion may be inaccurate. Consider using '#align list.zip_with_map_right List.zipWith_map_rightₓ'. -/
theorem zipWith_map_right (f : α → β → γ) (l : List α) (g : δ → β) (l' : List δ) :
- zipWith f l (l'.map g) = zipWith (fun x => f x ∘ g) l l' :=
- by
- convert List.zipWith_map f id g l l'
- exact Eq.symm (List.map_id _)
+ zipWith f l (l'.map g) = zipWith (fun x => f x ∘ g) l l' := by
+ convert List.zipWith_map f id g l l'; exact Eq.symm (List.map_id _)
#align list.zip_with_map_right List.zipWith_map_right
/- warning: list.zip_map' -> List.zip_map' is a dubious translation:
@@ -357,12 +347,8 @@ Case conversion may be inaccurate. Consider using '#align list.map_fst_zip List.
theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
- | a :: as, b :: bs, h => by
- simp at h
- simp! [*]
- | a :: as, [], h => by
- simp at h
- contradiction
+ | a :: as, b :: bs, h => by simp at h; simp! [*]
+ | a :: as, [], h => by simp at h; contradiction
#align list.map_fst_zip List.map_fst_zip
/- warning: list.map_snd_zip -> List.map_snd_zip is a dubious translation:
@@ -373,15 +359,9 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align list.map_snd_zip List.map_snd_zipₓ'. -/
theorem map_snd_zip :
∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
- | _, [], _ => by
- rw [zip_nil_right]
- rfl
- | [], b :: bs, h => by
- simp at h
- contradiction
- | a :: as, b :: bs, h => by
- simp at h
- simp! [*]
+ | _, [], _ => by rw [zip_nil_right]; rfl
+ | [], b :: bs, h => by simp at h; contradiction
+ | a :: as, b :: bs, h => by simp at h; simp! [*]
#align list.map_snd_zip List.map_snd_zip
/- warning: list.unzip_nil -> List.unzip_nil is a dubious translation:
@@ -512,11 +492,7 @@ but is expected to have type
forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} (f : α -> β), Eq.{max (succ u2) (succ u1)} (List.{max u1 u2} (Prod.{u2, u1} α β)) (List.map.{u2, max u1 u2} α (Prod.{u2, u1} α β) (fun (x : α) => Prod.mk.{u2, u1} α β x (f x)) l) (List.zip.{u2, u1} α β l (List.map.{u2, u1} α β f l))
Case conversion may be inaccurate. Consider using '#align list.map_prod_left_eq_zip List.map_prod_left_eq_zipₓ'. -/
theorem map_prod_left_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (x, f x)) = l.zip (l.map f) :=
- by
- rw [← zip_map']
- congr
- exact map_id _
+ (l.map fun x => (x, f x)) = l.zip (l.map f) := by rw [← zip_map']; congr ; exact map_id _
#align list.map_prod_left_eq_zip List.map_prod_left_eq_zip
/- warning: list.map_prod_right_eq_zip -> List.map_prod_right_eq_zip is a dubious translation:
@@ -526,11 +502,7 @@ but is expected to have type
forall {α : Type.{u2}} {β : Type.{u1}} {l : List.{u2} α} (f : α -> β), Eq.{max (succ u2) (succ u1)} (List.{max u2 u1} (Prod.{u1, u2} β α)) (List.map.{u2, max u2 u1} α (Prod.{u1, u2} β α) (fun (x : α) => Prod.mk.{u1, u2} β α (f x) x) l) (List.zip.{u1, u2} β α (List.map.{u2, u1} α β f l) l)
Case conversion may be inaccurate. Consider using '#align list.map_prod_right_eq_zip List.map_prod_right_eq_zipₓ'. -/
theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (f x, x)) = (l.map f).zip l :=
- by
- rw [← zip_map']
- congr
- exact map_id _
+ (l.map fun x => (f x, x)) = (l.map f).zip l := by rw [← zip_map']; congr ; exact map_id _
#align list.map_prod_right_eq_zip List.map_prod_right_eq_zip
/- warning: list.zip_with_comm -> List.zipWith_comm is a dubious translation:
@@ -568,9 +540,7 @@ but is expected to have type
forall {α : Type.{u2}} {β : Type.{u1}} (f : α -> α -> β), (forall (x : α) (y : α), Eq.{succ u1} β (f x y) (f y x)) -> (forall (l : List.{u2} α) (l' : List.{u2} α), Eq.{succ u1} (List.{u1} β) (List.zipWith.{u2, u2, u1} α α β f l l') (List.zipWith.{u2, u2, u1} α α β f l' l))
Case conversion may be inaccurate. Consider using '#align list.zip_with_comm_of_comm List.zipWith_comm_of_commₓ'. -/
theorem zipWith_comm_of_comm (f : α → α → β) (comm : ∀ x y : α, f x y = f y x) (l l' : List α) :
- zipWith f l l' = zipWith f l' l := by
- rw [zip_with_comm]
- simp only [comm]
+ zipWith f l l' = zipWith f l' l := by rw [zip_with_comm]; simp only [comm]
#align list.zip_with_comm_of_comm List.zipWith_comm_of_comm
/- warning: list.zip_with_same -> List.zipWith_same is a dubious translation:
@@ -742,10 +712,8 @@ theorem get?_zip_eq_some (l₁ : List α) (l₂ : List β) (z : α × β) (i :
by
cases z
rw [zip, nth_zip_with_eq_some]; constructor
- · rintro ⟨x, y, h₀, h₁, h₂⟩
- cc
- · rintro ⟨h₀, h₁⟩
- exact ⟨_, _, h₀, h₁, rfl⟩
+ · rintro ⟨x, y, h₀, h₁, h₂⟩; cc
+ · rintro ⟨h₀, h₁⟩; exact ⟨_, _, h₀, h₁, rfl⟩
#align list.nth_zip_eq_some List.get?_zip_eq_some
/- warning: list.nth_le_zip_with -> List.nthLe_zipWith is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/95a87616d63b3cb49d3fe678d416fbe9c4217bf4
@@ -929,7 +929,7 @@ variable [CommMonoid α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L) L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6900 : α) (x._@.Mathlib.Data.List.Zip._hyg.6902 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6900 x._@.Mathlib.Data.List.Zip._hyg.6902) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6918 : α) (x._@.Mathlib.Data.List.Zip._hyg.6920 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6918 x._@.Mathlib.Data.List.Zip._hyg.6920) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_dropₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
@@ -951,7 +951,7 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7099 : α) (x._@.Mathlib.Data.List.Zip._hyg.7101 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7099 x._@.Mathlib.Data.List.Zip._hyg.7101) L L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7118 : α) (x._@.Mathlib.Data.List.Zip._hyg.7120 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7118 x._@.Mathlib.Data.List.Zip._hyg.7120) L L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eqₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
@@ -929,7 +929,7 @@ variable [CommMonoid α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L) L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6906 : α) (x._@.Mathlib.Data.List.Zip._hyg.6908 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6906 x._@.Mathlib.Data.List.Zip._hyg.6908) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6900 : α) (x._@.Mathlib.Data.List.Zip._hyg.6902 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6900 x._@.Mathlib.Data.List.Zip._hyg.6902) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_dropₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
@@ -951,7 +951,7 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7105 : α) (x._@.Mathlib.Data.List.Zip._hyg.7107 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7105 x._@.Mathlib.Data.List.Zip._hyg.7107) L L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7099 : α) (x._@.Mathlib.Data.List.Zip._hyg.7101 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7099 x._@.Mathlib.Data.List.Zip._hyg.7101) L L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eqₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce7e9d53d4bbc38065db3b595cd5bd73c323bc1d
@@ -929,7 +929,7 @@ variable [CommMonoid α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L) L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6658 : α) (x._@.Mathlib.Data.List.Zip._hyg.6660 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6658 x._@.Mathlib.Data.List.Zip._hyg.6660) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6906 : α) (x._@.Mathlib.Data.List.Zip._hyg.6908 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6906 x._@.Mathlib.Data.List.Zip._hyg.6908) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_dropₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
@@ -951,7 +951,7 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6857 : α) (x._@.Mathlib.Data.List.Zip._hyg.6859 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6857 x._@.Mathlib.Data.List.Zip._hyg.6859) L L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.7105 : α) (x._@.Mathlib.Data.List.Zip._hyg.7107 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.7105 x._@.Mathlib.Data.List.Zip._hyg.7107) L L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eqₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/195fcd60ff2bfe392543bceb0ec2adcdb472db4c
@@ -929,7 +929,7 @@ variable [CommMonoid α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.drop.{u1} α (List.length.{u1} α L) L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6649 : α) (x._@.Mathlib.Data.List.Zip._hyg.6651 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6649 x._@.Mathlib.Data.List.Zip._hyg.6651) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6658 : α) (x._@.Mathlib.Data.List.Zip._hyg.6660 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6658 x._@.Mathlib.Data.List.Zip._hyg.6660) L L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L') L))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.drop.{u1} α (List.length.{u1} α L) L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_dropₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
@@ -951,7 +951,7 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) L')) (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (List.zipWith.{u1, u1, u1} α α α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))))) L L')))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6848 : α) (x._@.Mathlib.Data.List.Zip._hyg.6850 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6848 x._@.Mathlib.Data.List.Zip._hyg.6850) L L')))
+ forall {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (L : List.{u1} α) (L' : List.{u1} α), (Eq.{1} Nat (List.length.{u1} α L) (List.length.{u1} α L')) -> (Eq.{succ u1} α (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) L')) (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)) (List.zipWith.{u1, u1, u1} α α α (fun (x._@.Mathlib.Data.List.Zip._hyg.6857 : α) (x._@.Mathlib.Data.List.Zip._hyg.6859 : α) => HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_1)))) x._@.Mathlib.Data.List.Zip._hyg.6857 x._@.Mathlib.Data.List.Zip._hyg.6859) L L')))
Case conversion may be inaccurate. Consider using '#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eqₓ'. -/
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -264,8 +264,8 @@ theorem get?_zip_with (f : α → β → γ) (l₁ : List α) (l₂ : List β) (
induction' l₁ with head tail generalizing l₂ i
· rw [zipWith] <;> simp
· cases l₂
- simp only [zipWith, Seq.seq, Functor.map, get?, Option.map_none']
- · cases (head :: tail).get? i <;> rfl
+ · simp only [zipWith, Seq.seq, Functor.map, get?, Option.map_none']
+ cases (head :: tail).get? i <;> rfl
· cases i <;> simp only [Option.map_some', get?, Option.some_bind', *]
#align list.nth_zip_with List.get?_zip_with
Remove dependencies on algebra in the Data.List
folder except for:
Data.List.EditDistance
: Actually relies on algebra. Maybe should be moved?Data.List.Card
: Completely unused and redundant.Data.List.Cycle
: Relies on Fintype
, which shouldn't rely on algebra but it's hard to fix right now. Maybe should be moved?Data.List.Func
: Completely unused and redundant.Data.List.Lex
: That's order theory. Could be moved.Data.List.Prime
. That's algebra. Should definitely be moved.Data.List.Sym
: Relies on Multiset
, which shouldn't rely on algebra but it's hard to fix right now. Maybe should be moved?Data.List.ToFinsupp
: That's algebra. Should definitely be moved.As a consequence, move the big operators lemmas that were in there to Algebra.BigOperators.List.Basic
. For the lemmas that were Nat
-specific and not about auxiliary definitions, keep a version of them in the original file but stated using Nat.sum
.
Before
After
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
import Mathlib.Data.List.Forall2
-import Mathlib.Order.MinMax
#align_import data.list.zip from "leanprover-community/mathlib"@"134625f523e737f650a6ea7f0c82a6177e45e622"
@@ -21,6 +20,8 @@ applies, until one of the lists is exhausted. For example,
`unzip` undoes `zip`. For example, `unzip [(a₁, b₁), (a₂, b₂)] = ([a₁, a₂], [b₁, b₂])`.
-/
+-- Make sure we don't import algebra
+assert_not_exists Monoid
universe u
@@ -60,15 +61,11 @@ theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
#align list.all₂_zip_with List.forall_zipWith
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l.length := by
- rw [length_zipWith, lt_min_iff] at h
- exact h.left
+ (h : i < (zipWith f l l').length) : i < l.length := by rw [length_zipWith] at h; omega
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l'.length := by
- rw [length_zipWith, lt_min_iff] at h
- exact h.right
+ (h : i < (zipWith f l l').length) : i < l'.length := by rw [length_zipWith] at h; omega
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
theorem lt_length_left_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (zip l l').length) :
Data.List.Count
, Data.List.Dedup
, Data.List.ProdSigma
, Data.List.Range
, Data.List.Rotate
, Data.List.Zip
not depend on Data.List.BigOperators.Basic
.Data.List.BigOperators.Basic
. For the lemmas that were Nat
-specific, keep a version of them in the original file but stated using Nat.sum
.Nat.sum_eq_listSum (l : List Nat) : Nat.sum l = l.sum
.@@ -3,8 +3,8 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
-import Mathlib.Algebra.BigOperators.List.Basic
-import Mathlib.Algebra.Order.Monoid.MinMax
+import Mathlib.Data.List.Forall2
+import Mathlib.Order.MinMax
#align_import data.list.zip from "leanprover-community/mathlib"@"134625f523e737f650a6ea7f0c82a6177e45e622"
@@ -349,16 +349,6 @@ theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : Li
· simp [hl]
#align list.map_uncurry_zip_eq_zip_with List.map_uncurry_zip_eq_zipWith
-@[simp]
-theorem sum_zipWith_distrib_left {γ : Type*} [Semiring γ] (f : α → β → γ) (n : γ) (l : List α)
- (l' : List β) : (l.zipWith (fun x y => n * f x y) l').sum = n * (l.zipWith f l').sum := by
- induction' l with hd tl hl generalizing f n l'
- · simp
- · cases' l' with hd' tl'
- · simp
- · simp [hl, mul_add]
-#align list.sum_zip_with_distrib_left List.sum_zipWith_distrib_left
-
section Distrib
/-! ### Operations that can be applied before or after a `zip_with` -/
@@ -377,42 +367,10 @@ theorem zipWith_distrib_reverse (h : l.length = l'.length) :
· simp
· cases' l' with hd' tl'
· simp
- · simp only [add_left_inj, length] at h
+ · simp only [Nat.add_left_inj, length] at h
have : tl.reverse.length = tl'.reverse.length := by simp [h]
simp [hl _ h, zipWith_append _ _ _ _ _ this]
#align list.zip_with_distrib_reverse List.zipWith_distrib_reverse
end Distrib
-
-section CommMonoid
-
-variable [CommMonoid α]
-
-@[to_additive]
-theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
- ∀ L L' : List α,
- L.prod * L'.prod =
- (zipWith (· * ·) L L').prod * (L.drop L'.length).prod * (L'.drop L.length).prod
- | [], ys => by simp [Nat.zero_le]
- | xs, [] => by simp [Nat.zero_le]
- | x :: xs, y :: ys => by
- simp only [drop, length, zipWith_cons_cons, prod_cons]
- conv =>
- lhs; rw [mul_assoc]; right; rw [mul_comm, mul_assoc]; right
- rw [mul_comm, prod_mul_prod_eq_prod_zipWith_mul_prod_drop xs ys]
- simp only [add_eq, add_zero]
- ac_rfl
-#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
-#align list.sum_add_sum_eq_sum_zip_with_add_sum_drop List.sum_add_sum_eq_sum_zipWith_add_sum_drop
-
-@[to_additive]
-theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
- L.prod * L'.prod = (zipWith (· * ·) L L').prod := by
- apply (prod_mul_prod_eq_prod_zipWith_mul_prod_drop L L').trans
- rw [← h, drop_length, h, drop_length, prod_nil, mul_one, mul_one]
-#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eq
-#align list.sum_add_sum_eq_sum_zip_with_of_length_eq List.sum_add_sum_eq_sum_zipWith_of_length_eq
-
-end CommMonoid
-
end List
Algebra.BigOperators.List
(#11729)
This is algebra and should be foldered as such.
@@ -3,7 +3,7 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
-import Mathlib.Data.List.BigOperators.Basic
+import Mathlib.Algebra.BigOperators.List.Basic
import Mathlib.Algebra.Order.Monoid.MinMax
#align_import data.list.zip from "leanprover-community/mathlib"@"134625f523e737f650a6ea7f0c82a6177e45e622"
∃ x ∈ s, _
instead of ∃ (x) (_ : x ∈ s), _
(#9184)
Search for [∀∃].*(_
and manually replace some occurrences with more readable versions.
In case of ∀
, the new expressions are defeq to the old ones.
In case of ∃
, they differ by exists_prop
.
In some rare cases, golf proofs that needed fixing.
@@ -51,8 +51,8 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
#align list.length_zip List.length_zip
theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
- ∀ {l₁ : List α} {l₂ : List β} (_h : length l₁ = length l₂),
- Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
+ ∀ {l₁ : List α} {l₂ : List β}, length l₁ = length l₂ →
+ (Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂)
| [], [], _ => by simp
| a :: l₁, b :: l₂, h => by
simp only [length_cons, succ_inj'] at h
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -34,12 +34,7 @@ variable {α : Type u} {β γ δ ε : Type*}
#align list.zip_cons_cons List.zip_cons_cons
#align list.zip_with_nil_left List.zipWith_nil_left
#align list.zip_with_nil_right List.zipWith_nil_right
-
-@[simp]
-theorem zipWith_eq_nil_iff {f : α → β → γ} {l l'} : zipWith f l l' = [] ↔ l = [] ∨ l' = [] := by
- cases l <;> cases l' <;> simp
#align list.zip_with_eq_nil_iff List.zipWith_eq_nil_iff
-
#align list.zip_nil_left List.zip_nil_left
#align list.zip_nil_right List.zip_nil_right
@@ -86,35 +81,14 @@ theorem lt_length_right_of_zip {i : ℕ} {l : List α} {l' : List β} (h : i < (
lt_length_right_of_zipWith h
#align list.lt_length_right_of_zip List.lt_length_right_of_zip
-theorem zip_append :
- ∀ {l₁ r₁ : List α} {l₂ r₂ : List β} (_h : length l₁ = length l₂),
- zip (l₁ ++ r₁) (l₂ ++ r₂) = zip l₁ l₂ ++ zip r₁ r₂
- | [], r₁, l₂, r₂, h => by simp only [eq_nil_of_length_eq_zero h.symm]; rfl
- | l₁, r₁, [], r₂, h => by simp only [eq_nil_of_length_eq_zero h]; rfl
- | a :: l₁, r₁, b :: l₂, r₂, h => by
- simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)]
#align list.zip_append List.zip_append
-
#align list.zip_map List.zip_map
#align list.zip_map_left List.zip_map_left
#align list.zip_map_right List.zip_map_right
#align list.zip_with_map List.zipWith_map
#align list.zip_with_map_left List.zipWith_map_left
#align list.zip_with_map_right List.zipWith_map_right
-
-theorem zip_map' (f : α → β) (g : α → γ) :
- ∀ l : List α, zip (l.map f) (l.map g) = l.map fun a => (f a, g a)
- | [] => rfl
- | a :: l => by simp only [map, zip_cons_cons, zip_map']
#align list.zip_map' List.zip_map'
-
-theorem map_zipWith {δ : Type*} (f : α → β) (g : γ → δ → α) (l : List γ) (l' : List δ) :
- map f (zipWith g l l') = zipWith (fun x y => f (g x y)) l l' := by
- induction' l with hd tl hl generalizing l'
- · simp
- · cases l'
- · simp
- · simp [hl]
#align list.map_zip_with List.map_zipWith
theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l₁ l₂ → a ∈ l₁ ∧ b ∈ l₂
@@ -125,30 +99,9 @@ theorem mem_zip {a b} : ∀ {l₁ : List α} {l₂ : List β}, (a, b) ∈ zip l
exact ⟨Mem.tail _ this.1, Mem.tail _ this.2⟩
#align list.mem_zip List.mem_zip
-theorem map_fst_zip :
- ∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
- | [], bs, _ => rfl
- | _ :: as, _ :: bs, h => by
- simp? [succ_le_succ_iff] at h says simp only [length_cons, succ_le_succ_iff] at h
- change _ :: map Prod.fst (zip as bs) = _ :: as
- rw [map_fst_zip as bs h]
- | a :: as, [], h => by simp at h
#align list.map_fst_zip List.map_fst_zip
-
-theorem map_snd_zip :
- ∀ (l₁ : List α) (l₂ : List β), l₂.length ≤ l₁.length → map Prod.snd (zip l₁ l₂) = l₂
- | _, [], _ => by
- rw [zip_nil_right]
- rfl
- | [], b :: bs, h => by simp at h
- | a :: as, b :: bs, h => by
- simp? [succ_le_succ_iff] at h says simp only [length_cons, succ_le_succ_iff] at h
- change _ :: map Prod.snd (zip as bs) = _ :: bs
- rw [map_snd_zip as bs h]
#align list.map_snd_zip List.map_snd_zip
-
#align list.unzip_nil List.unzip_nil
-
#align list.unzip_cons List.unzip_cons
theorem unzip_eq_map : ∀ l : List (α × β), unzip l = (l.map Prod.fst, l.map Prod.snd)
@@ -413,40 +366,9 @@ section Distrib
variable (f : α → β → γ) (l : List α) (l' : List β) (n : ℕ)
-theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l'.take n) := by
- induction' l with hd tl hl generalizing l' n
- · simp
- · cases l'
- · simp
- · cases n
- · simp
- · simp [hl]
#align list.zip_with_distrib_take List.zipWith_distrib_take
-
-theorem zipWith_distrib_drop : (zipWith f l l').drop n = zipWith f (l.drop n) (l'.drop n) := by
- induction' l with hd tl hl generalizing l' n
- · simp
- · cases l'
- · simp
- · cases n
- · simp
- · simp [hl]
#align list.zip_with_distrib_drop List.zipWith_distrib_drop
-
-theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail := by
- simp_rw [← drop_one, zipWith_distrib_drop]
#align list.zip_with_distrib_tail List.zipWith_distrib_tail
-
-theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
- (h : l.length = l'.length) :
- zipWith f (l ++ la) (l' ++ lb) = zipWith f l l' ++ zipWith f la lb := by
- induction' l with hd tl hl generalizing l'
- · have : l' = [] := eq_nil_of_length_eq_zero (by simpa using h.symm)
- simp [this]
- · cases l'
- · simp at h
- · simp only [add_left_inj, length] at h
- simp [hl _ h]
#align list.zip_with_append List.zipWith_append
theorem zipWith_distrib_reverse (h : l.length = l'.length) :
@@ -129,7 +129,7 @@ theorem map_fst_zip :
∀ (l₁ : List α) (l₂ : List β), l₁.length ≤ l₂.length → map Prod.fst (zip l₁ l₂) = l₁
| [], bs, _ => rfl
| _ :: as, _ :: bs, h => by
- simp [succ_le_succ_iff] at h
+ simp? [succ_le_succ_iff] at h says simp only [length_cons, succ_le_succ_iff] at h
change _ :: map Prod.fst (zip as bs) = _ :: as
rw [map_fst_zip as bs h]
| a :: as, [], h => by simp at h
@@ -142,7 +142,7 @@ theorem map_snd_zip :
rfl
| [], b :: bs, h => by simp at h
| a :: as, b :: bs, h => by
- simp [succ_le_succ_iff] at h
+ simp? [succ_le_succ_iff] at h says simp only [length_cons, succ_le_succ_iff] at h
change _ :: map Prod.snd (zip as bs) = _ :: bs
rw [map_snd_zip as bs h]
#align list.map_snd_zip List.map_snd_zip
This renames List.All₂
to List.Forall
, because the ₂
is highly
confusing when it usually means “two lists”, and we had users on Zulip
not find List.Forall
because of that
(https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/Is.20there.20List.2EForall.E2.82.82.2C.20but.20for.20one.20list.3F.20.28In.20library.20Std.29/near/397551365)
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -55,14 +55,14 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
#align list.length_zip List.length_zip
-theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
+theorem forall_zipWith {f : α → β → γ} {p : γ → Prop} :
∀ {l₁ : List α} {l₂ : List β} (_h : length l₁ = length l₂),
- All₂ p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
+ Forall p (zipWith f l₁ l₂) ↔ Forall₂ (fun x y => p (f x y)) l₁ l₂
| [], [], _ => by simp
| a :: l₁, b :: l₂, h => by
simp only [length_cons, succ_inj'] at h
- simp [all₂_zipWith h]
-#align list.all₂_zip_with List.all₂_zipWith
+ simp [forall_zipWith h]
+#align list.all₂_zip_with List.forall_zipWith
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
(h : i < (zipWith f l l').length) : i < l.length := by
Some deleted lemmas have been upstreamed to Std.
Note that the statements of List.zipWith_map_left
(and _right
) have been changed, requiring slight changes here.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
@@ -95,40 +95,11 @@ theorem zip_append :
simp only [cons_append, zip_cons_cons, zip_append (succ.inj h)]
#align list.zip_append List.zip_append
-theorem zip_map (f : α → γ) (g : β → δ) :
- ∀ (l₁ : List α) (l₂ : List β), zip (l₁.map f) (l₂.map g) = (zip l₁ l₂).map (Prod.map f g)
- | [], l₂ => rfl
- | l₁, [] => by simp only [map, zip_nil_right]
- | a :: l₁, b :: l₂ => by
- simp only [map, zip_cons_cons, zip_map, Prod.map]; constructor
#align list.zip_map List.zip_map
-
-theorem zip_map_left (f : α → γ) (l₁ : List α) (l₂ : List β) :
- zip (l₁.map f) l₂ = (zip l₁ l₂).map (Prod.map f id) := by rw [← zip_map, map_id]
#align list.zip_map_left List.zip_map_left
-
-theorem zip_map_right (f : β → γ) (l₁ : List α) (l₂ : List β) :
- zip l₁ (l₂.map f) = (zip l₁ l₂).map (Prod.map id f) := by rw [← zip_map, map_id]
#align list.zip_map_right List.zip_map_right
-
-@[simp]
-theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ) (as : List α) (bs : List β) :
- zipWith f (as.map g) (bs.map h) = zipWith (fun a b => f (g a) (h b)) as bs := by
- induction as generalizing bs
- · simp
- · cases bs <;> simp [*]
#align list.zip_with_map List.zipWith_map
-
-theorem zipWith_map_left (f : α → β → γ) (g : δ → α) (l : List δ) (l' : List β) :
- zipWith f (l.map g) l' = zipWith (f ∘ g) l l' := by
- convert zipWith_map f g id l l'
- exact Eq.symm (List.map_id _)
#align list.zip_with_map_left List.zipWith_map_left
-
-theorem zipWith_map_right (f : α → β → γ) (l : List α) (g : δ → β) (l' : List δ) :
- zipWith f l (l'.map g) = zipWith (fun x => f x ∘ g) l l' := by
- convert List.zipWith_map f id g l l'
- exact Eq.symm (List.map_id _)
#align list.zip_with_map_right List.zipWith_map_right
theorem zip_map' (f : α → β) (g : α → γ) :
@@ -30,21 +30,9 @@ namespace List
variable {α : Type u} {β γ δ ε : Type*}
-@[simp]
-theorem zipWith_cons_cons (f : α → β → γ) (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
- zipWith f (a :: l₁) (b :: l₂) = f a b :: zipWith f l₁ l₂ := rfl
#align list.zip_with_cons_cons List.zipWith_cons_cons
-
-@[simp]
-theorem zip_cons_cons (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
- zip (a :: l₁) (b :: l₂) = (a, b) :: zip l₁ l₂ := rfl
#align list.zip_cons_cons List.zip_cons_cons
-
-@[simp]
-theorem zipWith_nil_left (f : α → β → γ) (l) : zipWith f [] l = [] := rfl
#align list.zip_with_nil_left List.zipWith_nil_left
-
-theorem zipWith_nil_right (f : α → β → γ) (l) : zipWith f l [] = [] := by simp
#align list.zip_with_nil_right List.zipWith_nil_right
@[simp]
@@ -52,19 +40,12 @@ theorem zipWith_eq_nil_iff {f : α → β → γ} {l l'} : zipWith f l l' = []
cases l <;> cases l' <;> simp
#align list.zip_with_eq_nil_iff List.zipWith_eq_nil_iff
-@[simp]
-theorem zip_nil_left (l : List α) : zip ([] : List β) l = [] :=
- rfl
#align list.zip_nil_left List.zip_nil_left
-
-@[simp]
-theorem zip_nil_right (l : List α) : zip l ([] : List β) = [] :=
- zipWith_nil_right _ l
#align list.zip_nil_right List.zip_nil_right
@[simp]
theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Prod.swap = zip l₂ l₁
- | [], l₂ => (zip_nil_right _).symm
+ | [], l₂ => zip_nil_right.symm
| l₁, [] => by rw [zip_nil_right]; rfl
| a :: l₁, b :: l₂ => by
simp only [zip_cons_cons, map_cons, zip_swap l₁ l₂, Prod.swap_prod_mk]
@@ -72,10 +53,6 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
#align list.length_zip_with List.length_zipWith
-@[simp]
-theorem length_zip :
- ∀ (l₁ : List α) (l₂ : List β), length (zip l₁ l₂) = min (length l₁) (length l₂) :=
- length_zipWith _
#align list.length_zip List.length_zip
theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
@@ -199,13 +176,8 @@ theorem map_snd_zip :
rw [map_snd_zip as bs h]
#align list.map_snd_zip List.map_snd_zip
-@[simp]
-theorem unzip_nil : unzip (@nil (α × β)) = ([], []) := rfl
#align list.unzip_nil List.unzip_nil
-@[simp]
-theorem unzip_cons (a : α) (b : β) (l : List (α × β)) :
- unzip ((a, b) :: l) = (a :: (unzip l).1, b :: (unzip l).2) := rfl
#align list.unzip_cons List.unzip_cons
theorem unzip_eq_map : ∀ l : List (α × β), unzip l = (l.map Prod.fst, l.map Prod.snd)
@@ -268,7 +240,7 @@ theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
theorem zipWith_comm (f : α → β → γ) :
∀ (la : List α) (lb : List β), zipWith f la lb = zipWith (fun b a => f a b) lb la
- | [], _ => (List.zipWith_nil_right _ _).symm
+ | [], _ => List.zipWith_nil_right.symm
| _ :: _, [] => rfl
| _ :: as, _ :: bs => congr_arg _ (zipWith_comm f as bs)
#align list.zip_with_comm List.zipWith_comm
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -28,7 +28,7 @@ open Nat
namespace List
-variable {α : Type u} {β γ δ ε : Type _}
+variable {α : Type u} {β γ δ ε : Type*}
@[simp]
theorem zipWith_cons_cons (f : α → β → γ) (a : α) (b : β) (l₁ : List α) (l₂ : List β) :
@@ -160,7 +160,7 @@ theorem zip_map' (f : α → β) (g : α → γ) :
| a :: l => by simp only [map, zip_cons_cons, zip_map']
#align list.zip_map' List.zip_map'
-theorem map_zipWith {δ : Type _} (f : α → β) (g : γ → δ → α) (l : List γ) (l' : List δ) :
+theorem map_zipWith {δ : Type*} (f : α → β) (g : γ → δ → α) (l : List γ) (l' : List δ) :
map f (zipWith g l l') = zipWith (fun x y => f (g x y)) l l' := by
induction' l with hd tl hl generalizing l'
· simp
@@ -454,7 +454,7 @@ theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : Li
#align list.map_uncurry_zip_eq_zip_with List.map_uncurry_zip_eq_zipWith
@[simp]
-theorem sum_zipWith_distrib_left {γ : Type _} [Semiring γ] (f : α → β → γ) (n : γ) (l : List α)
+theorem sum_zipWith_distrib_left {γ : Type*} [Semiring γ] (f : α → β → γ) (n : γ) (l : List α)
(l' : List β) : (l.zipWith (fun x y => n * f x y) l').sum = n * (l.zipWith f l').sum := by
induction' l with hd tl hl generalizing f n l'
· simp
@@ -70,6 +70,8 @@ theorem zip_swap : ∀ (l₁ : List α) (l₂ : List β), (zip l₁ l₂).map Pr
simp only [zip_cons_cons, map_cons, zip_swap l₁ l₂, Prod.swap_prod_mk]
#align list.zip_swap List.zip_swap
+#align list.length_zip_with List.length_zipWith
+
@[simp]
theorem length_zip :
∀ (l₁ : List α) (l₂ : List β), length (zip l₁ l₂) = min (length l₁) (length l₂) :=
@@ -2,15 +2,12 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-
-! This file was ported from Lean 3 source module data.list.zip
-! leanprover-community/mathlib commit 134625f523e737f650a6ea7f0c82a6177e45e622
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.List.BigOperators.Basic
import Mathlib.Algebra.Order.Monoid.MinMax
+#align_import data.list.zip from "leanprover-community/mathlib"@"134625f523e737f650a6ea7f0c82a6177e45e622"
+
/-!
# zip & unzip
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -412,6 +412,7 @@ theorem nthLe_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i :
(zipWith f l l').nthLe i h =
f (l.nthLe i (lt_length_left_of_zipWith h)) (l'.nthLe i (lt_length_right_of_zipWith h)) :=
get_zipWith (i := ⟨i, h⟩)
+#align list.nth_le_zip_with List.nthLe_zipWith
@[simp]
theorem get_zip {l : List α} {l' : List β} {i : Fin (zip l l').length} :
@@ -538,6 +538,7 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
simp only [add_eq, add_zero]
ac_rfl
#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
+#align list.sum_add_sum_eq_sum_zip_with_add_sum_drop List.sum_add_sum_eq_sum_zipWith_add_sum_drop
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
@@ -545,6 +546,7 @@ theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.lengt
apply (prod_mul_prod_eq_prod_zipWith_mul_prod_drop L L').trans
rw [← h, drop_length, h, drop_length, prod_nil, mul_one, mul_one]
#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eq
+#align list.sum_add_sum_eq_sum_zip_with_of_length_eq List.sum_add_sum_eq_sum_zipWith_of_length_eq
end CommMonoid
by
line breaks (#1523)
During porting, I usually fix the desired format we seem to want for the line breaks around by
with
awk '{do {{if (match($0, "^ by$") && length(p) < 98) {p=p " by";} else {if (NR!=1) {print p}; p=$0}}} while (getline == 1) if (getline==0) print p}' Mathlib/File/Im/Working/On.lean
I noticed there are some more files that slipped through.
This pull request is the result of running this command:
grep -lr "^ by\$" Mathlib | xargs -n 1 awk -i inplace '{do {{if (match($0, "^ by$") && length(p) < 98 && not (match(p, "^[ \t]*--"))) {p=p " by";} else {if (NR!=1) {print p}; p=$0}}} while (getline == 1) if (getline==0) print p}'
Co-authored-by: Moritz Firsching <firsching@google.com>
@@ -89,15 +89,13 @@ theorem all₂_zipWith {f : α → β → γ} {p : γ → Prop} :
#align list.all₂_zip_with List.all₂_zipWith
theorem lt_length_left_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l.length :=
- by
+ (h : i < (zipWith f l l').length) : i < l.length := by
rw [length_zipWith, lt_min_iff] at h
exact h.left
#align list.lt_length_left_of_zip_with List.lt_length_left_of_zipWith
theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
- (h : i < (zipWith f l l').length) : i < l'.length :=
- by
+ (h : i < (zipWith f l l').length) : i < l'.length := by
rw [length_zipWith, lt_min_iff] at h
exact h.right
#align list.lt_length_right_of_zip_with List.lt_length_right_of_zipWith
@@ -256,16 +254,14 @@ theorem zip_of_prod {l : List α} {l' : List β} {lp : List (α × β)} (hl : lp
#align list.zip_of_prod List.zip_of_prod
theorem map_prod_left_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (x, f x)) = l.zip (l.map f) :=
- by
+ (l.map fun x => (x, f x)) = l.zip (l.map f) := by
rw [← zip_map']
congr
exact map_id _
#align list.map_prod_left_eq_zip List.map_prod_left_eq_zip
theorem map_prod_right_eq_zip {l : List α} (f : α → β) :
- (l.map fun x => (f x, x)) = (l.map f).zip l :=
- by
+ (l.map fun x => (f x, x)) = (l.map f).zip l := by
rw [← zip_map']
congr
exact map_id _
@@ -280,8 +276,7 @@ theorem zipWith_comm (f : α → β → γ) :
@[congr]
theorem zipWith_congr (f g : α → β → γ) (la : List α) (lb : List β)
- (h : List.Forall₂ (fun a b => f a b = g a b) la lb) : zipWith f la lb = zipWith g la lb :=
- by
+ (h : List.Forall₂ (fun a b => f a b = g a b) la lb) : zipWith f la lb = zipWith g la lb := by
induction' h with a b as bs hfg _ ih
· rfl
· exact congr_arg₂ _ hfg ih
@@ -432,8 +427,7 @@ theorem nthLe_zip {l : List α} {l' : List β} {i : ℕ} {h : i < (zip l l').len
#align list.nth_le_zip List.nthLe_zip
theorem mem_zip_inits_tails {l : List α} {init tail : List α} :
- (init, tail) ∈ zip l.inits l.tails ↔ init ++ tail = l :=
- by
+ (init, tail) ∈ zip l.inits l.tails ↔ init ++ tail = l := by
induction' l with hd tl ih generalizing init tail <;> simp_rw [tails, inits, zip_cons_cons]
· simp
· constructor <;> rw [mem_cons, zip_map_left, mem_map, Prod.exists]
@@ -513,8 +507,7 @@ theorem zipWith_append (f : α → β → γ) (l la : List α) (l' lb : List β)
#align list.zip_with_append List.zipWith_append
theorem zipWith_distrib_reverse (h : l.length = l'.length) :
- (zipWith f l l').reverse = zipWith f l.reverse l'.reverse :=
- by
+ (zipWith f l l').reverse = zipWith f l.reverse l'.reverse := by
induction' l with hd tl hl generalizing l'
· simp
· cases' l' with hd' tl'
@@ -544,16 +544,14 @@ theorem prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
rw [mul_comm, prod_mul_prod_eq_prod_zipWith_mul_prod_drop xs ys]
simp only [add_eq, add_zero]
ac_rfl
-#align
- list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
+#align list.prod_mul_prod_eq_prod_zip_with_mul_prod_drop List.prod_mul_prod_eq_prod_zipWith_mul_prod_drop
@[to_additive]
theorem prod_mul_prod_eq_prod_zipWith_of_length_eq (L L' : List α) (h : L.length = L'.length) :
L.prod * L'.prod = (zipWith (· * ·) L L').prod := by
apply (prod_mul_prod_eq_prod_zipWith_mul_prod_drop L L').trans
rw [← h, drop_length, h, drop_length, prod_nil, mul_one, mul_one]
-#align
- list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eq
+#align list.prod_mul_prod_eq_prod_zip_with_of_length_eq List.prod_mul_prod_eq_prod_zipWith_of_length_eq
end CommMonoid
The unported dependencies are