data.fin.tuple.reflectionMathlib.Data.Fin.Tuple.Reflection

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.Data.Fin.VecNotation
-import Mathbin.Algebra.BigOperators.Fin
+import Data.Fin.VecNotation
+import Algebra.BigOperators.Fin
 
 #align_import data.fin.tuple.reflection from "leanprover-community/mathlib"@"d64d67d000b974f0d86a2be7918cf800be6271c8"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module data.fin.tuple.reflection
-! leanprover-community/mathlib commit d64d67d000b974f0d86a2be7918cf800be6271c8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Fin.VecNotation
 import Mathbin.Algebra.BigOperators.Fin
 
+#align_import data.fin.tuple.reflection from "leanprover-community/mathlib"@"d64d67d000b974f0d86a2be7918cf800be6271c8"
+
 /-!
 # Lemmas for tuples `fin m → α`
 
Diff
@@ -178,7 +178,7 @@ example [add_comm_monoid α] (a : fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :
 theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a i
   | 0, a => rfl
   | 1, a => (Fintype.sum_unique a).symm
-  | n + 2, a => by rw [Fin.sum_univ_castSuccEmb, Sum, sum_eq]
+  | n + 2, a => by rw [Fin.sum_univ_castSucc, Sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 -/
 
Diff
@@ -161,7 +161,7 @@ example (P : (Fin 2 → α) → Prop) : (∃ f, P f) ↔ ∃ a₀ a₁, P ![a₀
 def sum [Add α] [Zero α] : ∀ {m} (v : Fin m → α), α
   | 0, v => 0
   | 1, v => v 0
-  | n + 2, v => Sum (v ∘ Fin.castSucc) + v (Fin.last _)
+  | n + 2, v => Sum (v ∘ Fin.castSuccEmb) + v (Fin.last _)
 #align fin_vec.sum FinVec.sum
 -/
 
@@ -178,7 +178,7 @@ example [add_comm_monoid α] (a : fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :
 theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a i
   | 0, a => rfl
   | 1, a => (Fintype.sum_unique a).symm
-  | n + 2, a => by rw [Fin.sum_univ_castSucc, Sum, sum_eq]
+  | n + 2, a => by rw [Fin.sum_univ_castSuccEmb, Sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 -/
 
Diff
@@ -167,6 +167,7 @@ def sum [Add α] [Zero α] : ∀ {m} (v : Fin m → α), α
 
 open scoped BigOperators
 
+#print FinVec.sum_eq /-
 /-- This can be used to prove
 ```lean
 example [add_comm_monoid α] (a : fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
@@ -179,6 +180,7 @@ theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a
   | 1, a => (Fintype.sum_unique a).symm
   | n + 2, a => by rw [Fin.sum_univ_castSucc, Sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
+-/
 
 example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
   (sum_eq _).symm
Diff
@@ -180,7 +180,7 @@ theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a
   | n + 2, a => by rw [Fin.sum_univ_castSucc, Sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 
-example [AddCommMonoid α] (a : Fin 3 → α) : (∑ i, a i) = a 0 + a 1 + a 2 :=
+example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
   (sum_eq _).symm
 
 end FinVec
Diff
@@ -165,7 +165,7 @@ def sum [Add α] [Zero α] : ∀ {m} (v : Fin m → α), α
 #align fin_vec.sum FinVec.sum
 -/
 
-open BigOperators
+open scoped BigOperators
 
 /-- This can be used to prove
 ```lean
Diff
@@ -167,12 +167,6 @@ def sum [Add α] [Zero α] : ∀ {m} (v : Fin m → α), α
 
 open BigOperators
 
-/- warning: fin_vec.sum_eq -> FinVec.sum_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] {m : Nat} (a : (Fin m) -> α), Eq.{succ u1} α (FinVec.sum.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) m a) (Finset.sum.{u1, 0} α (Fin m) _inst_1 (Finset.univ.{0} (Fin m) (Fin.fintype m)) (fun (i : Fin m) => a i))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] {m : Nat} (a : (Fin m) -> α), Eq.{succ u1} α (FinVec.sum.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) (AddMonoid.toZero.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)) m a) (Finset.sum.{u1, 0} α (Fin m) _inst_1 (Finset.univ.{0} (Fin m) (Fin.fintype m)) (fun (i : Fin m) => a i))
-Case conversion may be inaccurate. Consider using '#align fin_vec.sum_eq FinVec.sum_eqₓ'. -/
 /-- This can be used to prove
 ```lean
 example [add_comm_monoid α] (a : fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
Diff
@@ -57,8 +57,7 @@ theorem seq_eq : ∀ {m} (f : Fin m → α → β) (v : Fin m → α), seq f v =
       simp_rw [seq, seq_eq]
       refine' i.cases _ fun i => _
       · rfl
-      · simp only [Matrix.cons_val_succ]
-        rfl
+      · simp only [Matrix.cons_val_succ]; rfl
 #align fin_vec.seq_eq FinVec.seq_eq
 -/
 
@@ -126,9 +125,7 @@ example (P : (fin 2 → α) → Prop) : (∀ f, P f) ↔ (∀ a₀ a₁, P ![a
 -/
 @[simp]
 theorem forall_iff : ∀ {m} (P : (Fin m → α) → Prop), Forall P ↔ ∀ x, P x
-  | 0, P => by
-    simp only [forall, Fin.forall_fin_zero_pi]
-    rfl
+  | 0, P => by simp only [forall, Fin.forall_fin_zero_pi]; rfl
   | n + 1, P => by simp only [forall, forall_iff, Fin.forall_fin_succ_pi, Matrix.vecCons]
 #align fin_vec.forall_iff FinVec.forall_iff
 -/
@@ -151,9 +148,7 @@ example (P : (fin 2 → α) → Prop) : (∃ f, P f) ↔ (∃ a₀ a₁, P ![a
 ```
 -/
 theorem exists_iff : ∀ {m} (P : (Fin m → α) → Prop), Exists P ↔ ∃ x, P x
-  | 0, P => by
-    simp only [exists, Fin.exists_fin_zero_pi, Matrix.vecEmpty]
-    rfl
+  | 0, P => by simp only [exists, Fin.exists_fin_zero_pi, Matrix.vecEmpty]; rfl
   | n + 1, P => by simp only [exists, exists_iff, Fin.exists_fin_succ_pi, Matrix.vecCons]
 #align fin_vec.exists_iff FinVec.exists_iff
 -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module data.fin.tuple.reflection
-! leanprover-community/mathlib commit d95bef0d215ea58c0fd7bbc4b151bf3fe952c095
+! leanprover-community/mathlib commit d64d67d000b974f0d86a2be7918cf800be6271c8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Algebra.BigOperators.Fin
 /-!
 # Lemmas for tuples `fin m → α`
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains alternative definitions of common operators on vectors which expand
 definitionally to the expected expression when evaluated on `![]` notation.
 
Diff
@@ -37,12 +37,15 @@ namespace FinVec
 
 variable {m n : ℕ} {α β γ : Type _}
 
+#print FinVec.seq /-
 /-- Evaluate `fin_vec.seq f v = ![(f 0) (v 0), (f 1) (v 1), ...]` -/
 def seq : ∀ {m}, (Fin m → α → β) → (Fin m → α) → Fin m → β
   | 0, f, v => ![]
   | n + 1, f, v => Matrix.vecCons (f 0 (v 0)) (seq (Matrix.vecTail f) (Matrix.vecTail v))
 #align fin_vec.seq FinVec.seq
+-/
 
+#print FinVec.seq_eq /-
 @[simp]
 theorem seq_eq : ∀ {m} (f : Fin m → α → β) (v : Fin m → α), seq f v = fun i => f i (v i)
   | 0, f, v => Subsingleton.elim _ _
@@ -54,15 +57,19 @@ theorem seq_eq : ∀ {m} (f : Fin m → α → β) (v : Fin m → α), seq f v =
       · simp only [Matrix.cons_val_succ]
         rfl
 #align fin_vec.seq_eq FinVec.seq_eq
+-/
 
 example {f₁ f₂ : α → β} (a₁ a₂ : α) : seq ![f₁, f₂] ![a₁, a₂] = ![f₁ a₁, f₂ a₂] :=
   rfl
 
+#print FinVec.map /-
 /-- `fin_vec.map f v = ![f (v 0), f (v 1), ...]` -/
 def map (f : α → β) {m} : (Fin m → α) → Fin m → β :=
   seq fun i => f
 #align fin_vec.map FinVec.map
+-/
 
+#print FinVec.map_eq /-
 /-- This can be use to prove
 ```lean
 example {f : α → β} (a₁ a₂ : α) : f ∘ ![a₁, a₂] = ![f a₁, f a₂] :=
@@ -73,15 +80,19 @@ example {f : α → β} (a₁ a₂ : α) : f ∘ ![a₁, a₂] = ![f a₁, f a
 theorem map_eq (f : α → β) {m} (v : Fin m → α) : map f v = f ∘ v :=
   seq_eq _ _
 #align fin_vec.map_eq FinVec.map_eq
+-/
 
 example {f : α → β} (a₁ a₂ : α) : f ∘ ![a₁, a₂] = ![f a₁, f a₂] :=
   (map_eq _ _).symm
 
+#print FinVec.etaExpand /-
 /-- Expand `v` to `![v 0, v 1, ...]` -/
 def etaExpand {m} (v : Fin m → α) : Fin m → α :=
   map id v
 #align fin_vec.eta_expand FinVec.etaExpand
+-/
 
+#print FinVec.etaExpand_eq /-
 /-- This can be use to prove
 ```lean
 example {f : α → β} (a : fin 2 → α) : a = ![a 0, a 1] := (eta_expand_eq _).symm
@@ -91,16 +102,20 @@ example {f : α → β} (a : fin 2 → α) : a = ![a 0, a 1] := (eta_expand_eq _
 theorem etaExpand_eq {m} (v : Fin m → α) : etaExpand v = v :=
   map_eq id v
 #align fin_vec.eta_expand_eq FinVec.etaExpand_eq
+-/
 
 example {f : α → β} (a : Fin 2 → α) : a = ![a 0, a 1] :=
   (etaExpand_eq _).symm
 
+#print FinVec.Forall /-
 /-- `∀` with better defeq for `∀ x : fin m → α, P x`. -/
 def Forall : ∀ {m} (P : (Fin m → α) → Prop), Prop
   | 0, P => P ![]
   | n + 1, P => ∀ x : α, forall fun v => P (Matrix.vecCons x v)
 #align fin_vec.forall FinVec.Forall
+-/
 
+#print FinVec.forall_iff /-
 /-- This can be use to prove
 ```lean
 example (P : (fin 2 → α) → Prop) : (∀ f, P f) ↔ (∀ a₀ a₁, P ![a₀, a₁]) := (forall_iff _).symm
@@ -113,16 +128,20 @@ theorem forall_iff : ∀ {m} (P : (Fin m → α) → Prop), Forall P ↔ ∀ x,
     rfl
   | n + 1, P => by simp only [forall, forall_iff, Fin.forall_fin_succ_pi, Matrix.vecCons]
 #align fin_vec.forall_iff FinVec.forall_iff
+-/
 
 example (P : (Fin 2 → α) → Prop) : (∀ f, P f) ↔ ∀ a₀ a₁, P ![a₀, a₁] :=
   (forall_iff _).symm
 
+#print FinVec.Exists /-
 /-- `∃` with better defeq for `∃ x : fin m → α, P x`. -/
 def Exists : ∀ {m} (P : (Fin m → α) → Prop), Prop
   | 0, P => P ![]
   | n + 1, P => ∃ x : α, exists fun v => P (Matrix.vecCons x v)
 #align fin_vec.exists FinVec.Exists
+-/
 
+#print FinVec.exists_iff /-
 /-- This can be use to prove
 ```lean
 example (P : (fin 2 → α) → Prop) : (∃ f, P f) ↔ (∃ a₀ a₁, P ![a₀, a₁]) := (exists_iff _).symm
@@ -134,19 +153,28 @@ theorem exists_iff : ∀ {m} (P : (Fin m → α) → Prop), Exists P ↔ ∃ x,
     rfl
   | n + 1, P => by simp only [exists, exists_iff, Fin.exists_fin_succ_pi, Matrix.vecCons]
 #align fin_vec.exists_iff FinVec.exists_iff
+-/
 
 example (P : (Fin 2 → α) → Prop) : (∃ f, P f) ↔ ∃ a₀ a₁, P ![a₀, a₁] :=
   (exists_iff _).symm
 
+#print FinVec.sum /-
 /-- `finset.univ.sum` with better defeq for `fin` -/
 def sum [Add α] [Zero α] : ∀ {m} (v : Fin m → α), α
   | 0, v => 0
   | 1, v => v 0
   | n + 2, v => Sum (v ∘ Fin.castSucc) + v (Fin.last _)
 #align fin_vec.sum FinVec.sum
+-/
 
 open BigOperators
 
+/- warning: fin_vec.sum_eq -> FinVec.sum_eq is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] {m : Nat} (a : (Fin m) -> α), Eq.{succ u1} α (FinVec.sum.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) m a) (Finset.sum.{u1, 0} α (Fin m) _inst_1 (Finset.univ.{0} (Fin m) (Fin.fintype m)) (fun (i : Fin m) => a i))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] {m : Nat} (a : (Fin m) -> α), Eq.{succ u1} α (FinVec.sum.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))) (AddMonoid.toZero.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)) m a) (Finset.sum.{u1, 0} α (Fin m) _inst_1 (Finset.univ.{0} (Fin m) (Fin.fintype m)) (fun (i : Fin m) => a i))
+Case conversion may be inaccurate. Consider using '#align fin_vec.sum_eq FinVec.sum_eqₓ'. -/
 /-- This can be used to prove
 ```lean
 example [add_comm_monoid α] (a : fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=

Changes in mathlib4

mathlib3
mathlib4
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -141,7 +141,7 @@ example (P : (Fin 2 → α) → Prop) : (∃ f, P f) ↔ ∃ a₀ a₁, P ![a₀
 def sum [Add α] [Zero α] : ∀ {m} (_ : Fin m → α), α
   | 0, _ => 0
   | 1, v => v 0
-  -- porting note: inline `∘` since it is no longer reducible
+  -- Porting note: inline `∘` since it is no longer reducible
   | _ + 2, v => sum (fun i => v (Fin.castSucc i)) + v (Fin.last _)
 #align fin_vec.sum FinVec.sum
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -32,7 +32,7 @@ corresponding `*_eq` lemmas to be used in a place where they are definitionally
 
 namespace FinVec
 
-variable {m n : ℕ} {α β γ : Type _}
+variable {m n : ℕ} {α β γ : Type*}
 
 /-- Evaluate `FinVec.seq f v = ![(f 0) (v 0), (f 1) (v 1), ...]` -/
 def seq : ∀ {m}, (Fin m → α → β) → (Fin m → α) → Fin m → β
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module data.fin.tuple.reflection
-! leanprover-community/mathlib commit d95bef0d215ea58c0fd7bbc4b151bf3fe952c095
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Fin.VecNotation
 import Mathlib.Algebra.BigOperators.Fin
 
+#align_import data.fin.tuple.reflection from "leanprover-community/mathlib"@"d95bef0d215ea58c0fd7bbc4b151bf3fe952c095"
+
 /-!
 # Lemmas for tuples `Fin m → α`
 
chore: bump to nightly-2023-07-01 (#5409)

Open in Gitpod

Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -145,7 +145,7 @@ def sum [Add α] [Zero α] : ∀ {m} (_ : Fin m → α), α
   | 0, _ => 0
   | 1, v => v 0
   -- porting note: inline `∘` since it is no longer reducible
-  | _ + 2, v => sum (fun i => v (Fin.castSuccEmb i)) + v (Fin.last _)
+  | _ + 2, v => sum (fun i => v (Fin.castSucc i)) + v (Fin.last _)
 #align fin_vec.sum FinVec.sum
 
 open BigOperators
@@ -160,7 +160,7 @@ example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
 theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a i
   | 0, a => rfl
   | 1, a => (Fintype.sum_unique a).symm
-  | n + 2, a => by rw [Fin.sum_univ_castSuccEmb, sum, sum_eq]
+  | n + 2, a => by rw [Fin.sum_univ_castSucc, sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 
 example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
chore: rename Fin.castSucc to Fin.castSuccEmb (#5729)

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -145,7 +145,7 @@ def sum [Add α] [Zero α] : ∀ {m} (_ : Fin m → α), α
   | 0, _ => 0
   | 1, v => v 0
   -- porting note: inline `∘` since it is no longer reducible
-  | _ + 2, v => sum (fun i => v (Fin.castSucc i)) + v (Fin.last _)
+  | _ + 2, v => sum (fun i => v (Fin.castSuccEmb i)) + v (Fin.last _)
 #align fin_vec.sum FinVec.sum
 
 open BigOperators
@@ -160,7 +160,7 @@ example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
 theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a i
   | 0, a => rfl
   | 1, a => (Fintype.sum_unique a).symm
-  | n + 2, a => by rw [Fin.sum_univ_castSucc, sum, sum_eq]
+  | n + 2, a => by rw [Fin.sum_univ_castSuccEmb, sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 
 example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
fix: ∑' precedence (#5615)
  • Also remove most superfluous parentheses around big operators (, and variants).
  • roughly the used regex: ([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤]) replaced by $1 $2 $3
Diff
@@ -152,7 +152,7 @@ open BigOperators
 
 /-- This can be used to prove
 ```lean
-example [AddCommMonoid α] (a : Fin 3 → α) : (∑ i, a i) = a 0 + a 1 + a 2 :=
+example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
   (sum_eq _).symm
 ```
 -/
@@ -163,7 +163,7 @@ theorem sum_eq [AddCommMonoid α] : ∀ {m} (a : Fin m → α), sum a = ∑ i, a
   | n + 2, a => by rw [Fin.sum_univ_castSucc, sum, sum_eq]
 #align fin_vec.sum_eq FinVec.sum_eq
 
-example [AddCommMonoid α] (a : Fin 3 → α) : (∑ i, a i) = a 0 + a 1 + a 2 :=
+example [AddCommMonoid α] (a : Fin 3 → α) : ∑ i, a i = a 0 + a 1 + a 2 :=
   (sum_eq _).symm
 
 end FinVec
feat: port Data.Fin.Tuple.Reflection (#3237)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Dependencies 7 + 242

243 files ported (97.2%)
103665 lines ported (97.1%)
Show graph

The unported dependencies are